1
0
Fork 0

feat: Added syscalls and began on usermode support, still no scheduler

This commit is contained in:
Kevin Alavik 2025-06-01 18:43:06 +02:00
parent 49867193d5
commit e7b9f44384
Signed by: cmpsb
GPG key ID: 10D1CC0526FDC6D7
8 changed files with 140 additions and 2 deletions

View file

@ -23,6 +23,7 @@
#include <sys/apic/lapic.h>
#include <sys/apic/ioapic.h>
#include <dev/pit.h>
#include <sys/syscall.h>
__attribute__((used, section(".limine_requests"))) static volatile LIMINE_BASE_REVISION(3);
__attribute__((used, section(".limine_requests"))) static volatile struct limine_memmap_request memmap_request = {
@ -72,6 +73,11 @@ void tick(struct register_ctx *)
log_early("tick on CPU %d", get_cpu_local()->cpu_index);
}
void user_func()
{
syscall(69, 69, 420, 420);
}
void emk_entry(void)
{
__asm__ volatile("movq %%rsp, %0" : "=r"(kstack_top));
@ -210,7 +216,10 @@ void emk_entry(void)
ioapic_init();
/* Setup timer */
pit_init(tick);
pit_init(NULL);
/* Call our user space function */
user_func(); // No good way to run in usermode, yet
/* Finished */
log_early("%s", LOG_SEPARATOR);