Skip to contentSkip to conversation

various eli patches

PATCH New Bill Nottingham 1 participant 1 message Aug 29, 2000

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 various eli patches

These are against CVS of a couple of weeks ago.

- eli-initrd-fix.patch: fixes initrd support, and a couple of compilation tweaks. virt_to_phys() on an already physical address doesn't yeild a working initrd location.
- eli-imagename.patch: allows passing of image names on the command line along with command line parameters; similarly, allows for passing of command line parmaters to images in the image selection prompt. This breaks image names with spaces, if anyone was using them.

Bill

eli.c +5 -4
diff -ru eli.old/eli.c eli/eli.c
@@ -39,6 +39,7 @@
 #define ROUNDUP(x,a)	(((x) + (a) - 1) & ~((a) - 1))
 
 #define virt_to_phys(a) ((EFI_PHYSICAL_ADDRESS) ((UINT64) (a) - 0xe000000000000000ULL))
+#define phys_to_virt(a) ((EFI_PHYSICAL_ADDRESS) ((UINT64) (a) + 0xe000000000000000ULL))
 
 /* This is the structure passed to the kernel */
 struct ia64_boot_param {
@@ -112,7 +113,7 @@
 	CHAR16 *last = optionstr + optionsize/2;
 
 #ifdef DEBUG
-	Print(W2U(L"split_command_line: size %d, '%s'\n", optionsize, optionstr));
+	Print(W2U(L"split_command_line: size %d, '%s'\n"), optionsize, optionstr);
 #endif
 
 	do {
@@ -411,7 +412,7 @@
 	}
 #else	
 	size = total_size;
-	status = fs->Read(file, &size, (VOID *) virt_to_phys(start_addr));
+	status = fs->Read(file, &size, (VOID *) virt_to_phys(vbuffer));
 	if (EFI_ERROR(status))
 		return EFI_LOAD_ERROR;
 
@@ -455,9 +456,9 @@
         status = BS->AllocatePages(AllocateAddress, EfiLoaderCode, pages, &start_addr);
 	if (EFI_ERROR(status))
 		return EFI_LOAD_ERROR;
-
+	
 	/* Make Buffer point to the requested physical address in memory */
-	status = read_file(fs, file, start_addr, total_size);
+	status = read_file(fs, file, phys_to_virt(start_addr), total_size);
 	if (EFI_ERROR(status)) {
 		Print(W2U(L"%s: read failed: %r\n"), filename, status);
 		BS->FreePages(start_addr, pages);
eli.c renamed from eli.c.imagename +35 -8

91 lines not on this page · raw message