diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-02-10 13:22:40 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-02-10 13:22:40 -0800 |
commit | 14df2f8046001f2dc24e1f65bb17c6e31dfbbd09 (patch) | |
tree | e1aa9c709cd2e3ff208d2160157bac9f3acff61c /memdisk/setup.c | |
parent | 1970446f95df5ac0a0d3b2b0e90b72e0dd353699 (diff) | |
parent | d48bb2b249d996587cfe6e39e810a9805d013abe (diff) | |
download | syslinux-3.40-pre5.tar.gz |
Merge with git+ssh://master.kernel.org/pub/scm/boot/syslinux/syslinux.git#syslinux-3.3xsyslinux-3.40-pre5
Diffstat (limited to 'memdisk/setup.c')
-rw-r--r-- | memdisk/setup.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/memdisk/setup.c b/memdisk/setup.c index 8c83f039..d1eabc58 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -70,8 +70,10 @@ struct patch_area { uint16_t olddosmem; uint8_t bootloaderid; + uint8_t maxint13func; +#define MAXINT13_NOEDD 0x16 - uint8_t _pad[3]; + uint8_t _pad[2]; uint16_t memint1588; uint16_t cylinders; @@ -552,6 +554,7 @@ void setup(syscall_t cs_syscall, void *cs_bounce) com32sys_t regs; uint32_t ramdisk_image, ramdisk_size; int bios_drives; + int do_edd = -1; /* -1 = default, 0 = no, 1 = yes */ /* Set up global variables */ syscall = cs_syscall; @@ -579,11 +582,22 @@ void setup(syscall_t cs_syscall, void *cs_bounce) geometry = get_disk_image_geometry(ramdisk_image, ramdisk_size); - printf("Disk is %s %d, %u K, C/H/S = %u/%u/%u\n", + if (getcmditem("edd") != CMD_NOTFOUND || + getcmditem("ebios") != CMD_NOTFOUND) + do_edd = 1; + else if (getcmditem("noedd") != CMD_NOTFOUND || + getcmditem("noebios") != CMD_NOTFOUND || + getcmditem("cbios") != CMD_NOTFOUND) + do_edd = 0; + else + do_edd = (geometry->driveno & 0x80) ? 1 : 0; + + printf("Disk is %s %d, %u K, C/H/S = %u/%u/%u, EDD %s\n", (geometry->driveno & 0x80) ? "hard disk" : "floppy", geometry->driveno & 0x7f, geometry->sectors >> 1, - geometry->c, geometry->h, geometry->s); + geometry->c, geometry->h, geometry->s, + do_edd ? "on" : "off"); /* Reserve the ramdisk memory */ insertrange(ramdisk_image, ramdisk_size, 2); @@ -633,6 +647,10 @@ void setup(syscall_t cs_syscall, void *cs_bounce) pptr->configflags |= CONFIG_BIGRAW|CONFIG_RAW; } + /* pptr->maxint13func defaults to EDD enabled, if compiled in */ + if (!do_edd) + pptr->maxint13func = MAXINT13_NOEDD; + /* Set up a drive parameter table */ if ( geometry->driveno & 0x80 ) { /* Hard disk */ |