fix: able to read multiboot mmap
This commit is contained in:
@ -5,27 +5,20 @@
|
||||
#include "debug.h"
|
||||
#include "kprintf.h"
|
||||
#include "memory.h"
|
||||
#include "string.h"
|
||||
#include "utils.h"
|
||||
|
||||
void *alloc_frames(size_t size)
|
||||
{
|
||||
const uint32_t nb_frames = CEIL(size, PAGE_SIZE);
|
||||
/* PRINT_PTR(((multiboot_memory_map_t *)mmap_addr)->addr); */
|
||||
/* PRINT_UINT(((multiboot_memory_map_t *)mmap_addr)->len); */
|
||||
/* PRINT_UINT(((multiboot_memory_map_t *)mmap_addr)->type); */
|
||||
for (uint32_t i = 0; i < mmap_length;
|
||||
i += sizeof(multiboot_memory_map_t)) {
|
||||
for (uint32_t i = 0; i < mmap_length; i++) {
|
||||
multiboot_memory_map_t *mmmt =
|
||||
(multiboot_memory_map_t *)(mmap_addr + i);
|
||||
(multiboot_memory_map_t *)mmap_addr + i;
|
||||
if (mmmt->type == MULTIBOOT_MEMORY_AVAILABLE) {
|
||||
kprintf("type: %d, addr: %p, len: %u, size: %u, \n",
|
||||
mmmt->type, mmmt->addr, mmmt->len, mmmt->size);
|
||||
}
|
||||
PRINT_UINT(mmmt->len);
|
||||
/* kprintf("[%d] available %p: %u bytes\n", i, mmmt->addr, */
|
||||
/* mmmt->len); */
|
||||
/* PRINT_UINT(mmmt->type); */
|
||||
}
|
||||
/* for (size_t i = 0; i < mmap_length; i++) { */
|
||||
/* } */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user