#include <const.h>
#include <arch/i386.h>
#include <kernel/clock.h>
#include <kernel/console.h>
#include <kernel/keyboard.h>
#include <kernel/speaker.h>
#include <kernel/task.h>
#include <kernel/kernel.h>
Go to the source code of this file.
Functions | |||
void | error (const byte *msg) | ||
Report a critical error to the console.
| |||
void | reboot () | ||
Reboot the system using the keyboard CPU reset line.
|
Definition in file kernel.c.
|
Report a critical error to the console.
Definition at line 27 of file kernel.c.
00028 { 00029 disable(); 00030 beep(); 00031 set_color(LIGHT_RED); 00032 kprintf("\n\rERROR: %s", msg); 00033 set_color(DEFAULT_COLOR); 00034 kprintf("\n\rTask [%s] (%i) killed!", get_pname(), get_pid()); 00035 00036 sched_leave_critical_region(); 00037 00038 // If the kernel has generated this error HALT the system! // 00039 if (get_pid()) 00040 auto_kill( 1 ); 00041 else 00042 halt(); 00043 } |
|
Reboot the system using the keyboard CPU reset line.
Definition at line 48 of file kernel.c.
00049 { 00050 // Disable all interrupts // 00051 disable(); 00052 00053 beep(); 00054 00055 set_color(DEFAULT_COLOR); 00056 kprintf("\n\r"); 00057 00058 // Reset system clock // 00059 kprintf("Reset system clock..."); 00060 stop_clock(); 00061 set_color(GREEN); 00062 kprintf("\n [ OK ]\n\r"); 00063 set_color(DEFAULT_COLOR); 00064 00065 kprintf("\n\rRebooting system..."); 00066 00067 // Pulse the CPU reset line // 00068 keyb_wait(); 00069 outportb(0x64, 0xFE); 00070 00071 // If doesn't reboot => halt the system! // 00072 halt(); 00073 } |