started fixing physmem. page fault when allocating.

This commit is contained in:
lordtet 2025-07-15 17:21:50 -04:00
parent 20357559c1
commit e1369902f7
2 changed files with 3 additions and 3 deletions

View file

@ -40,6 +40,8 @@ void kern_main(uint32_t multiboot_magic, mb_info_t* multiboot_info)
//AND OUR DEFAULT OUTPUT IS: //AND OUR DEFAULT OUTPUT IS:
default_output = default_COM; default_output = default_COM;
printf(default_output, "Output schemes loaded!\n");
printf(default_output, "currently executing in kern_main() at %X\n",kern_main);
printf(default_output, "Entry eax:%X\n", multiboot_magic); printf(default_output, "Entry eax:%X\n", multiboot_magic);
if(multiboot_magic != 0x2BADB002) { if(multiboot_magic != 0x2BADB002) {
println(default_output, "Bootloader not multiboot1 compliant! Needed for mmap, etc. Can't work without it, kthxbye!"); println(default_output, "Bootloader not multiboot1 compliant! Needed for mmap, etc. Can't work without it, kthxbye!");
@ -58,10 +60,8 @@ void kern_main(uint32_t multiboot_magic, mb_info_t* multiboot_info)
return; return;
} }
/* This is broken while i implement virtual memory/paging
unsigned int pages_allocated = build_bitmap((mb_mmap_entry_t*)multiboot_info->mmap_addr, multiboot_info->mmap_length); unsigned int pages_allocated = build_bitmap((mb_mmap_entry_t*)multiboot_info->mmap_addr, multiboot_info->mmap_length);
printf(default_output, "Available mem:%d Pages | %dK", pages_allocated, pages_allocated * 4); printf(default_output, "Available mem:%d Pages | %dK", pages_allocated, pages_allocated * 4);
*/
} }

View file

@ -19,7 +19,7 @@ void free_page(void* addr) {
unsigned int build_bitmap(mb_mmap_entry_t* mmap, int mmap_size) { unsigned int build_bitmap(mb_mmap_entry_t* mmap, int mmap_size) {
//rather important global pointer to the bitmap //rather important global pointer to the bitmap
pmem_bitmap = &_kernel_end; pmem_bitmap = (&_kernel_end);