From 573b82fd2d46ebca7f98e5323e9f18e593a7996f Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Mon, 10 Jul 2017 21:04:18 +0200 Subject: VGA Z-buffer is now dynamically allocated and freed memory management can reuse the last pointer malloced if freed again --- src/kernel/kernel.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/kernel/kernel.c') diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index f2210d6..c0bc285 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -91,13 +91,14 @@ void kernel_main( void ) // TODO: get memupper from multiboot header (but this needs // a multiboot compliant entry function first) or use BIOS // functions to determine size of memory, for now assume we - // have at least, for now use the memory above 1 MB, 64 MB - // heap is enough for what we are doing in the kernel - memory_manager_init( &global_context.memory_manager, 0x100000, 0xFFFF ); + // have at least, for now use the memory above 1 MB, 128 KB + // heap is enough for what we are doing in the kernel plus + // eventual z buffering the VGA graphic mode + uint32_t heap_offset = 0x01000000; + size_t heap_size = 128 * 1024; + memory_manager_init( &global_context.memory_manager, heap_offset, heap_size ); __stdlib_set_memory_manager( &global_context.memory_manager ); - printf( "Kernel heap at 0x%X, size 0x%X\n", 0x100000, 0xFFFF ); - void *test = malloc( 2048 ); - free( test ); + printf( "Kernel heap at 0x%X, size 0x%X\n", heap_offset, heap_size ); // exit point in case of kernel panic, do this as soon as // possible, as soon we have an early console we can croak on -- cgit v1.2.3-54-g00ecf