aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-14 14:38:04 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-14 14:39:46 -0700
commit02b692d367343df7eed8c1b1a0f435424e8b3a56 (patch)
treee1b70e580a882950b50ac606e29f5445981c1fbe
parent50b496340e63a7d81c6033b739381af2858d8ac2 (diff)
downloadsyslinux-elf-02b692d367343df7eed8c1b1a0f435424e8b3a56.tar.gz
syslinux-elf-02b692d367343df7eed8c1b1a0f435424e8b3a56.tar.xz
syslinux-elf-02b692d367343df7eed8c1b1a0f435424e8b3a56.zip
MEMDISK: default to "safeint" modesyslinux-3.73-pre3
There is enough evidence that "safeint" is a decent compromise between The Right Thing[TM] and dealing with the reality of ultra-broken DOSen. Make it the default. Clean up some of the command-line parsing code and status printing. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--NEWS1
-rw-r--r--doc/memdisk.txt4
-rw-r--r--memdisk/setup.c58
3 files changed, 45 insertions, 18 deletions
diff --git a/NEWS b/NEWS
index adb77c84..76ad4bea 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ Changes in 3.73:
* Handle systems with E820 "extended attributes" per ACPI 3.
Someone "cleverly" decided to change the E820 spec in a
backwards-incompatible manner!
+ * MEMDISK: default to "safeint".
Changes in 3.72:
* Include the pxechain.com module from Jeffery Hutzelman at
diff --git a/doc/memdisk.txt b/doc/memdisk.txt
index 531706e1..6c994f92 100644
--- a/doc/memdisk.txt
+++ b/doc/memdisk.txt
@@ -105,8 +105,12 @@ d) MEMDISK normally uses the BIOS "INT 15h mover" API to access high
bigraw Use raw access to protected mode memory, and leave the
CPU in "big real" mode afterwards.
+ int Use plain INT 15h access to protected memory. This assumes
+ that anything which hooks INT 15h knows what it is doing.
+
safeint Use INT 15h access to protected memory, but invoke
INT 15h the way it was *before* MEMDISK was loaded.
+ This is the default since version 3.73.
e) MEMDISK by default supports EDD/EBIOS on hard disks, but not on
floppy disks. This can be controlled with the options:
diff --git a/memdisk/setup.c b/memdisk/setup.c
index 5fc2aa06..8e8ded1e 100644
--- a/memdisk/setup.c
+++ b/memdisk/setup.c
@@ -115,6 +115,7 @@ struct patch_area {
#define CONFIG_RAW 0x02
#define CONFIG_SAFEINT 0x04
#define CONFIG_BIGRAW 0x08 /* MUST be 8! */
+#define CONFIG_MODEMASK 0x0e
uint16_t mystack;
uint16_t statusptr;
@@ -648,14 +649,6 @@ __cdecl void setup(__cdecl syscall_t cs_syscall, void *cs_bounce)
else
do_edd = (geometry->driveno & 0x80) ? 1 : 0;
- printf("Disk is %s %d, %u%s K, C/H/S = %u/%u/%u, EDD %s\n",
- (geometry->driveno & 0x80) ? "hard disk" : "floppy",
- geometry->driveno & 0x7f,
- geometry->sectors >> 1,
- (geometry->sectors & 1) ? ".5" : "",
- geometry->c, geometry->h, geometry->s,
- do_edd ? "on" : "off");
-
/* Reserve the ramdisk memory */
insertrange(ramdisk_image, ramdisk_size, 2, 1);
parse_mem(); /* Recompute variables */
@@ -682,27 +675,56 @@ __cdecl void setup(__cdecl syscall_t cs_syscall, void *cs_bounce)
pptr->bootloaderid = shdr->type_of_loader;
- pptr->configflags = 0;
+ pptr->configflags = CONFIG_SAFEINT; /* Default */
/* Set config flags */
if ( getcmditem("ro") != CMD_NOTFOUND ) {
- puts("Marking disk readonly\n");
pptr->configflags |= CONFIG_READONLY;
}
if ( getcmditem("raw") != CMD_NOTFOUND ) {
- puts("Using raw access to high memory\n");
- pptr->configflags &= ~CONFIG_SAFEINT|CONFIG_BIGRAW;
+ pptr->configflags &= ~CONFIG_MODEMASK;
pptr->configflags |= CONFIG_RAW;
}
+ if ( getcmditem("bigraw") != CMD_NOTFOUND ) {
+ pptr->configflags &= ~CONFIG_MODEMASK;
+ pptr->configflags |= CONFIG_BIGRAW|CONFIG_RAW;
+ }
+ if ( getcmditem("int") != CMD_NOTFOUND ) {
+ pptr->configflags &= ~CONFIG_MODEMASK;
+ /* pptr->configflags |= 0; */
+ }
if ( getcmditem("safeint") != CMD_NOTFOUND ) {
- puts("Using safe INT 15h access to high memory\n");
- pptr->configflags &= ~CONFIG_RAW|CONFIG_BIGRAW;
+ pptr->configflags &= ~CONFIG_MODEMASK;
pptr->configflags |= CONFIG_SAFEINT;
}
- if ( getcmditem("bigraw") != CMD_NOTFOUND ) {
- puts("Using raw access to high memory - assuming big real mode\n");
- pptr->configflags &= ~CONFIG_SAFEINT;
- pptr->configflags |= CONFIG_BIGRAW|CONFIG_RAW;
+
+ printf("Disk is %s %d, %u%s K, C/H/S = %u/%u/%u, EDD %s, %s\n",
+ (geometry->driveno & 0x80) ? "hard disk" : "floppy",
+ geometry->driveno & 0x7f,
+ geometry->sectors >> 1,
+ (geometry->sectors & 1) ? ".5" : "",
+ geometry->c, geometry->h, geometry->s,
+ do_edd ? "on" : "off",
+ pptr->configflags & CONFIG_READONLY ? "readonly" : "read-write");
+
+ puts("\nUsing ");
+ switch (pptr->configflags & CONFIG_MODEMASK) {
+ case 0:
+ puts("standard INT 15h");
+ break;
+ case CONFIG_SAFEINT:
+ puts("safe INT 15h");
+ break;
+ case CONFIG_RAW:
+ puts("raw");
+ break;
+ case CONFIG_RAW|CONFIG_BIGRAW:
+ puts("big real mode raw");
+ break;
+ default:
+ printf("unknown %#x", pptr->configflags & CONFIG_MODEMASK);
+ break;
}
+ puts(" access to high memory\n");
/* pptr->maxint13func defaults to EDD enabled, if compiled in */
if (!do_edd)