fix: memory memset right size of frame_table

This commit is contained in:
Starnakin 2024-11-28 15:15:32 +01:00
parent dc12949329
commit 1352201800

View File

@ -113,13 +113,13 @@ static void add_frame_node(multiboot_memory_map_t *mmmt)
nb_frame = ((size * 8) / (PAGE_SIZE * 8 + 1)) nb_frame = ((size * 8) / (PAGE_SIZE * 8 + 1))
*/ */
const uint32_t nb_frame = ((len * 8) / (PAGE_SIZE * 8 + 1)); const uint32_t nb_frame = ((len * 8) / (PAGE_SIZE * 8 + 1));
current->first_free_frame = 0; current->first_free_frame = 0;
current->next = NULL; current->next = NULL;
current->remaining_frames = nb_frame; current->remaining_frames = nb_frame;
current->total_frames = nb_frame; current->total_frames = nb_frame;
memset(current->frame_table, 0, nb_frame * 4); memset(current->frame_table, 0,
nb_frame * sizeof(*current->frame_table));
uint32_t i = 1; uint32_t i = 1;
for (; i < CEIL(nb_frame, PAGE_SIZE); i++) for (; i < CEIL(nb_frame, PAGE_SIZE); i++)