Error handlers in your OS
Error handlers in your OS
Hi all,
what kind of critical error-handling do you have in your OS?
Well, I have good old BSOD from Win98. Just modified to suit the needs.
inflater
what kind of critical error-handling do you have in your OS?
Well, I have good old BSOD from Win98. Just modified to suit the needs.
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 )
- AndrewAPrice
- Member
- Posts: 2299
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
I have a BSOD: Black Screen of Death. It switches to text mode, displays the error, disables all interrupts, and places the system a loop. All exceptions, including divide by 0 are caught by this, which gets annoying annoying when I move the mouse to the top line or left of the screen, because my video driver divides the screensize by their position.
I haven't gotten any sort of exception handling for much, just displays what happened and keeps on chugging if it wasn't critical, if it was, it pretty much just resets . I'll work on that more when I get my new memory management stuff done. I will probably implement something that kills the offending process and just display an error message saying what exception it caused and why it was closed.
- Steve the Pirate
- Member
- Posts: 152
- Joined: Fri Dec 15, 2006 7:01 am
- Location: Brisbane, Australia
- Contact:
- AndrewAPrice
- Member
- Posts: 2299
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
ATM my OS just displays a message in textmode and a register dump, this is for all unhandled exceptions (including unhandled pagefaults), but I do most error analysis using bochs' debugger. (currently my OS has not yet left the bochs)
I'm planning to implement a simple gdb stub as soon as possible, however, using a com port as transport. I hope this isn't getting too difficult...
cheers
Joe
I'm planning to implement a simple gdb stub as soon as possible, however, using a com port as transport. I hope this isn't getting too difficult...
cheers
Joe
I'm glad I inspired someone - and so soon in to my own os's dev process tooMessiahAndrw wrote:You just inspired me to get a similar thing running under QEMU. Outputting to a COM port may help me to dump kernel messages while working under VESA.AJ wrote: I have VPC set up to dump it's COM port to a file, and therefore have a nice history of what went wrong .
I would strongly recommend anyone setting up a similar system though - if DEBUG is defined, my printf function also outputs to the com port. You can register and memory dump at any time you like. I implemented this when I got fed up of the screen scrolling all the time and was pleasantly surprised to find that COM output is even easier than screen output!
Adam
I can dump debug info to com port etc.
But in the last 4 years of of Dev a OS, i have not found a error, that can not be found with a simple :
But it maybe differant with other OS designs.
But in the last 4 years of of Dev a OS, i have not found a error, that can not be found with a simple :
Code: Select all
mov byte [es:0xB809E], "1"
;some code
mov byte [es:0xB809E], "2"
;some code
mov byte [es:0xB809E], "3"
;some code
mov byte [es:0xB809E], "4"
;some code
mov byte [es:0xB809E], "5"
;some code
Not very useful when the system double faults and your not there to understand it though is itDex wrote:I can dump debug info to com port etc.
But in the last 4 years of of Dev a OS, i have not found a error, that can not be found with a simple :But it maybe differant with other OS designs.Code: Select all
mov byte [es:0xB809E], "1" ;some code mov byte [es:0xB809E], "2" ;some code mov byte [es:0xB809E], "3" ;some code mov byte [es:0xB809E], "4" ;some code mov byte [es:0xB809E], "5" ;some code
I still print dots to see which bits of my code get executed before dieing... but i do have a kernel debugging console if i need to check something specific.
COM1 provides transport to a host computer (running Hyperterminal ). Debug messages get output constantly (everytime ANYTHING happens), as well as the CPU state for an exception.
Later on I'm hoping to implement an interactive debugging shell via an ANSI serial terminal, so I can get memory maps, request kernel memory dumps, etc. Note that COM1 isn't used for anything other debugging. The design of my OS means the user can't see COM1 (or any other hardware, directly).
Later on I'm hoping to implement an interactive debugging shell via an ANSI serial terminal, so I can get memory maps, request kernel memory dumps, etc. Note that COM1 isn't used for anything other debugging. The design of my OS means the user can't see COM1 (or any other hardware, directly).
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
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 )
Well, it has a pretty simple interface, doesn't require any other drivers to work, and is easily written to file or viewed from most emulators...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?
And it works for real computers as well, of course. All you should need is a null modem and an extra computer to connect it to.