You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.1 KiB
26 lines
1.1 KiB
#pragma once
|
|
|
|
#define MEMORY_SIZE 0x08000000
|
|
#define PAGE_SIZE 4096
|
|
#define PAGE_COUNT (MEMORY_SIZE / PAGE_SIZE)
|
|
|
|
#define HEAP_PAGE_COUNT 256
|
|
#define HEAP_SIZE (HEAP_PAGE_COUNT * PAGE_SIZE)
|
|
|
|
#define KERNEL_VIRTUAL_BASE 0xFFFFFFFF80000000ULL
|
|
#define PHYS_TO_VIRT(phys) ((void *)((uint64_t)(phys) + KERNEL_VIRTUAL_BASE))
|
|
#define VIRT_TO_PHYS(virt) ((uint64_t)(virt) - KERNEL_VIRTUAL_BASE)
|
|
|
|
#define KERNEL_VIRTUAL_PML4 (KERNEL_VIRTUAL_BASE + 0x10000)
|
|
#define KERNEL_VIRTUAL_CODE (KERNEL_VIRTUAL_PML4 + 0x10000)
|
|
#define KERNEL_VIRTUAL_HEAP (KERNEL_VIRTUAL_CODE + 0x100000)
|
|
#define KERNEL_VIRTUAL_UNUSED (KERNEL_VIRTUAL_HEAP + HEAP_SIZE)
|
|
#define KERNEL_VIRTUAL_STACK (KERNEL_VIRTUAL_BASE + 0xF00000 - PAGE_SIZE)
|
|
#define KERNEL_VIRTUAL_STACK_TOP (KERNEL_VIRTUAL_STACK + PAGE_SIZE)
|
|
|
|
#define USER_VIRTUAL_BASE 0x0000000000000000ULL
|
|
#define USER_VIRTUAL_CODE (USER_VIRTUAL_BASE + 0x400000)
|
|
#define USER_VIRTUAL_HEAP (USER_VIRTUAL_CODE + 0x100000)
|
|
#define USER_VIRTUAL_UNUSED (USER_VIRTUAL_HEAP + HEAP_SIZE)
|
|
#define USER_VIRTUAL_STACK (0x0000700000000000ULL - PAGE_SIZE)
|
|
#define USER_VIRTUAL_STACK_TOP (USER_VIRTUAL_STACK + PAGE_SIZE)
|
|
|