user program (still many #PF)

This commit is contained in:
2026-04-02 17:05:51 +02:00
parent 11a9dd4adb
commit aa30d9c6b5
11 changed files with 107 additions and 16 deletions
-1
View File
@@ -10,7 +10,6 @@ void wrmsr(uint32_t msr, uint64_t value);
bool x86_has_msr();
void x86_arch_init();
void x86_cpu_identification();
int cpuid_get_vendor_string(char* str);
+1
View File
@@ -43,6 +43,7 @@
/* user */
#define USER_STACK_TOP 0x80000000
#define USER_STACK_PAGES 16 // 16*4096 = 64kb
#define USER_CODE_START 0x400000 // like linux
/* paging */
#define PAGING_MAX_PHYS 0x200000000
+2
View File
@@ -22,6 +22,8 @@ void vmm_unmap(uint64_t* pml4, uint64_t virt);
void* vmm_map(uint64_t* pml4, uint64_t virt, uint64_t flags);
uint64_t* vmm_create_address_space();
uint64_t vmm_virt_to_phys(uint64_t* pml4, uint64_t virt);
uintptr_t vmm_alloc_user_stack(uint64_t* pml4);
uintptr_t vmm_alloc_user_code(uint64_t* pml4, void* code_addr, uint64_t code_size);
#define VMM_USER_SPACE_START 0x0000000000001000
#define VMM_USER_SPACE_END 0x00007FFFFFFFF000
+3
View File
@@ -10,6 +10,7 @@
#include <stddef.h>
#include <config.h>
#include <stdint.h>
#include <limine.h>
typedef enum {
READY,
@@ -37,4 +38,6 @@ void process_exit(void);
void process_display_list(struct process* processes_list);
void process_create_user(struct limine_file* file);
#endif