From a48466109f59d507f9108635a5dc4ec865173f85 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 6 Dec 2014 19:31:05 +0100 Subject: Clean slab_alloc. Bug still here. --- kernel/l0/kmain.c | 2 ++ kernel/l0/paging.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'kernel/l0') diff --git a/kernel/l0/kmain.c b/kernel/l0/kmain.c index 8cb370a..97b5a97 100644 --- a/kernel/l0/kmain.c +++ b/kernel/l0/kmain.c @@ -31,10 +31,12 @@ void test_pf_handler(pagedir_t *pd, region_info_t *i, void* addr) { void* page_alloc_fun_for_kmalloc(size_t bytes) { void* addr = region_alloc(bytes, REGION_T_CORE_HEAP, test_pf_handler); + dbg_printf("Alloc %p bytes for kmalloc at: %p\n", bytes, addr); return addr; } void page_free_fun_for_kmalloc(void* ptr) { region_info_t *i = find_region(ptr); + ASSERT(i != 0 && i->type == REGION_T_CORE_HEAP); for (void* x = i->addr; x < i->addr + i->size; x += PAGE_SIZE) { uint32_t f = pd_get_frame(x); if (f != 0) { diff --git a/kernel/l0/paging.c b/kernel/l0/paging.c index adb076c..5000c71 100644 --- a/kernel/l0/paging.c +++ b/kernel/l0/paging.c @@ -67,7 +67,7 @@ void page_fault_handler(registers_t *regs) { dbg_printf("For pt 0x%p, page 0x%p -> addr 0x%p\n", pt, page, ((pt * 1024) + page) * PAGE_SIZE); for (int i = 0; i < N_PAGES_IN_PT; i++) { - dbg_printf("%i. 0x%p\n", i, kernel_pd.page[i]); + //dbg_printf("%i. 0x%p\n", i, kernel_pd.page[i]); } dbg_dump_registers(regs); -- cgit v1.2.3