diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2013-07-21 16:38:18 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-07-21 16:43:54 -0400 |
commit | c98424c5ae973b9bd252696200a0ac8d91465340 (patch) | |
tree | 2f60de8a58e5be3d413b229d6b66a65330cc7911 /src | |
parent | eac11944019ca331db860445ff24455e647662a0 (diff) | |
download | seabios-hppa-c98424c5ae973b9bd252696200a0ac8d91465340.zip seabios-hppa-c98424c5ae973b9bd252696200a0ac8d91465340.tar.gz seabios-hppa-c98424c5ae973b9bd252696200a0ac8d91465340.tar.bz2 |
Default unused UMB areas to be read-only.
It looks like MSDOS 6 wants the UMB area to be read-only in order for
it to use it. FreeDOS doesn't care, but it always maps a page from
high mem when it does use the area. So, add an option to control
whether unused UMB ram is marked read-only and default it to read-only
as that seems to be more compatible.
This also fixes an off-by-one bug in the shadow range checking code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/Kconfig | 12 | ||||
-rw-r--r-- | src/shadow.c | 8 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/Kconfig b/src/Kconfig index 5e2db8b..3a4d580 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -362,6 +362,18 @@ menu "BIOS interfaces" default n help Disable A20 on 16bit boot. + + config WRITABLE_UPPERMEMORY + depends on QEMU + bool "Make unused UMB memory read/writeable." + default n + help + When selected, the "Upper Memory Block" area + (0x90000-0xa0000) that is not used for option roms will be + made writable. This allows the ram to be directly + modified by programs. However, some old DOS high memory + managers may require the UMB region to be read-only. + endmenu menu "BIOS Tables" diff --git a/src/shadow.c b/src/shadow.c index 967eb8e..242f220 100644 --- a/src/shadow.c +++ b/src/shadow.c @@ -80,13 +80,15 @@ make_bios_readonly_intel(u16 bdf, u32 pam0) wbinvd(); // Write protect roms from 0xc0000-0xf0000 - u32 romend = rom_get_last(), romtop = rom_get_max(); + u32 romlast = BUILD_BIOS_ADDR, rommax = rom_get_max(); + if (CONFIG_WRITABLE_UPPERMEMORY) + romlast = rom_get_last(); int i; for (i=0; i<6; i++) { u32 mem = BUILD_ROM_START + i * 32*1024; u32 pam = pam0 + 1 + i; - if (romend <= mem + 16*1024 || romtop <= mem + 32*1024) { - if (romend > mem && romtop > mem + 16*1024) + if (romlast < mem + 16*1024 || rommax < mem + 32*1024) { + if (romlast >= mem && rommax >= mem + 16*1024) pci_config_writeb(bdf, pam, 0x31); break; } |