Kernel: Stack pointer is validated when updated

This allows us not to fail stack pointer when in syscall since
interrupts use their own stack
This commit is contained in:
Bananymous
2023-04-21 10:40:24 +03:00
parent 3aa0eeb4a3
commit be14a6c239
9 changed files with 37 additions and 23 deletions

View File

@@ -8,5 +8,13 @@
USERSPACE void userspace_entry()
{
Kernel::syscall(SYS_WRITE, STDOUT_FILENO, "Hello World!", 12);
char buffer[128];
while (true)
{
long n_read = Kernel::syscall(SYS_READ, STDIN_FILENO, buffer, sizeof(buffer));
Kernel::syscall(SYS_WRITE, STDOUT_FILENO, buffer, n_read);
}
Kernel::syscall(SYS_EXIT);
}