diff options
author | Mark McLoughlin <markmc@redhat.com> | 2008-04-29 11:42:16 +0100 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-05-02 13:41:18 +0300 |
commit | 08859282182f418a10f78804d1cedc09b76d440b (patch) | |
tree | 6bc4905c776f04129baf592f4333f302f731e53d | |
parent | 20e2d79208f04ae1fb28b87e8f251b4e8b1518c6 (diff) |
Allow booting from extboot drive with -kernel
The -kernel option generates a new boot sector for
the boot drive which jumps directly to the supplied
kernel rather than running the standard bootloader.
Trivially fix generate_bootsect() to handle the
case where we're booting using extboot.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | hw/pc.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -405,11 +405,12 @@ static void generate_bootsect(uint32_t gpr[8], uint16_t segs[6], uint16_t ip) { uint8_t bootsect[512], *p; int i; - int hda; + int hda = extboot_drive; - hda = drive_get_index(IF_IDE, 0, 0); + if (hda == -1) + hda = drive_get_index(IF_IDE, 0, 0); if (hda == -1) { - fprintf(stderr, "A disk image must be given for 'hda' when booting " + fprintf(stderr, "-hda or -drive boot=on must be given when booting " "a Linux kernel\n"); exit(1); } |