wip: start to add multiple pd for each task

This commit is contained in:
2025-02-07 15:48:13 +01:00
parent 3b798e5daa
commit 8dd5373e7f
7 changed files with 101 additions and 85 deletions

View File

@ -1,25 +1,25 @@
#pragma once
#include "multiboot.h"
#include <stdint.h>
#include <stddef.h>
#include <stdint.h>
#define PRESENT (1 << 0)
#define RW (1 << 1)
#define SUPERVISOR (0 << 2)
#define ACCESSED (1 << 4)
#define INIT_FLAGS (PRESENT | RW | SUPERVISOR)
#define PAGE_SIZE 4096
#define PT_SIZE 1024
#define PD_SIZE 1024
#define PAGE_MASK 0xFFFFF000
#define HEAP_END 0xC0000000
#define HEAP_START ((uint32_t)&_kernel_end - HEAP_END)
#define KERNEL_START \
((uint32_t)&_kernel_start) #define KERNEL_END((uint32_t)&_kernel_end - \
HEAP_END)
#define PT_START 256
#define PRESENT (1 << 0)
#define RW (1 << 1)
#define SUPERVISOR (0 << 2)
#define ACCESSED (1 << 4)
#define INIT_FLAGS (PRESENT | RW | SUPERVISOR)
#define PAGE_SIZE 4096
#define PT_SIZE 1024
#define PD_SIZE 1024
#define PAGE_MASK 0xFFFFF000
#define HEAP_END 0xC0000000
#define HEAP_START ((uint32_t)&_kernel_end - HEAP_END)
#define KERNEL_START ((uint32_t)&_kernel_start)
#define KERNEL_END ((uint32_t)&_kernel_end - HEAP_END)
#define PT_START 256
#define GET_PAGE_ADDR(pd_index, pt_index) \
((((uint32_t)pd_index * 1024) + (uint32_t)pt_index) * 4096)