OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 5:44 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: redirecting console output of bochs
PostPosted: Thu Apr 12, 2012 7:51 pm 
Offline
Member
Member

Joined: Wed Apr 04, 2012 9:12 pm
Posts: 73
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 ?

_________________
- Thanks
Vaibhav jain


Top
 Profile  
 
 Post subject: Re: redirecting console output of bochs
PostPosted: Thu Apr 12, 2012 7:52 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 25, 2007 6:03 am
Posts: 734
Location: Perth, Western Australia
Use the port 0xE9 hack, or use the serial port.

_________________
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc


Top
 Profile  
 
 Post subject: Re: redirecting console output of bochs
PostPosted: Thu Apr 12, 2012 11:17 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
Read the manual on bochsrc

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: redirecting console output of bochs
PostPosted: Fri Apr 13, 2012 2:14 am 
Offline
Member
Member
User avatar

Joined: Sat Oct 23, 2004 11:00 pm
Posts: 1223
Location: Sweden
add line "log: bochsout.txt" in the bochsrc config-file.

_________________
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub


Top
 Profile  
 
 Post subject: Re: redirecting console output of bochs
PostPosted: Fri Apr 13, 2012 4:40 pm 
Offline
Member
Member

Joined: Wed Apr 04, 2012 9:12 pm
Posts: 73
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

_________________
- Thanks
Vaibhav jain


Top
 Profile  
 
 Post subject: Re: redirecting console output of bochs
PostPosted: Fri Apr 13, 2012 4:54 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
I just tried the obvious solution of redirecting standard output and it just worked...

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: redirecting console output of bochs
PostPosted: Fri Apr 13, 2012 7:51 pm 
Offline
Member
Member

Joined: Wed Apr 04, 2012 9:12 pm
Posts: 73
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 ?

_________________
- Thanks
Vaibhav jain


Top
 Profile  
 
 Post subject: Re: redirecting console output of bochs
PostPosted: Fri Apr 13, 2012 7:58 pm 
Offline
Member
Member

Joined: Wed Mar 09, 2011 3:55 am
Posts: 509
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).


Top
 Profile  
 
 Post subject: Re: redirecting console output of bochs
PostPosted: Mon Apr 16, 2012 2:02 am 
Offline
Member
Member
User avatar

Joined: Thu Aug 11, 2005 11:00 pm
Posts: 1110
Location: Tartu, Estonia
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.

_________________
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS


Top
 Profile  
 
 Post subject: Re: redirecting console output of bochs
PostPosted: Mon Jul 16, 2018 1:12 am 
Offline
Member
Member

Joined: Fri Nov 17, 2006 5:26 am
Posts: 232
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.


Top
 Profile  
 
 Post subject: Re: redirecting console output of bochs
PostPosted: Mon Jul 16, 2018 9:40 am 
Offline
Member
Member

Joined: Thu Jul 03, 2014 5:18 am
Posts: 84
Location: The Netherlands
Dude. This thread is 6 years old.

_________________
My blog: http://www.rivencove.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot], Google [Bot], SemrushBot [Bot] and 69 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group