wip: frame_allocator working pretty good (?)
core: remove physical allocatory
This commit is contained in:
@ -53,10 +53,11 @@ static void add_frame_node(multiboot_memory_map_t *mmmt)
|
||||
init_page_table(frame_zones_page_table, 0);
|
||||
page_directory[1022] =
|
||||
((uint32_t)frame_zones_page_table - HEAP_END) | 0x03;
|
||||
frame_zones_page_table[index++] =
|
||||
frame_zones_page_table[index] =
|
||||
((uint32_t)zone & PAGE_MASK) | INIT_FLAGS;
|
||||
|
||||
struct frame_zone *current =
|
||||
(struct frame_zone *)GET_PAGE_ADDR(1022, 0);
|
||||
(struct frame_zone *)GET_PAGE_ADDR(1022, index++);
|
||||
memset(current, 0, sizeof(struct frame_zone));
|
||||
current->addr = (void *)mmmt->addr;
|
||||
current->frame_table = (uint32_t *)current + sizeof(struct frame_zone);
|
||||
@ -68,16 +69,18 @@ static void add_frame_node(multiboot_memory_map_t *mmmt)
|
||||
frame_zones_page_table[index] =
|
||||
((uint32_t)zone + PAGE_SIZE & PAGE_MASK) | INIT_FLAGS;
|
||||
// glhf reading this bozo
|
||||
current->len = mmmt->len;
|
||||
current->size = (mmmt->len - (sizeof(struct frame_zone) +
|
||||
(mmmt->len / PAGE_SIZE) / 32));
|
||||
current->remaining_frames = current->size / PAGE_SIZE;
|
||||
current->first_free_frame = 0;
|
||||
current->next = NULL;
|
||||
|
||||
struct frame_zone *it = head;
|
||||
if (!it) {
|
||||
if (!head) {
|
||||
head = current;
|
||||
return;
|
||||
}
|
||||
struct frame_zone *it = head;
|
||||
while (it->next)
|
||||
it = it->next;
|
||||
it->next = current;
|
||||
|
Reference in New Issue
Block a user