aboutsummaryrefslogtreecommitdiffstats
path: root/com32/mboot/mboot.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-04-26 19:52:39 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-04-26 19:54:54 -0700
commit619579f87baddecc8601281215f878b57faa0f67 (patch)
tree271d1aa46a67d36891c1abb6b0f2184c44f0f321 /com32/mboot/mboot.c
parente57c9da3f1b4d8426f68b8fb0c1b6ebcf0b43bda (diff)
downloadsyslinux-619579f87baddecc8601281215f878b57faa0f67.tar.gz
syslinux-619579f87baddecc8601281215f878b57faa0f67.tar.xz
syslinux-619579f87baddecc8601281215f878b57faa0f67.zip
mboot: reimplement the Solaris DHCP hack, add compliant a.out modesyslinux-3.80-pre1
Reimplement the Solaris DHCP information passing hack. Add a spec-compliant mode for the "a.out kludge". The spec is pretty clear that the bit should override the ELF header (after all, otherwise there wouldn't be any need for the bit), but Grub disagrees. We default to Grub-compliant mode, as Solaris seems to set the bit even though it's an ELF kernel, but add the option to enable spec-compliant mode, as apparently some versions of FreeBSD need it. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/mboot/mboot.c')
-rw-r--r--com32/mboot/mboot.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/com32/mboot/mboot.c b/com32/mboot/mboot.c
index 3b42093f..41a5ef17 100644
--- a/com32/mboot/mboot.c
+++ b/com32/mboot/mboot.c
@@ -36,6 +36,7 @@
struct multiboot_info mbinfo;
struct syslinux_pm_regs regs;
+struct my_options opt;
struct module_data {
void *data;
@@ -152,15 +153,31 @@ int main(int argc, char *argv[])
openconsole(&dev_null_r, &dev_stdcon_w);
- if (argc < 2) {
- error("Usage: mboot.c32 mboot_file args... [--- module args...]...\n");
+ argv++;
+
+ while (*argv) {
+ if (!strcmp(*argv, "-solaris"))
+ opt.solaris = true;
+ else if (!strcmp(*argv, "-aout"))
+ opt.aout = true;
+ else
+ break;
+ argv++;
+ }
+
+ if (!*argv) {
+ error("Usage: mboot.c32 [opts] mboot_file args... [--- module args...]...\n"
+ "Options:\n"
+ " -solaris Enable Solaris DHCP information passing\n"
+ " -aout Use the \"a.out kludge\" if enabled, even for ELF\n"
+ " This matches the Multiboot spec, but differs from Grub\n");
return 1;
}
/* Load the files */
- nmodules = get_modules(argv+1, &modules);
+ nmodules = get_modules(argv, &modules);
if (nmodules < 1) {
- error("No modules found!\n");
+ error("No files found!\n");
return 1; /* Failure */
}
@@ -195,6 +212,8 @@ int main(int argc, char *argv[])
/* Add auxilliary information */
mboot_make_memmap();
mboot_apm();
+ if (opt.solaris)
+ mboot_solaris_dhcp_hack();
/* Run it */
mboot_run(keeppxe ? 3 : 0);