|
@@ -78,17 +78,18 @@ static void multiboot_build_memmap ( struct multiboot_info *mbinfo,
|
78
|
78
|
/* Translate into multiboot format */
|
79
|
79
|
memset ( mbmemmap, 0, sizeof ( *mbmemmap ) );
|
80
|
80
|
for ( i = 0 ; i < memmap.count ; i++ ) {
|
81
|
|
- mbmemmap[i].size = sizeof ( mbmemmap[i] );
|
|
81
|
+ mbmemmap[i].size = ( sizeof ( mbmemmap[i] ) -
|
|
82
|
+ sizeof ( mbmemmap[i].size ) );
|
82
|
83
|
mbmemmap[i].base_addr = memmap.regions[i].start;
|
83
|
84
|
mbmemmap[i].length = ( memmap.regions[i].end -
|
84
|
85
|
memmap.regions[i].start );
|
85
|
86
|
mbmemmap[i].type = MBMEM_RAM;
|
86
|
87
|
mbinfo->mmap_length += sizeof ( mbmemmap[i] );
|
87
|
88
|
if ( memmap.regions[i].start == 0 )
|
88
|
|
- mbinfo->mem_lower = memmap.regions[i].end;
|
|
89
|
+ mbinfo->mem_lower = ( memmap.regions[i].end / 1024 );
|
89
|
90
|
if ( memmap.regions[i].start == 0x100000 )
|
90
|
|
- mbinfo->mem_upper = ( memmap.regions[i].end -
|
91
|
|
- 0x100000 );
|
|
91
|
+ mbinfo->mem_upper = ( ( memmap.regions[i].end -
|
|
92
|
+ 0x100000 ) / 1024 );
|
92
|
93
|
}
|
93
|
94
|
}
|
94
|
95
|
|
|
@@ -119,7 +120,11 @@ multiboot_build_module_list ( struct image *image,
|
119
|
120
|
module->mod_start = user_to_phys ( module_image->data, 0 );
|
120
|
121
|
module->mod_end = user_to_phys ( module_image->data,
|
121
|
122
|
module_image->len );
|
122
|
|
- module->string = virt_to_phys ( image->cmdline );
|
|
123
|
+ module->string = virt_to_phys ( module_image->cmdline );
|
|
124
|
+ module->reserved = 0;
|
|
125
|
+ DBG ( "Multiboot module %lx is [%lx,%lx)\n",
|
|
126
|
+ virt_to_phys ( module ),
|
|
127
|
+ module->mod_start, module->mod_end );
|
123
|
128
|
|
124
|
129
|
/* We promise to page-align modules, so at least check */
|
125
|
130
|
assert ( ( module->mod_start & 0xfff ) == 0 );
|
|
@@ -150,7 +155,7 @@ static int multiboot_exec ( struct image *image ) {
|
150
|
155
|
|
151
|
156
|
/* Build memory map */
|
152
|
157
|
multiboot_build_memmap ( &mbinfo, mbmemmap );
|
153
|
|
- mbinfo.mmap_addr = virt_to_phys ( &mbmemmap[0].base_addr );
|
|
158
|
+ mbinfo.mmap_addr = virt_to_phys ( mbmemmap );
|
154
|
159
|
mbinfo.flags |= ( MBI_FLAG_MEM | MBI_FLAG_MMAP );
|
155
|
160
|
|
156
|
161
|
/* Set command line */
|