Page 1 of 1

Resetting the system

Posted: Mon Oct 15, 2007 2:29 am
by JamesM
Hi, before you ask I have read the 'other' thread detailing how to reset the system.

I tried to implement the keyboard-write-to-bit-0 method, but all that does it cause qEmu to freeze totally. I'm going to test it on real hardware when I get home tonight but surely that isn't a good sign? Is this what qemu normally does when 'reset'?

Cheers,
James

Posted: Mon Oct 15, 2007 5:12 am
by ManOfSteel
I implemented this method years ago, and I can tell you it's the only way that always works on all computers. It also works well on Bochs (it resets the virtual computer). Did you try it on Bochs?

----
Correction: it doesn't reset Bochs (I was thinking about something else). But it definitely works on a real computer.
I'm sorry for the confusion I might have caused.

Posted: Mon Oct 15, 2007 2:55 pm
by frank
When I am trying to reset the computer first I try the keyboard controller then after that you can try jumping to 0xFFFF:0000. You have to first put a zero at 0x40:0x72 before trying to reset though. That should restart the computer and it works in bochs and qemu.

Posted: Mon Oct 15, 2007 3:12 pm
by iskra
frank wrote:When I am trying to reset the computer first I try the keyboard controller then after that you can try jumping to 0xFFFF:0000. You have to first put a zero at 0x40:0x72 before trying to reset though. That should restart the computer and it works in bochs and qemu.
I wonder what this method (cold booting) can cause if it executed within a Windows program. Reboots system leaving Windows behind?

Posted: Mon Oct 15, 2007 7:07 pm
by frank
iskra wrote:
frank wrote:When I am trying to reset the computer first I try the keyboard controller then after that you can try jumping to 0xFFFF:0000. You have to first put a zero at 0x40:0x72 before trying to reset though. That should restart the computer and it works in bochs and qemu.
I wonder what this method (cold booting) can cause if it executed within a Windows program. Reboots system leaving Windows behind?
Well you cannot access the keyboard controller from within windows (unless you happen to be a driver) and any attempt to jump to 0xFFFF:0000 would just cause a page fault so essentially all it would do is crash your program.

Posted: Tue Oct 16, 2007 1:45 am
by JamesM
Cheers frank: the keyboard method works in bochs and real hardware, just crashes qemu. I may try the other fallback method you describe tonight.

It's so I can get my kernel to auto-restart if it panics or after a set timeout so I can do automatic testing on it and recover if all goes tits up.