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