Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 621 → Rev 622

/shark/trunk/oslib/libc/stdlib/stdlib.c
58,6 → 58,7
extern void bios_restore(void);
 
bios_restore();
//printk("Exiting with mode: %d\n", ll_exit_mode);
switch (ll_exit_mode) {
case EXIT_MODE_HALT:
halt();
/shark/trunk/oslib/libc/reboot.c
26,6 → 26,8
 
FILE(reboot);
 
no_idt = { 0, 0 };
 
void halt(void)
{
cputs("Halt called");
38,12 → 40,12
 
void cold_reboot(void)
{
reboot(0);
reboot(0);
}
 
void warm_reboot(void)
{
reboot(0x1234);
reboot(0x1234);
}
 
/*
53,18 → 55,21
*/
void reboot(int mode)
{
register int i,j;
register int n, i,j;
lmempokew((LIN_ADDR)0x472,mode);
for (;;) {
/* Wait for keyboard controller ready */
for (i=0; i<0x10000; i++)
if ((inp(0x64) & 0x02) == 0) break;
/* Do nothing for a while... */
for(j = 0; j < 100000 ; j++);
/* pulse reset low */
outp(0xfe,0x64);
/* Do nothing for a while... */
for(j = 0; j < 100000 ; j++);
}
lmempokew((LIN_ADDR)0x472,mode);
for (n = 0; n < 100; n++) {
// Wait for keyboard controller ready
for (i=0; i<0x10000; i++)
if ((inp(0x64) & 0x02) == 0) break;
// Do nothing for a while...
for(j = 0; j < 100000 ; j++);
// pulse reset low
outp(0xfe,0x64);
// Do nothing for a while...
for(j = 0; j < 100000 ; j++);
}
/* That didn't work - force a triple fault.. */
__asm__ __volatile__("lidt %0": :"m" (no_idt));
__asm__ __volatile__("int3");
}