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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user