]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Add -boot n option for x86 using PXE, by Anthony Liguori.
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Fri, 5 Jan 2007 17:41:07 +0000 (17:41 +0000)
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Fri, 5 Jan 2007 17:41:07 +0000 (17:41 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2293 c046a42c-6fe2-441c-8c8c-71466251a162

Makefile
pc-bios/README
qemu-doc.texi
vl.c

index 4aa7510e45cc38b9e8955641a1f9163f643cf710..b88f50101404752628fb444a4e3abfeae213af70 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -78,7 +78,8 @@ install: all $(if $(BUILD_DOCS),install-doc)
        $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
        mkdir -p "$(DESTDIR)$(datadir)"
        for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
-                       video.x openbios-sparc32 linux_boot.bin; do \
+               video.x openbios-sparc32 linux_boot.bin pxe-ne2k_pci.bin \
+               pxe-rtl8139.bin pxe-pcnet.bin; do \
                $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
        done
 ifndef CONFIG_WIN32
index fc85eb429179634d9db96458e3252e0a67405dbd..45e4b7cba215e19cae753abc0b58baa894e9ad9f 100644 (file)
@@ -14,3 +14,9 @@
 - OpenBIOS (http://www.openbios.org/) is a free (GPL v2) portable
   firmware implementation. The goal is to implement a 100% IEEE
   1275-1994 (referred to as Open Firmware) compliant firmware.
+
+- The PXE roms come from Rom-o-Matic etherboot 5.4.2.
+  pcnet32:pcnet32 -- [0x1022,0x2000]
+  ns8390:winbond940 -- [0x1050,0x0940]
+  rtl8139:rtl8139 -- [0x10ec,0x8139]
+  http://rom-o-matic.net/
index 1dd33fe9b31235646095857268b592c7b7721669..45f5ea412f95f194f8f3a02b7641451f29c85801 100644 (file)
@@ -219,9 +219,9 @@ Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and and
 @option{-cdrom} at the same time). You can use the host CD-ROM by
 using @file{/dev/cdrom} as filename (@pxref{host_drives}).
 
-@item -boot [a|c|d]
-Boot on floppy (a), hard disk (c) or CD-ROM (d). Hard disk boot is
-the default.
+@item -boot [a|c|d|n]
+Boot on floppy (a), hard disk (c), CD-ROM (d), or Etherboot (n). Hard disk boot
+is the default.
 
 @item -disk ide,img=file[,hdx=a..dd][,type=disk|cdrom]
 Use @var{file} as the IDE disk/CD-ROM image. The defaults are: hdx=a,type=disk
diff --git a/vl.c b/vl.c
index cfe94c81626ea274eafc7d471541e37f6c5822e5..7b3d880b47fc4a1ff455500babd26e31e8d4c89c 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -6234,7 +6234,7 @@ void help(void)
            "-hda/-hdb file  use 'file' as IDE hard disk 0/1 image\n"
            "-hdc/-hdd file  use 'file' as IDE hard disk 2/3 image\n"
            "-cdrom file     use 'file' as IDE cdrom image (cdrom is ide1 master)\n"
-           "-boot [a|c|d]   boot on floppy (a), hard disk (c) or CD-ROM (d)\n"
+           "-boot [a|c|d|n] boot on floppy (a), hard disk (c), CD-ROM (d), or network (n)\n"
            "-disk ide,img=file[,hdx=a..dd][,type=disk|cdrom] \n"
            "                defaults are: hdx=a,type=disk \n"
            "-disk scsi,img=file[,sdx=a..g][,type=disk|cdrom][,id=n]  \n"
@@ -7056,7 +7056,7 @@ int main(int argc, char **argv)
             case QEMU_OPTION_boot:
                 boot_device = optarg[0];
                 if (boot_device != 'a' && 
-#ifdef TARGET_SPARC
+#if defined(TARGET_SPARC) || defined(TARGET_I386)
                    // Network boot
                    boot_device != 'n' &&
 #endif
@@ -7378,6 +7378,28 @@ int main(int argc, char **argv)
             exit(1);
     }
 
+#ifdef TARGET_I386
+    if (boot_device == 'n') {
+       for (i = 0; i < nb_nics; i++) {
+           const char *model = nd_table[i].model;
+           char buf[1024];
+           if (model == NULL)
+               model = "ne2k_pci";
+           snprintf(buf, sizeof(buf), "%s/pxe-%s.bin", bios_dir, model);
+           if (get_image_size(buf) > 0) {
+               option_rom[nb_option_roms] = strdup(buf);
+               nb_option_roms++;
+               break;
+           }
+       }
+       if (i == nb_nics) {
+           fprintf(stderr, "No valid PXE rom found for network device\n");
+           exit(1);
+       }
+       boot_device = 'c'; /* to prevent confusion by the BIOS */
+    }
+#endif
+
     /* init the memory */
     phys_ram_size = ram_size + vga_ram_size + bios_size;