diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-02-25 23:54:25 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-02-25 23:54:25 +0000 |
commit | a735aa3139c5b9785eac09dcf6384d89c8d8c445 (patch) | |
tree | 8a1737f2ec97203bf19d5efc4b1a0cc6289e3eaf /vl.c | |
parent | 6b2b6112f872f656ba4c9ef22ff1576e87042bcc (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.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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, |