From 50d4270639571513c98d979cdd4491d4a8fb3d82 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Wed, 16 Oct 2002 16:39:15 +0000 Subject: [PATCH] Fixed the initializing of the memory map for reactos. svn path=/trunk/; revision=3634 --- freeldr/freeldr/include/multiboot.h | 7 ++++++- freeldr/freeldr/reactos/reactos.c | 26 ++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/freeldr/freeldr/include/multiboot.h b/freeldr/freeldr/include/multiboot.h index 7b8a47e1f4f..755a7c829b2 100644 --- a/freeldr/freeldr/include/multiboot.h +++ b/freeldr/freeldr/include/multiboot.h @@ -99,11 +99,16 @@ typedef struct multiboot_info unsigned long cmdline; unsigned long mods_count; unsigned long mods_addr; +#if 0 + /* reactos and loadros define this entry with a size of 12 byte but the union is 16 byte */ union { aout_symbol_table_t aout_sym; elf_section_header_table_t elf_sec; } u; +#else + char syms[12]; +#endif unsigned long mmap_length; unsigned long mmap_addr; } multiboot_info_t; @@ -137,7 +142,7 @@ char multiboot_kernel_cmdline[255]; // Command line passed to kernel module_t multiboot_modules[64]; // Array to hold boot module info loaded for the kernel char multiboot_module_strings[64][256]; // Array to hold module names unsigned long multiboot_memory_map_descriptor_size; -memory_map_t multiboot_memory_map; // Memory map +memory_map_t multiboot_memory_map[32]; // Memory map void boot_reactos(void); diff --git a/freeldr/freeldr/reactos/reactos.c b/freeldr/freeldr/reactos/reactos.c index 7d4a55e289f..2d42dc99f1f 100644 --- a/freeldr/freeldr/reactos/reactos.c +++ b/freeldr/freeldr/reactos/reactos.c @@ -432,7 +432,7 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName) char szHalName[1024]; char szFileName[1024]; char szBootPath[256]; -// int i; + int i; // int nNumDriverFiles=0; // int nNumFilesLoaded=0; char MsgBuffer[256]; @@ -463,22 +463,24 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName) mb_info.cmdline = (unsigned long)multiboot_kernel_cmdline; mb_info.mods_count = 0; mb_info.mods_addr = (unsigned long)multiboot_modules; - mb_info.mmap_length = (unsigned long)GetBiosMemoryMap((PBIOS_MEMORY_MAP_ARRAY)&multiboot_memory_map); + mb_info.mmap_length = (unsigned long)GetBiosMemoryMap((PBIOS_MEMORY_MAP_ARRAY)&multiboot_memory_map) * sizeof(memory_map_t); if (mb_info.mmap_length) { mb_info.mmap_addr = (unsigned long)&multiboot_memory_map; mb_info.flags |= MB_INFO_FLAG_MEMORY_MAP; - //printf("memory map length: %d\n", mb_info.mmap_length); - //printf("dumping memory map:\n"); - //for (i=0; i<(mb_info.mmap_length / 4); i++) - //{ - // printf("0x%x\n", ((unsigned long *)&multiboot_memory_map)[i]); - //} - //getch(); + multiboot_memory_map_descriptor_size = sizeof(memory_map_t); // GetBiosMemoryMap uses a fixed value of 24 + DbgPrint((DPRINT_REACTOS, "memory map length: %d\n", mb_info.mmap_length)); + DbgPrint((DPRINT_REACTOS, "dumping memory map:\n")); + for (i=0; i<(mb_info.mmap_length/sizeof(memory_map_t)); i++) + { + DbgPrint((DPRINT_REACTOS, "start: %x\t size: %x\t type %d\n", + multiboot_memory_map[i].base_addr_low, + multiboot_memory_map[i].length_low, + multiboot_memory_map[i].type)); + } } - //printf("low_mem = %d\n", mb_info.mem_lower); - //printf("high_mem = %d\n", mb_info.mem_upper); - //getch(); + DbgPrint((DPRINT_REACTOS, "low_mem = %d\n", mb_info.mem_lower)); + DbgPrint((DPRINT_REACTOS, "high_mem = %d\n", mb_info.mem_upper)); /* * Make sure the system path is set in the .ini file