Fixed the initializing of the memory map for reactos.

svn path=/trunk/; revision=3634
This commit is contained in:
Hartmut Birr 2002-10-16 16:39:15 +00:00
parent 96dce91abb
commit 50d4270639
2 changed files with 20 additions and 13 deletions

View file

@ -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);

View file

@ -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