He missed the most important thing! If your computer triple faults and resets, you can see the last thing it did, while printing to the screen only gives you milliseconds to read the last error! If it sends the last thing it did to the serial port, you can view it on your other machine, or view your emulators text file output to see where it crashed rather than guessing or putting tons of endless loops and running over and over again to see where the error occured.inflater wrote:Wow, I am confused why everyone is using serial port for exception-handling or debugging... Maybe that is the easier solution to handle these things?
inflater
Error handlers in your OS
In addition to this, if you are at a point where your OS is displaying *loads* of information in debug mode, you will get to a point where a text-mode UI starts scrolling. With COM output, you can just capture the entire output in a single file and don't lose the information that would otherwise scroll off the top of the screen.
Cheers,
Adam
Cheers,
Adam
Yeah, it's very good for thing like memory dumps, etc. Saying all this, I still use the text display for my debugging, no reason really though, just lazyness, and the lack of really difficult to find bugs, once I start triple faulting and can't track it down, I'll implement it, but for now it works, and I don't worry about it .
Its cool because DexOS can debug its self from another PC with DexOS on it . you can also do this:
Sounds like a great idea.Those who use a separate computer to test their OSes (these days one can get
a real cheap Pentium-II class PC or notebook easily) but don't enjoy writing
their OS to the floppy/CD on the main PC, taking this removable media to the
test PC, booting the OS, seeing a problem in it and going with the CD/floppy
back to the main PC to make an update with a hopefully fixed version of the
OS to just repeat the whole cycle again, those unfortunate people might find
this short/mid-term solution useful...
Namely, one could boot the OS on the test PC over the serial port from the
main PC by using a null-modem cable. Of course, for that one needs to have a
null-modem cable (in which rx and tx aren't straight-through but rather
twisted) and a spare serial port on both PCs, which is usually no problem
unless one of them is a modern notebook and all it's got is a bunch of USB
ports... This notebook-specifc problem can be cured by means of a
USB-to-UART converter/adapter btw.
Now you may say that the PCs don't boot from the seral ports and you'd be
right, they usually don't. However, they do boot from floppies and CDs just
fine. And it's probably not all that complicated to make a tiny 1st stage
bootloader that fits into a single 512-bytes sector and can boot the rest
off the UART. And that 1st stage loader can be once written to the floppy or
CD one's been hating to drag around and then be forgotten inside the test
PC.
Advantages:
- no floppy/CD dragging
- no disk driver needed to boot from UART
- no file system needed to boot from UART
- the same serial link can be reused for debugging or controlling the OS
from the test PC (make this link work as a virtual console)
- the same link can be reused for other information exchange (testing,
implementing network protocols without having network drivers yet,
implementing file system on top of it)
- UART is easy to program
- by sending garbage to the UART one won't damage any disk data
Disadvantages:
- must be available
- data rate is limited to ~ 11 KB/second, which is not a big deal for a
small kernel
If anyone's interested, I'll release the thing when it's done.
Alex
Yeah, I have done now a simple terminal in my OS (real mode , not uploaded to web). Actually, I was celebrating, because I *finally* triggert the COM1 (COM2) IRQ and correctly received data, unlike the mouse driver...All you should need is a null modem and an extra computer to connect it to
I used com0com open source null modem, QEMU and Hyperterminal.
btw., I removed that BSOD from my OS. I don't knew why I put it on the kernel, because no serious errors (GPF or triple faults in PM) are happening.
inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English )
Derrick operating system: http://derrick.xf.cz (Slovak and English )