Resetting the system

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Resetting the system

Post 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
User avatar
ManOfSteel
Member
Member
Posts: 60
Joined: Tue Feb 01, 2005 12:00 am

Post 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.
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post 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.
iskra
Posts: 14
Joined: Thu Oct 11, 2007 7:21 pm

Post 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?
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post 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.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post 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.
Post Reply