* [Linux-ia64] [PATCH] various eli patches
@ 2000-08-29 20:19 Bill Nottingham
0 siblings, 0 replies; 2+ messages in thread
From: Bill Nottingham @ 2000-08-29 20:19 UTC (permalink / raw)
To: linux-ia64
[-- Attachment #1: Type: text/plain, Size: 509 bytes --]
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
[-- Attachment #2: eli-initrd-fix.patch --]
[-- Type: text/plain, Size: 1419 bytes --]
diff -ru eli.old/eli.c eli/eli.c
--- eli.old/eli.c Fri Aug 18 16:21:55 2000
+++ eli/eli.c Fri Aug 18 16:24:58 2000
@@ -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);
[-- Attachment #3: eli-imagename.patch --]
[-- Type: text/plain, Size: 2499 bytes --]
--- eli/eli.c.imagename Fri Aug 18 16:35:38 2000
+++ eli/eli.c Fri Aug 18 19:20:04 2000
@@ -69,7 +70,7 @@
UINT64 initrd_size;
};
-#define MAX_IMAGE_NAME 15
+#define MAX_IMAGE_NAME 1024
struct boot_image {
struct boot_image *next;
@@ -989,7 +990,7 @@
Print(W2U(L"\n"));
for (timage = image_head; timage; timage = timage->next) {
- Print(W2U(L"%-*s "), MAX_IMAGE_NAME, timage->label);
+ Print(W2U(L"%s "), timage->label);
if ((i % 3) == 2)
Print(W2U(L"\n"));
i++;
@@ -1014,14 +1015,14 @@
case CHAR_CARRIAGE_RETURN:
{
struct boot_image *timage;
-
+ int x;
+
if (!imagename[0]) {
Print(W2U(L"\n"));
return default_image;
}
-
-
+
/* Attempt to find the image name now */
for (timage = image_head; timage; timage = timage->next) {
if (StriCmp(timage->label, imagename) == 0) {
@@ -1031,6 +1032,24 @@
}
}
+ /* Perhaps they added some arguments? */
+ for (x = 0; imagename[x] && x < MAX_IMAGE_NAME; x++) {
+ if (imagename[x] == L' ') {
+ imagename[x] = 0;
+ for (timage = image_head; timage; timage = timage->next) {
+ if (StriCmp(timage->label, imagename) == 0) {
+
+ StrCat(args, W2U(L" "));
+ StrCat(args,imagename+x+1);
+ Print(W2U(L"\n"));
+ return timage;
+ }
+ }
+ imagename[x] = L' ';
+ break;
+ }
+ }
+
Print(W2U(L"\n\nUnknown image %s\n\nboot: "),
imagename);
@@ -1095,7 +1113,7 @@
struct allocated_memory kernel, initrd, new_systab;
UINTN argc;
CHAR16 *argv[MAX_ARGS];
- struct boot_image *boot_image = NULL;
+ struct boot_image *boot_image = NULL, *tmp_image;
struct acpi_op *acpi_root = NULL;
UINTN cookie;
struct vector *vectors;
@@ -1169,15 +1187,24 @@
if (boot_image)
StrCpy(kernel_name, boot_image->filename);
}
+
+ /* If they passed us an image name, use that instead */
+ if (!boot_image)
+ for (tmp_image = image_head; tmp_image; tmp_image = tmp_image->next) {
+ if (StriCmp(tmp_image->label, kernel_name) == 0) {
+ boot_image = tmp_image;
+ StrCpy(kernel_name, boot_image->filename);
+ }
+ }
if (!kernel_name[0]) {
Print(W2U(L"eli: no kernel to boot!\n"));
goto free_acpi;
}
-
+
/* Setup the arguments to the kernel from the info on the command */
/* line and configuration file */
- if (!args[0]) {
+ if (!args[0] || boot_image) {
INT8 ro = -1;
if (boot_image && boot_image->root) {
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Linux-ia64] [PATCH] various eli patches
@ 2000-09-05 13:32 Andreas Schwab
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2000-09-05 13:32 UTC (permalink / raw)
To: linux-ia64
Bill Nottingham <notting@redhat.com> writes:
|> 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.
IMHO it is better to change read_file to expect a physical address for the
buffer, since this is all it uses anyway. That way there is no need to
convert from physical address to virtual address and back again.
Here is the patch to implement this:
--- eli.c~ Thu Aug 17 11:18:39 2000
+++ eli.c Thu Aug 17 11:27:08 2000
@@ -370,7 +370,7 @@
}
static EFI_STATUS read_file(EFI_FILE_HANDLE fs, EFI_FILE_HANDLE file,
- UINT64 vbuffer, UINT64 total_size)
+ EFI_PHYSICAL_ADDRESS buffer, UINT64 total_size)
{
EFI_STATUS status;
@@ -383,10 +383,8 @@
* needed.
*/
{
- EFI_PHYSICAL_ADDRESS buffer;
UINTN j = 0;
- buffer = virt_to_phys(vbuffer);
while (total_size > 0) {
CHAR8 helicopter[4] = { '|' , '/' , '-' , '\\' };
UINT64 size;
@@ -411,7 +409,7 @@
}
#else
size = total_size;
- status = fs->Read(file, &size, (VOID *) virt_to_phys(start_addr));
+ status = fs->Read(file, &size, (VOID *) buffer);
if (EFI_ERROR(status))
return EFI_LOAD_ERROR;
@@ -422,7 +420,7 @@
}
static INTN load_ramdisk(EFI_FILE_HANDLE fs, CHAR16 *filename,
- UINT64 start_addr, struct allocated_memory *memory)
+ EFI_PHYSICAL_ADDRESS start_addr, struct allocated_memory *memory)
{
EFI_FILE_HANDLE file;
EFI_STATUS status;
@@ -613,7 +611,7 @@
return EFI_LOAD_ERROR;
}
- status = read_file(fs, file, phdr.p_vaddr, phdr.p_filesz);
+ status = read_file(fs, file, virt_to_phys(phdr.p_vaddr), phdr.p_filesz);
if (EFI_ERROR(status)) {
Print(W2U(L"%s: read failed: %r\n"), filename, status);
BS->FreePages(min_addr, pages);
@@ -1263,6 +1261,9 @@
case EFI_LOAD_ERROR:
goto free_kernel_image;
}
+ } else {
+ initrd.start_addr = 0;
+ initrd.pages = 0;
}
/* Must free the ACPI before creating the boot params so the */
Andreas.
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-09-05 13:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-08-29 20:19 [Linux-ia64] [PATCH] various eli patches Bill Nottingham
-- strict thread matches above, loose matches on Subject: below --
2000-09-05 13:32 Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox