Anonymous user
Reboot: Difference between revisions
Cleanup, still needs more work
[unchecked revision] | [unchecked revision] |
m (volatile is not actually neccessary in this case) |
(Cleanup, still needs more work) |
||
Line 2:
# load a 0-sized IDT and issue an interrupt (that'll triple fault and reset)
# Use the 8042 keyboard controller to pulse the CPU's RESET pin
== Short code to do a 8042 reset ==
void reboot()▼
<source lang="c">
{▼
while ((good & 0x02) != 0)▼
unsigned
outport(0x64, 0xFE);▼
}▼
frz();
</source>
==
<source lang="c">
typedef unsigned char uchar;
typedef uchar byte;
Line 53 ⟶ 56:
asm volatile ("HLT"); /* if that didn't work, halt the CPU */
}
</
[[Category:Power management]]
|