Page 1 of 1
redirecting console output of bochs
Posted: Thu Apr 12, 2012 7:51 pm
by vjain20
Hi,
I am try to write an OS by following a tutorial. I am using bochs as the emulator.
The OS writes to the screen by writing to vga memory. I need to know if there is a way to
redirect the output in bochs' console to a file. The problem is that bochs terminal doesnt allow scrolling so if there
are many lines of text there is no way to see the all the lines as they just scroll through fast.
What should I do ?
Re: redirecting console output of bochs
Posted: Thu Apr 12, 2012 7:52 pm
by thepowersgang
Use the port 0xE9 hack, or use the serial port.
Re: redirecting console output of bochs
Posted: Thu Apr 12, 2012 11:17 pm
by Combuster
Read the manual on bochsrc
Re: redirecting console output of bochs
Posted: Fri Apr 13, 2012 2:14 am
by bubach
add line "log: bochsout.txt" in the bochsrc config-file.
Re: redirecting console output of bochs
Posted: Fri Apr 13, 2012 4:40 pm
by vjain20
bubach wrote:add line "log: bochsout.txt" in the bochsrc config-file.
I am not asking about the ouput of bochs itself. Logging is already enabled.I am asking about
the text that is written by the kernel to the terminal.
- Thanks
Re: redirecting console output of bochs
Posted: Fri Apr 13, 2012 4:54 pm
by Combuster
I just tried the obvious solution of redirecting standard output and it just worked...
Re: redirecting console output of bochs
Posted: Fri Apr 13, 2012 7:51 pm
by vjain20
Combuster wrote:I just tried the obvious solution of redirecting standard output and it just worked...
Are you referring to parallel port or port 0xE9 hack ?
Re: redirecting console output of bochs
Posted: Fri Apr 13, 2012 7:58 pm
by linguofreak
vjain20 wrote:bubach wrote:add line "log: bochsout.txt" in the bochsrc config-file.
I am not asking about the ouput of bochs itself. Logging is already enabled.I am asking about
the text that is written by the kernel to the terminal.
- Thanks
By "to the terminal" you mean "to the (emulated) screen in text mode" right?
There's no way to do that, AFAIK, but you *can* have the routine that prints to the screen also output each character that it prints to the serial port (for general portability), or to port 0xE9, for convenience with Bochs. If you have the port E9 feature turned on in bochsrc, I believe every character output through port E9 will appear in your log file, assuming you have logging enabled (it will certainly appear on the terminal you're running Bochs in).
Re: redirecting console output of bochs
Posted: Mon Apr 16, 2012 2:02 am
by xenos
linguofreak wrote:I believe every character output through port E9 will appear in your log file, assuming you have logging enabled (it will certainly appear on the terminal you're running Bochs in).
Actually it's not in the log file, but only on the terminal (stdout). But of course you can redirect the terminal output to some file.
Re: redirecting console output of bochs
Posted: Mon Jul 16, 2018 1:12 am
by kerravon
XenOS wrote:linguofreak wrote:I believe every character output through port E9 will appear in your log file, assuming you have logging enabled (it will certainly appear on the terminal you're running Bochs in).
Actually it's not in the log file, but only on the terminal (stdout). But of course you can redirect the terminal output to some file.
For anyone stumbling across this thread as I did, to capture the port E9 output, what you need to do is run bochs, as in bochs >xxx.txt, and all the port E9 output will appear in xxx.txt. I originally misunderstood this thread. I thought it was talking about redirecting the output of applications running under your OS, which wasn't very helpful.
Re: redirecting console output of bochs
Posted: Mon Jul 16, 2018 9:40 am
by dseller
Dude. This thread is 6 years old.