mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-03 18:22:22 +00:00
Added temporary Puts() syscall to print a string. I use it in calc to print a message
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user