1
0
Fork 0

feat/kernel: Started on valloc implementation for amd64

This commit is contained in:
Kevin Alavik 2025-05-15 15:57:14 +02:00
parent 91fc826022
commit 3aa5a1bb86
Signed by: cmpsb
GPG key ID: 10D1CC0526FDC6D7
6 changed files with 132 additions and 6 deletions

View file

@ -3,6 +3,11 @@
#define VMM_H
#include <stdint.h>
#include <stddef.h>
#ifndef VPM_MIN_ADDR
#define VPM_MIN_ADDR 0x1000
#endif // VPM_MIN_ADDR
typedef struct vm_region
{
@ -12,12 +17,13 @@ typedef struct vm_region
/* TOOD: Maybe store flags */
} vm_region_t;
typedef struct vma_ctx
typedef struct vpm_ctx
{
vm_region_t *root;
uint64_t *pagemap;
} vma_ctx_t;
} vpm_ctx_t;
void vmm_init();
vpm_ctx_t *vmm_init(uint64_t *pm);
void *valloc(vpm_ctx_t *ctx, size_t pages, uint64_t flags);
#endif // VMM_H