Added temporary Puts() syscall to print a string. I use it in calc to print a message

This commit is contained in:
2024-05-08 09:09:31 +02:00
parent 7826b9b7d4
commit b6d1d42ed2
3 changed files with 21 additions and 2 deletions
+11
View File
@@ -2,6 +2,7 @@
#define SYSCALL_H
#include <interrupt/pit.h>
#include <screen/text.h>
// System call count
#define MAX_SYSCALLS 2
@@ -17,9 +18,19 @@ void sys_sleep() {
}
}
// TODO: Use a Write() syscall and write to stdout
// Args: ebx - string pointer
void sys_puts() {
char* s;
__asm__ volatile ("movl %%ebx, %0" : "=r"(s));
print(s);
}
// System call table
void* syscalls[MAX_SYSCALLS] = {
sys_sleep,
sys_puts,
};
// int 0x80 - Syscall interrupt, handled by this function