reboot.c 362 B

1234567891011121314
  1. /* Reboot command: trigger a CPU reset via the keyboard controller. */
  2. static inline void outb(unsigned short port, unsigned char v)
  3. {
  4. __asm__ volatile ("outb %0, %1" : : "a"(v), "Nd"(port));
  5. }
  6. void program_reboot_main(void)
  7. {
  8. /* Pulse the CPU reset line via the keyboard controller (port 0x64). */
  9. outb(0x64, 0xFE);
  10. for (;;)
  11. __asm__ volatile ("hlt");
  12. }