forked from PoliEcho-holding-org/kern
Continuing terminal I/O
- Made stdio.h work - Moved printFiletable back into kernel.c - TODO: Add stdio.h to all files that should use it (probably next commmit) - Added some more global addresses. There's a memory layout, but i'm not using it - Got cursor to be drawn - Calc program now gets user input
This commit is contained in:
@@ -6,17 +6,16 @@
|
||||
#include <terminal/terminal.h>
|
||||
#include <keyboard/keyboard.h>
|
||||
#include <memory/malloc.h>
|
||||
#include <memory/addresses.h>
|
||||
#include <syscall.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// Syscall(0) - Sleep()
|
||||
// Args: ebx - number of miliseconds
|
||||
void sys_sleep() {
|
||||
uint32_t ms;
|
||||
__asm__ volatile ("movl %%ebx, %0" : "=r"(ms));
|
||||
__asm__ volatile ("movl %%ebx, %0" : "=r"(*sleepTimerTicks));
|
||||
|
||||
uint32_t requiredTicks = *timerTicks + ms;
|
||||
while (*timerTicks != requiredTicks) { // Wait...
|
||||
while (*sleepTimerTicks > 0) { // Wait...
|
||||
__asm__ volatile ("sti;hlt;cli;");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user