mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 02:16:58 +00:00
Replace busy-wait cli_delay with time-based cli_sleep in remaining files
This commit is contained in:
@@ -11,6 +11,6 @@ void cli_cmd_beep(char *args) {
|
|||||||
outb(0x42, (div >> 8) & 0xFF);
|
outb(0x42, (div >> 8) & 0xFF);
|
||||||
|
|
||||||
outb(0x61, inb(0x61) | 0x03);
|
outb(0x61, inb(0x61) | 0x03);
|
||||||
cli_delay(10000000);
|
cli_sleep(100);
|
||||||
outb(0x61, inb(0x61) & 0xFC);
|
outb(0x61, inb(0x61) & 0xFC);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,6 @@ void cli_cmd_readtheman(char *args) {
|
|||||||
cli_write("Fuck you.\n");
|
cli_write("Fuck you.\n");
|
||||||
for(int i=0; i<3; i++) {
|
for(int i=0; i<3; i++) {
|
||||||
cli_cmd_beep(NULL);
|
cli_cmd_beep(NULL);
|
||||||
cli_delay(1000000);
|
cli_sleep(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
void cli_cmd_reboot(char *args) {
|
void cli_cmd_reboot(char *args) {
|
||||||
(void)args;
|
(void)args;
|
||||||
cli_write("Rebooting...\n");
|
cli_write("Rebooting...\n");
|
||||||
cli_delay(10000000);
|
cli_sleep(100);
|
||||||
while ((inb(0x64) & 2) != 0) cli_delay(1000);
|
while ((inb(0x64) & 2) != 0) cli_sleep(1);
|
||||||
outb(0x64, 0xFE);
|
outb(0x64, 0xFE);
|
||||||
asm volatile ("int $0x3");
|
asm volatile ("int $0x3");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
void cli_cmd_shutdown(char *args) {
|
void cli_cmd_shutdown(char *args) {
|
||||||
(void)args;
|
(void)args;
|
||||||
cli_write("Shutting down...\n");
|
cli_write("Shutting down...\n");
|
||||||
cli_delay(10000000);
|
cli_sleep(100);
|
||||||
outb(0x64, 0xFE);
|
outb(0x64, 0xFE);
|
||||||
outw(0x604, 0x2000);
|
outw(0x604, 0x2000);
|
||||||
outw(0xB004, 0x2000);
|
outw(0xB004, 0x2000);
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ static void vm_syscall(int id) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SYS_SLEEP:
|
case SYS_SLEEP:
|
||||||
cli_delay(pop() * 100000);
|
cli_sleep(pop());
|
||||||
push(0);
|
push(0);
|
||||||
break;
|
break;
|
||||||
// File IO - Not supported yet as FILE* cannot be easily passed to VM
|
// File IO - Not supported yet as FILE* cannot be easily passed to VM
|
||||||
|
|||||||
Reference in New Issue
Block a user