This commit is contained in:
2026-08-13 17:22:36 +02:00
committed by Marvin Friedrich
parent 5ee30664c5
commit 40cea4dedd
48 changed files with 622 additions and 211 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ zn_status_t elf_load(struct exec_info* info, struct task** out) {
return status;
// We map more than we copied so the rest is filled with zeroed pages.
status = vma_map_vmo(info->space, &phdr_obj->object, phdr.p_vaddr, phdr.p_memsz, prot, phdr.p_offset);
status = vas_map_vmo(info->space, &phdr_obj->object, phdr.p_vaddr, phdr.p_memsz, prot, phdr.p_offset);
if (status)
return status;
}
@@ -182,7 +182,7 @@ zn_status_t elf_load(struct exec_info* info, struct task** out) {
uintptr_t argc = num_argv;
vmo_write(&stack->object, stack_off, &argc, sizeof(argc), nullptr);
status = vma_map_vmo(info->space, &stack->object, stack_start, stack_size, ZN_VM_MAP_READ | ZN_VM_MAP_WRITE, 0);
status = vas_map_vmo(info->space, &stack->object, stack_start, stack_size, ZN_VM_MAP_READ | ZN_VM_MAP_WRITE, 0);
if (status)
return status;
+2 -1
View File
@@ -1,9 +1,9 @@
kernel_sources += files(
'channel.c',
'clock.c',
'futex.c',
'console.c',
'elf.c',
'futex.c',
'irq.c',
'namespace.c',
'panic.c',
@@ -12,4 +12,5 @@ kernel_sources += files(
'sched.c',
'spin.c',
'uacpi_glue.c',
'vdso.c',
)
+6
View File
@@ -2,6 +2,7 @@
#include <zinnia/rights.h>
#include <zinnia/status.h>
#include <kernel/alloc.h>
#include <kernel/mutex.h>
#include <kernel/namespace.h>
#include <stdatomic.h>
@@ -26,6 +27,7 @@ zn_status_t namespace_add_desc(struct namespace* namespace, struct namespace_des
return ZN_ERR_INTERNAL;
// Skip over handles that are already in use (e.g. hard-coded handles).
// mutex_lock(&namespace->mutex);
zn_handle_t handle;
do {
handle = atomic_fetch_add_explicit(&namespace->next_handle, 1, memory_order_acq_rel);
@@ -35,6 +37,8 @@ zn_status_t namespace_add_desc(struct namespace* namespace, struct namespace_des
zn_status_t status =
hashmap_insert(&namespace->descriptors, handle, desc, hashmap_hash_default, hashmap_eq_default);
// mutex_unlock(&namespace->mutex);
if (status != ZN_OK)
return status;
@@ -45,6 +49,8 @@ zn_status_t namespace_add_desc(struct namespace* namespace, struct namespace_des
zn_status_t namespace_add_desc_at(struct namespace* namespace, struct namespace_desc desc, zn_handle_t handle) {
if (!namespace)
return ZN_ERR_INTERNAL;
// Skip Invalid or reserved handles.
if (handle <= ZN_HANDLE_INVALID)
return ZN_ERR_BAD_HANDLE;
+10
View File
@@ -0,0 +1,10 @@
#include <common/compiler.h>
#include <kernel/vdso.h>
#include <stdint.h>
[[__used, __section(".vdso")]]
const uint8_t vdso_bytes[] = {
#embed VDSO_PATH
};
const size_t vdso_length = sizeof(vdso_bytes);