Replace busy-wait cli_delay with time-based cli_sleep in remaining files

This commit is contained in:
Chris 2026-02-08 14:54:36 +01:00
parent b245dc5f00
commit 9728222d3c
5 changed files with 6 additions and 6 deletions

View file

@ -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);
} }

View file

@ -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);
} }
} }

View file

@ -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");
} }

View file

@ -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);

View file

@ -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