This commit is contained in:
2026-09-20 05:27:41 +02:00
parent 831308b2ad
commit 77f228df11
38 changed files with 465 additions and 115 deletions
+18
View File
@@ -0,0 +1,18 @@
menu "Kernel Core options"
source "core/mem/Kconfig"
choice SCHED_ALG
prompt "Scheduler algorithm"
default SCHED_DUMB
help
The algorithm to use for scheduling.
config SCHED_DUMB
bool "Dumb Scheduler"
help
Very basic scheduler, without any priorities.
endchoice
endmenu
+8
View File
@@ -0,0 +1,8 @@
menu "Memory Management options"
config HAVE_MMU
bool
config HAVE_MMU_GENERIC
bool
endmenu
+6 -1
View File
@@ -1,7 +1,6 @@
kernel_sources += files(
'fault.c',
'init.c',
'pmap.c',
'pmm.c',
'slab.c',
'usercopy.c',
@@ -9,3 +8,9 @@ kernel_sources += files(
'vma.c',
'vmo.c',
)
if kconfig.get('CONFIG_HAVE_MMU', 'n') == 'y'
kernel_sources += files(
'pmap.c',
)
endif
+4
View File
@@ -3,8 +3,12 @@
#include <zinnia/pmap.h>
#include <zinnia/spin.h>
#include <zinnia/vma.h>
#include <config.h>
#include <string.h>
// TODO: For now, we assume that we can do generic PTE lookups on every arch that has a MMU.
static_assert(CONFIG_HAVE_MMU_GENERIC);
errno_t pmap_new_kernel(struct pmap* pt, enum alloc_flags flags) {
flags &= ~ALLOC_NOZERO;
+12 -3
View File
@@ -3,13 +3,22 @@
#include <arch/usercopy.h>
bool usercopy_read(void* dst, const __user void* src, size_t len) {
return arch_usercopy_read(dst, src, len, &percpu_get()->sched.current->usercopy_region);
arch_usercopy_allow(true);
bool success = arch_usercopy_read(dst, src, len, &percpu_get()->sched.current->usercopy_region);
arch_usercopy_allow(false);
return success;
}
bool usercopy_write(__user void* dst, const void* src, size_t len) {
return arch_usercopy_write(dst, src, len, &percpu_get()->sched.current->usercopy_region);
arch_usercopy_allow(true);
bool success = arch_usercopy_write(dst, src, len, &percpu_get()->sched.current->usercopy_region);
arch_usercopy_allow(false);
return success;
}
bool usercopy_strlen(const __user char* str, size_t max, size_t* len) {
return arch_usercopy_strlen(str, max, len, &percpu_get()->sched.current->usercopy_region);
arch_usercopy_allow(true);
bool success = arch_usercopy_strlen(str, max, len, &percpu_get()->sched.current->usercopy_region);
arch_usercopy_allow(false);
return success;
}
+4 -1
View File
@@ -1,4 +1,7 @@
kernel_sources += files(
'core.c',
'sched_dumb.c',
)
if kconfig.get('CONFIG_SCHED_DUMB', 'n') == 'y'
kernel_sources += files('sched_dumb.c')
endif