Created
June 20, 2016 22:18
-
-
Save msullivan/461a5affc992025530c0f936740046b4 to your computer and use it in GitHub Desktop.
code to reboot a pc using keyboard controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void reboot(void) | |
{ | |
while (1) { /* keep trying if it doesn't work */ | |
/* wait for the output buffer to be empty */ | |
while (inb(KEYBOARD_CMD_PORT) & KEYBOARD_OUTBUF_FULL_MASK) | |
; | |
/* send the command to have the keyboard controller reboot the machine. | |
* wtf. */ | |
outb(KEYBOARD_CMD_PORT, KEYBOARD_CMD_REBOOT); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment