|
@@ -141,10 +141,11 @@ static void multiboot_build_memmap ( struct image *image,
|
141
|
141
|
/**
|
142
|
142
|
* Add command line in base memory
|
143
|
143
|
*
|
|
144
|
+ * @v imgname Image name
|
144
|
145
|
* @v cmdline Command line
|
145
|
146
|
* @ret physaddr Physical address of command line
|
146
|
147
|
*/
|
147
|
|
-physaddr_t multiboot_add_cmdline ( const char *cmdline ) {
|
|
148
|
+physaddr_t multiboot_add_cmdline ( const char *imgname, const char *cmdline ) {
|
148
|
149
|
char *mb_cmdline;
|
149
|
150
|
|
150
|
151
|
if ( ! cmdline )
|
|
@@ -155,7 +156,7 @@ physaddr_t multiboot_add_cmdline ( const char *cmdline ) {
|
155
|
156
|
mb_cmdline_offset +=
|
156
|
157
|
( snprintf ( mb_cmdline,
|
157
|
158
|
( sizeof ( mb_cmdlines ) - mb_cmdline_offset ),
|
158
|
|
- "%s", cmdline ) + 1 );
|
|
159
|
+ "%s %s", imgname, cmdline ) + 1 );
|
159
|
160
|
|
160
|
161
|
/* Truncate to terminating NUL in buffer if necessary */
|
161
|
162
|
if ( mb_cmdline_offset > sizeof ( mb_cmdlines ) )
|
|
@@ -210,8 +211,8 @@ multiboot_build_module_list ( struct image *image,
|
210
|
211
|
( ( count - insert ) * sizeof ( *module ) ) );
|
211
|
212
|
module->mod_start = start;
|
212
|
213
|
module->mod_end = end;
|
213
|
|
- module->string =
|
214
|
|
- multiboot_add_cmdline ( module_image->cmdline );
|
|
214
|
+ module->string = multiboot_add_cmdline ( module_image->name,
|
|
215
|
+ module_image->cmdline );
|
215
|
216
|
module->reserved = 0;
|
216
|
217
|
|
217
|
218
|
/* We promise to page-align modules */
|
|
@@ -269,7 +270,7 @@ static int multiboot_exec ( struct image *image ) {
|
269
|
270
|
multiboot_build_memmap ( image, &mbinfo, mbmemmap,
|
270
|
271
|
( sizeof(mbmemmap) / sizeof(mbmemmap[0]) ) );
|
271
|
272
|
mb_cmdline_offset = 0;
|
272
|
|
- mbinfo.cmdline = multiboot_add_cmdline ( image->cmdline );
|
|
273
|
+ mbinfo.cmdline = multiboot_add_cmdline ( image->name, image->cmdline );
|
273
|
274
|
mbinfo.mods_count = multiboot_build_module_list ( image, mbmodules,
|
274
|
275
|
( sizeof(mbmodules) / sizeof(mbmodules[0]) ) );
|
275
|
276
|
mbinfo.mods_addr = virt_to_phys ( mbmodules );
|