aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-25 23:54:25 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-25 23:54:25 +0000
commita735aa3139c5b9785eac09dcf6384d89c8d8c445 (patch)
tree8a1737f2ec97203bf19d5efc4b1a0cc6289e3eaf /vl.c
parent6b2b6112f872f656ba4c9ef22ff1576e87042bcc (diff)
added precompiled linux boot sector
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@652 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/vl.c b/vl.c
index 7e729ee541..e2e1393032 100644
--- a/vl.c
+++ b/vl.c
@@ -53,6 +53,7 @@
#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
#define BIOS_FILENAME "bios.bin"
#define VGABIOS_FILENAME "vgabios.bin"
+#define LINUX_BOOT_FILENAME "linux_boot.bin"
//#define DEBUG_UNUSED_IOPORT
@@ -3463,15 +3464,21 @@ int main(int argc, char **argv)
bochs_bios_init();
if (linux_boot) {
- extern uint8_t linux_boot_start;
- extern uint8_t linux_boot_end;
+ uint8_t bootsect[512];
if (bs_table[0] == NULL) {
fprintf(stderr, "A disk image must be given for 'hda' when booting a Linux kernel\n");
exit(1);
}
- bdrv_set_boot_sector(bs_table[0], &linux_boot_start,
- &linux_boot_end - &linux_boot_start);
+ snprintf(buf, sizeof(buf), "%s/%s", bios_dir, LINUX_BOOT_FILENAME);
+ ret = load_image(buf, bootsect);
+ if (ret != sizeof(bootsect)) {
+ fprintf(stderr, "qemu: could not load linux boot sector '%s'\n",
+ buf);
+ exit(1);
+ }
+
+ bdrv_set_boot_sector(bs_table[0], bootsect, sizeof(bootsect));
/* now we can load the kernel */
ret = load_kernel(kernel_filename,