VOGONS


First post, by aitotat

User metadata
Rank Member
Rank
Member

I'm setting up a DECpc LP. It has a OPTi 496 chipset and I was able to find only one UMB driver for it, The Last Byte Memory Manager, but I don't like it that much (I also use it on my 286 with HT12 chipset) and on this DECpc it has a problem: CTRL+ALT+DEL locks the system and reset button must be pressed.

But one of the UMB drivers, HiRAM 1.9a, was very promising. It did not support OPTi496 but supports OPTi493 and very few other chipsets. But the most interesting thing was that those were scripts and it looked quite easy to add support for new chipsets. And I did just that, made a script for OPTi496 and HiRAM seems to work without any issues at all on MS-DOS 7.1 even though HiRAM is from 1993.

One problem is that some of the documentation is only in German but most is in English and google translate helped with what little else was needed.

Scripts are text files with .SCR extension. You use MAKHISET.EXE to convert one to HISET.SYS. For example to convert OPTI496.SCR you would write "makhiset opti496" to command prompt. Note that the .scr extension must not be specified. After HISET.SYS is build, you need to load it in config.sys followed by hiram.exe and himem.sys. Then you can load other devices necessary.
Here is an example:

DOS=HIGH,UMB
DEVICE=C:\HIRAM\HISET.SYS
DEVICE=C:\HIRAM\HIRAM.EXE
DEVICEHIGH=C:\DOS\HIMEM.SYS

That looks simpler than with many other UMB drivers because you don't have to specify the memory addresses at config.sys since they are in the script file. Lets take a look at script file for OPTI496 that I made (I started by editing the OPTI493.SRC that came with HiRAM).

; ╔═══════════════════════════════════════════════╗
; ║ Script-File for MakHiSET ║
; ╠═══════════════════════════════════════════════╣
; ║ Chipset: OPTi 82C496 ║
; ╠═══════════════════════════════════════════════╣
; ║ Enable UMBs for D000-EFFFh ║
; ║ C800h-CFFFh must stay write protected due to ║
; ║ chipset limitation. ║
; ╠═══════════════════════════════════════════════╣
; ║ (C) 2022 by aitotat ║
; ╚═══════════════════════════════════════════════╝

; Driver start message
MESSAGE = OPTi 496, UMBs D000h-EFFFh

; Disable NMI during chipset programming
NMI = OFF

; Index and Data ports to program Opti 496 chipset
INDEXPORT = 22h
DATAPORT = 24h

; Write Protect C000h - EFFFh disable
INDEX = 32h
DATA = x11xx001b
; │││││││└Write protect C000h-CFFFh
; ││││││└Write protect D000h-DFFFh
; │││││└Write protect E000h-EFFFh
; ││││└Copy enable C000h-EFFFh
; │││└Enable (shadow) RAM at C000h-CFFFh
; ││└Enable (shadow) RAM at D000h-DFFFh
; │└Enable (shadow) RAM at E000h-EFFFh
; └F000h-FFFFh 0=Enable shadow & write protect, 1=Read&writes to ROM


; Segments D000h - EFFFh Shadow RAM enable
INDEX = 33h
DATA = 11111111b
; │││││││└D000h \
; ││││││└D400h \
; │││││└D800h \
; ││││└DC00h \ 0=disable
; │││└E000h / 1=enable
; ││└E400h /
; │└E800h /
; └EC00h /

; Segments C000h - CFFFh Shadow RAM enable
INDEX = 34h
DATA = xxxxxx01b
; │││││││└Video BIOS area non-cacheable
; ││││││└ROM F000-FFFFh Write Enable
; │││││└Reserved
; ││││└Reserved
; │││└C000h \
; ││└C400h \ 0=disable
; │└C800h / 1=enable
; └CC00h /

; This tells HIRAM.EXE where UMB RAM is now available
Show last 5 lines
RAMINIT		=	D000h - EFFFh

; Chipset programmed, enable NMI
NMI = ON

No programming is needed but you need datasheet for the chipset and you need to find control ports and indentify registers involving shadow RAM. Index port is used to select chipset register. Once it is selected the data port is used to write data to or read data from that selected registers. These two ports must be specified in the script file but then makhiset.exe handles the rest. For OPTi496 those port are:

ports.png
Filename
ports.png
File size
29.05 KiB
Views
522 views
File license
Fair use/fair dealing exception

It should not be too hard to identify the shadow RAM registers. There should not be too many. There are three registers on OPTi496 but we really need just two of them. But I included the third one as well (34h).

registers.png
Filename
registers.png
File size
133.4 KiB
Views
522 views
File license
Fair use/fair dealing exception

I won't explain real mode addressing here or PC memory map expect that VGA BIOS is usually 32k and always at segment C000h. So first segment for next ROM would be at C800h. System BIOS starts from F000h segment so our ROMs and UMBs must be within C800h - EFFFh. In this system we have 8k build of XTIDE Universal BIOS at segment C800h (-C9FFh). So that leaves CA00h-EFFFh available for UMBs.

In the script file INDEXPORT=22h tells the address of index port and DATAPORT=24h tells that data port is port 24h. First chipset register we need to modify is register 32h. We select it with INDEX=32h and configure it with DATA=xxxxxxxxb. So every bit needs to be configured to 0 or 1 or x. X means no change.

We should modify the registers so that we do not override the actual shadow ram settings configured in BIOS setup. We just want to write enable the unused areas so they can be used as UMBs. The first register 32h shows one limitation about this chipset. We can only write enable 64k blocks of RAM event though there is much finer control for shadowing ROMs. Since we always have VGA BIOS at C000h, we must always write protect whole C000-CFFFh. So only D000h-EFFFh are available as UMBs. So having XTIDE Universal BIOS at C800h did not limit our UMBs at all! In fact, we could have total of 32k of ROMs in addition to VGA BIOS and we could still use all the UMBs this chipsets can provide. This shows the importance to properly set the expansion ROM addresses. Start to place them after VGA BIOS and do not leave gaps.

But how to modify register 32h? We set bits 6 and 5 to enable shadow RAM for 64k segments E000h and D000h. Actually it is (UMB) RAM now since we have no ROMs to shadow there. Then we need to clear bits 2 and 3 to write enable those segments. Everything else should be left to x (unchanged) but I set bit 0 to 1 to notify our VGA BIOS needs to be write protected.

Register 33h is easy. We set every bit to 1 to enable those same memory areas we just did at register 32h. Only here we do it in finer 16k steps (for actual shadowing purposes).

And last register, 34h, could be left unmodified because it simply have controls for Cxxxh and F000h-FFFFh that we cannot use as UMBs anyway. But I made sure main BIOS is write protected (bit 1 set to 0) and I also set bit 0 because this system does not have video bios cacheable setting at BIOS setup. Yes, nothing prevents to modify other, UMB unrelated, chipset registers as well! I could, for example, modify memory timings since this system does not have those settings in BIOS setup.

Finally in the script file there is RAMINIT=D000h-EFFFh. It tells where we enabled the UMBs so the driver can use them.

When I have time, I'm going to try making a script for Headland HT12 so I would not have to use TLB memory manager. I'll also make a script for Headland Shasta since I haven't found any UMB driver for it.

Attachments

  • Filename
    OPTI496.ZIP
    File size
    792 Bytes
    Downloads
    43 downloads
    File license
    Public domain

Reply 1 of 1, by stanwebber

User metadata
Rank Member
Rank
Member

how i so badly want to try this since all other umb managers are a bust, but i can't find the datasheet for my northbridge chip online. it uses an uncommon PT86C868/PT86C718 chip combo which i don't even know what to call--maybe a 'pico 868' chipset?