projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
52302d7
)
preserve partition table when using -linux option
author
bellard
<bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 7 Apr 2004 21:30:08 +0000
(21:30 +0000)
committer
bellard
<bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 7 Apr 2004 21:30:08 +0000
(21:30 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@716
c046a42c
-6fe2-441c-8c8c-
71466251a162
hw/pc.c
patch
|
blob
|
history
diff --git
a/hw/pc.c
b/hw/pc.c
index 83e614bbbbbc6dbea6e4963d9638052456914901..d0fcb0f4c69dd97f49ec8dd2485e4182758e5292 100644
(file)
--- a/
hw/pc.c
+++ b/
hw/pc.c
@@
-313,6
+313,7
@@
void pc_init(int ram_size, int vga_ram_size, int boot_device,
if (linux_boot) {
uint8_t bootsect[512];
+ uint8_t old_bootsect[512];
if (bs_table[0] == NULL) {
fprintf(stderr, "A disk image must be given for 'hda' when booting a Linux kernel\n");
@@
-326,6
+327,11
@@
void pc_init(int ram_size, int vga_ram_size, int boot_device,
exit(1);
}
+ if (bdrv_read(bs_table[0], 0, old_bootsect, 1) >= 0) {
+ /* copy the MSDOS partition table */
+ memcpy(bootsect + 0x1be, old_bootsect + 0x1be, 0x40);
+ }
+
bdrv_set_boot_sector(bs_table[0], bootsect, sizeof(bootsect));
/* now we can load the kernel */