fix: memory: use rigth index and addr, add page to pt before write it
This commit is contained in:
@ -16,6 +16,9 @@
|
||||
#define HEAP_START ((uint32_t) & _kernel_end - HEAP_END)
|
||||
#define PT_START 256
|
||||
|
||||
#define GET_PAGE_ADDR(pd_index, pt_index) \
|
||||
(((pd_index * 1024) + pt_index) * 4096)
|
||||
|
||||
extern uint32_t _kernel_end;
|
||||
extern uint32_t boot_page_directory;
|
||||
extern uint32_t *page_directory;
|
||||
@ -28,4 +31,4 @@ int free_frames(void *frame_ptr, size_t size);
|
||||
void *alloc_pages(size_t size);
|
||||
int free_pages(void *page_ptr, size_t size);
|
||||
void init_page_table(uint32_t page_table[1024], uint16_t start);
|
||||
int16_t create_page_table(uint16_t pd_index);
|
||||
int16_t add_page_table(uint16_t pd_index);
|
||||
|
Reference in New Issue
Block a user