Allocate sufficient pages to hold the bootinfo block and stop

hardwiring the location.
This commit is contained in:
Marcel Moolenaar 2002-04-19 06:43:09 +00:00
parent 81764c987b
commit b226acefc2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95026
2 changed files with 20 additions and 14 deletions

View File

@ -148,20 +148,23 @@ elf_exec(struct preloaded_file *fp)
return(EFTYPE); /* XXX actually EFUCKUP */
hdr = (Elf_Ehdr *)&(md->md_data);
printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
EFI_SIZE_TO_PAGES(sizeof(struct bootinfo)), (void*)&bi);
if (EFI_ERROR(status)) {
printf("unable to create bootinfo block (status=0x%lx)\n",
(long)status);
return (ENOMEM);
}
/*
* Ugly hack, similar to linux. Dump the bootinfo into a
* special page reserved in the link map.
*/
bi = (struct bootinfo *) 0x508000;
bzero(bi, sizeof(struct bootinfo));
bi_load(bi, fp, &mapkey);
printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
status = BS->ExitBootServices(IH, mapkey);
if (EFI_ERROR(status)) {
printf("ExitBootServices returned 0x%lx\n", status);
return;
return (EINVAL);
}
psr = disable_ic();

View File

@ -148,20 +148,23 @@ elf_exec(struct preloaded_file *fp)
return(EFTYPE); /* XXX actually EFUCKUP */
hdr = (Elf_Ehdr *)&(md->md_data);
printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
EFI_SIZE_TO_PAGES(sizeof(struct bootinfo)), (void*)&bi);
if (EFI_ERROR(status)) {
printf("unable to create bootinfo block (status=0x%lx)\n",
(long)status);
return (ENOMEM);
}
/*
* Ugly hack, similar to linux. Dump the bootinfo into a
* special page reserved in the link map.
*/
bi = (struct bootinfo *) 0x508000;
bzero(bi, sizeof(struct bootinfo));
bi_load(bi, fp, &mapkey);
printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
status = BS->ExitBootServices(IH, mapkey);
if (EFI_ERROR(status)) {
printf("ExitBootServices returned 0x%lx\n", status);
return;
return (EINVAL);
}
psr = disable_ic();