Hi!
This seems to be a widely unknown feature of bochs, and I learnt it only recently when seeking sysenter capabilities in the mentioned software. The functionality is called port e9 hack, and can be enabled with ./configure --enable-port-e9-hack.
What is it about? In such a bochs build, any data sent to port 0xe9 by the guest computer will be printed out by bochs in the console. This seems a darn cool debugging aid! Especially when console output fails for reasons or you have more debugging info than a screenful. I checked this on the recent 2.1.1 version, and it looks like a million dollar! All the debugging data, and I can scroll up xterm to see it all! You don't have to send the '\0' character.
Wanted to keep you informed. Tell me if this is helpful or not.
Cheers;)
Adrian
bochs, port 0xe9 and instant text printing
Re:bochs, port 0xe9 and instant text printing
Now what happens on a real PC if you flood port 0xE9? Perhaps you need seperate debug builds ...
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:bochs, port 0xe9 and instant text printing
afaik, they took 0xE9 on purpose because there was nothing there ... (0E0-0EF Reserved, according to HelpPC) ...
so on a real computer, these I/O commands will simply go to a kind of hardware /dev/null
so on a real computer, these I/O commands will simply go to a kind of hardware /dev/null
Re:bochs, port 0xe9 and instant text printing
Another handy one I've been using is redirecting parallel port output to a file. By adding to your bochsrc.txt
You can write to the parallel port and it will be dumped to the text file. Then you dont even need to worry about your console, you can peruse the file at your convenience, or save it if there's something you see wrong so you can look back on it a few days later...
When compiling for bochs i just -D PRINT_TO_PARALLEL
and when printing a character to the screen i also do
That way I can enable verbose debugging and then just look over the file.
Code: Select all
parport1: enabled=1, file="parout.txt"
When compiling for bochs i just -D PRINT_TO_PARALLEL
and when printing a character to the screen i also do
Code: Select all
#ifdef PRINT_TO_PARALLEL
outportb(0x37a, 0x04|0x08);
outportb(0x378, (unsigned char)c);
outportb(0x37a, 0x01);
#endif
Re:bochs, port 0xe9 and instant text printing
I use the Bochs port e9 hack in my kernel. I retrofitted the logging subsystem to dump everything to that port (normally it ignores debug and below, unless configured to do otherwise). Rather handy, since I've found that it doesn't update the VGA often enough, and things printed right before a crash aren't shown.
Lately though, I've started using QEMU. It's (much) faster, integrates better with GDB, etc... but, it doesn't have this feature, which is a bummer. I'm not using it so much anymore though. Not since I've moved past the really low-level stuff that crashes the system without the kernel crashing it (i.e, interrupt handling, paging, etc.)
Lately though, I've started using QEMU. It's (much) faster, integrates better with GDB, etc... but, it doesn't have this feature, which is a bummer. I'm not using it so much anymore though. Not since I've moved past the really low-level stuff that crashes the system without the kernel crashing it (i.e, interrupt handling, paging, etc.)