aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-12 17:44:59 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-12 17:44:59 -0700
commit2c1e6e2be80c54fcf36f89e9de9ab1a5fba5df87 (patch)
treee3cbe30ff56df2400ffed52331bd1ef460795df7
parentfbab1739409451e0f258bb7d5f39e4bc013c0e61 (diff)
downloadsyslinux-elf-syslinux-3.70-pre17.tar.gz
syslinux-elf-syslinux-3.70-pre17.tar.xz
syslinux-elf-syslinux-3.70-pre17.zip
chain.c32: don't swap drives when already primarysyslinux-3.70-pre17
Don't install the swap stub when we are already the primary drive, even if -swap is specified.
-rw-r--r--com32/modules/chain.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index a162ca33..a9ebf767 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -328,6 +328,8 @@ static void do_boot(void *boot_sector, size_t boot_size,
struct syslinux_memmap *mmap;
struct syslinux_movelist *mlist = NULL;
addr_t dosmem = old_bios_fbm << 10;
+ uint8_t driveno = regs->edx.b[0];
+ uint8_t swapdrive = driveno & 0x80;
mmap = syslinux_memory_map();
@@ -336,10 +338,8 @@ static void do_boot(void *boot_sector, size_t boot_size,
return;
}
- if (opt.swap) {
+ if (opt.swap && driveno != swapdrive) {
uint8_t *p;
- uint8_t driveno = regs->edx.b[0];
- uint8_t swapdrive = driveno & 0x80;
regs->edx.b[0] = swapdrive;