├── dos ├── dos4gw.exe ├── exe2rom.exe ├── inject.exe ├── romfill.exe ├── split.exe ├── warplink.exe ├── wasmr.exe └── wdis.exe ├── images ├── basicc11.bin ├── basicc11.f6 ├── basicc11.f8 ├── basicc11.fa ├── basicc11.fc ├── blank.bin ├── blank32.bin ├── floppy │ ├── floppy22.bin │ └── readme.txt └── xt-ide │ ├── biosdrvs.com │ ├── xtide591.bin │ └── xtidecfg.com ├── linux ├── exe2rom ├── inject ├── romfill ├── split ├── wasm ├── wdis └── wlink ├── make_dos.bat ├── make_linux.sh ├── make_win.bat ├── original ├── bios.asm └── bios.doc ├── pcxtbios.asm ├── phatcode.exe ├── readme.txt ├── test ├── basicc11.bin ├── et4000.bin └── picoxt.exe ├── toolsrc ├── exe2rom.bas ├── inject.bas ├── readme.txt ├── romfill.bas └── split.bas └── win32 ├── exe2rom.exe ├── inject.exe ├── romfill.exe ├── split.exe ├── wasm.exe ├── wdis.exe ├── wlink.exe └── wlinkd.dll /dos/dos4gw.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/dos/dos4gw.exe -------------------------------------------------------------------------------- /dos/exe2rom.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/dos/exe2rom.exe -------------------------------------------------------------------------------- /dos/inject.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/dos/inject.exe -------------------------------------------------------------------------------- /dos/romfill.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/dos/romfill.exe -------------------------------------------------------------------------------- /dos/split.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/dos/split.exe -------------------------------------------------------------------------------- /dos/warplink.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/dos/warplink.exe -------------------------------------------------------------------------------- /dos/wasmr.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/dos/wasmr.exe -------------------------------------------------------------------------------- /dos/wdis.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/dos/wdis.exe -------------------------------------------------------------------------------- /images/basicc11.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/images/basicc11.bin -------------------------------------------------------------------------------- /images/basicc11.f6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/images/basicc11.f6 -------------------------------------------------------------------------------- /images/basicc11.f8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/images/basicc11.f8 -------------------------------------------------------------------------------- /images/basicc11.fa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/images/basicc11.fa -------------------------------------------------------------------------------- /images/basicc11.fc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/images/basicc11.fc -------------------------------------------------------------------------------- /images/blank.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/images/blank.bin -------------------------------------------------------------------------------- /images/blank32.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/floppy/floppy22.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/images/floppy/floppy22.bin -------------------------------------------------------------------------------- /images/floppy/readme.txt: -------------------------------------------------------------------------------- 1 | README file for Multi-Floppy BIOS Extension 2 | ******************************************* 3 | 4 | General Information 5 | =================== 6 | 7 | The Multi-Floppy Floppy BIOS Extension provides support for up to 8 floppy 8 | drives connected to two floppy disk controllers (FDCs). It supports any 9 | combination of standard IBM PC/XT/AT and PS/2 floppy drives, with disk sizes 10 | from 180 KB to 2.88 MB. 11 | 12 | Configuration Utility 13 | --------------------- 14 | 15 | The BIOS extension has a built-in configuration utility that could be 16 | invoked by pressing F2 during the boot (BIOS POST). The utility allows setting 17 | up the floppy drives and FDCs configuration, and saving it to the EEPROM 18 | (provided that the BIOS extension is in an EEPROM and the write is enabled). 19 | The ROM is cannot be programmed in system (e.g. write protected, or an EPROM 20 | chip is used instead of EEPROM), the configuration utility provides a dump 21 | of the configuration data, so the user can program it manually. 22 | Please refer to the Implementation Notes section for detailed information on 23 | the configuration data structure. 24 | 25 | Secondary FDC Configuration 26 | --------------------------- 27 | 28 | Currently the BIOS extension does not support DMA channel and IRQ sharing with 29 | the primary FDC. Therefore the secondary FDC must not use DMA channel 2 and 30 | IRQ 6. 31 | 32 | 33 | Release Notes 34 | ============= 35 | 36 | Version 2.2 37 | ----------- 38 | - Fix garbage output on CGA displays with IBM BIOS 39 | - Make BIOS extension code size equal 8 KiB, including the configuration area. 40 | This mitigates issues with original IBM BIOS and XT BIOS by Anonymous, that 41 | expect BIOS extension size to be a multiply of 2 KiB. 42 | - Reinstall interrupt vectors on INT 19h. 43 | 44 | Version 2.0 45 | ----------- 46 | 47 | - Support for two FDCs with up to 8 drives 48 | - Built-in EEPROM configuration utility 49 | 50 | Version 1.0b1 51 | ------------- 52 | 53 | - Mostly a straight forward copy of the floppy functions from Xi 8088 BIOS 54 | 55 | 56 | Implementation Notes 57 | ==================== 58 | 59 | Additional storage for 8 drives support 60 | --------------------------------------- 61 | 62 | The Multi-Floppy BIOS extension uses 11 bytes in addition to standard BIOS 63 | data area variables for storing status information for the secondary FDC and 64 | drives from 3 to 8. 65 | 66 | Here is the list of these variables and their default location: 67 | 68 | fdc_media_state_addr: 69 | - Purpose: media state for 4 drives on the secondary FDC 70 | - Size: 4 bytes 71 | - Default location: 0000:02C0 (interrupt vector 0B0h) 72 | 73 | fdc_cylinder_addr: 74 | - Purpose: current cylinder for 4 drives on the secondary FDC 75 | followed by 2 drives (2 and 3) on the primary FDC 76 | - Size: 6 bytes 77 | - Default location: 0000:02C4 (interrupt vectors 0B1h and 0B2h) 78 | 79 | fdc_motor_state_addr: 80 | - Purpose: mode (read/write), motor state, and selected drive 81 | for the secondary FDC 82 | - Size: 1 byte 83 | - Default location: 0000:02CA (interrupt vector 0B2h) 84 | 85 | In addition the format of the 'last rate' BIOS variable (0040h:008Bh) is 86 | redifined as follows 87 | 88 | bits 7 - 6: last data rate set for the primary FDC (same as on an AT) 89 | bits 5 - 4: not used 90 | bits 3 - 0: calibrated bits for the 4 drives on the secondary FDC 91 | 92 | 93 | Configuration Data Structure 94 | ---------------------------- 95 | 96 | The configuration data is stored in the extension BIOS ROM starting from 97 | offset 1F80h. 98 | 99 | Here is the location and the purpose of the configuration data: 100 | 101 | Offset 1F80h, size 1 bytes: 102 | Checksum correction byte. Value of this byte is negative of the sum of the 103 | rest of bytes in 1F81h - 1FFFh range, so that the sum of the 1F80h - 1FFFh 104 | range equals zero. 105 | 106 | Offset 1F81h, size 32 bytes: 107 | Floppy drive configuration, 8 entries, 4 bytes each: 108 | byte 0 - drive type: 109 | 0 - drive not present 110 | 1 - 360 KB, 5.25" 111 | 2 - 1.2 MB, 5.25" 112 | 3 - 720 KB, 3.5" 113 | 4 - 1.44 MB, 3.5" 114 | 6 - 2.88 MB, 3.5" 115 | byte 1 - FDC number: 0 - Primary FDC; 1 - Secondary FDC 116 | byte 2 - physical drive number, from 0 to 3 117 | byte 3 - reserved, must be set to 0 118 | Notes: 119 | - Drive entries must be populated consecutively, without any holes (drive not 120 | present entries) 121 | - When using the standard IBM PC twisted floppy cable, the drive after the 122 | twist is the physical drive 0, and the drive before the twist is the physical 123 | drive 1. 124 | 125 | Offset 1FA1h, size 8 bytes: 126 | FDC configuration, 2 entries (primary FDC and secondary FDC), 4 bytes each: 127 | word 0 - FDC base address. 128 | Normally 3F0h for the primary FDC and 370h for the secondary FDC 129 | byte 2 - FDC interrupt (IRQ) number. 130 | Normally 6 for the primary FDC 131 | byte 3 - FDC DMA channel number. 132 | Normally 2 for the primary FDC 133 | 134 | Offset 1FA9h, size 4 bytes: 135 | Pointer to floppy drive media state for drives 4-7 variables array. 136 | word 0 - offset; default: 02C0h 137 | word 2 - segment; default; 0000h 138 | 139 | Offset 1FADh, size 4 bytes: 140 | Pointer to current cylinder for drives 2-7 variables array: 141 | word 0 - offset; default: 02C4h 142 | word 2 - segment; default: 0000h 143 | 144 | Offset 1FB1h, size 4 bytes: 145 | Pointer to mode, motor state, and selected drive for the secondary FDC variable: 146 | word 0 - offset; default: 02CAh 147 | word 2 - segment; default: 0000h 148 | 149 | Offset 1FB5, size 2 bytes: 150 | Configuration prompt (Press F2...) delay in 55 ms units 151 | word - default: 55 (approximately 3 seconds) 152 | 153 | Offset 1FB7, size 1 byte: 154 | Configuration flags 155 | bit 0 - Use port 61h / bit 4 for delays (implemented on AT and Xi 8088) 156 | default: 0 - Don't use port 61; for PC/XT class machines. 157 | bit 1 - Display configuration prompt during extension ROM initialization 158 | default: 0 - Don't display 159 | bit 2 - Display configuration prompt on boot (INT 19h) 160 | default: 0 - Display 161 | bit 3 - Update BIOS equipment word during extension ROM initialization 162 | default: 1 - Update 163 | bit 4 - Update BIOS equipment word on boot (INT 19h) 164 | default: 1 - Update 165 | bit 5 - Enable builtin IPL 166 | default: 1 - Enabled 167 | bits 6 - 7 - Reserved, set to 0 168 | 169 | Offset 1FB8, size 3 bytes: 170 | Code to run relocated timer (IRQ0) handler. The second byte is also used to 171 | determine what interrupt number the default INT 08h handler should be 172 | relocated to. This is only used in configurations with two FDCs. 173 | byte 0 - default: 0CDh (INT opcode) 174 | byte 1 - default: 0AFh (interrupt 0AFh) 175 | byte 2 - default: 0CFh (IRET opcode) 176 | 177 | Offset 1FBB, size 3 bytes; 178 | Code to run relocated INT 19h (boot) handler. The second byte is also used to 179 | determine what interrupt number the default INT 19h handler should be 180 | relocated to. 181 | byte 0 - default: 0CDh (INT opcode) 182 | byte 1 - default: 0AEh (interrupt 0AEh) 183 | byte 2 - default: 0CFh (IRET opcode) 184 | 185 | 186 | Enabling SDP (Software Data Protection) feature 187 | ----------------------------------------------- 188 | 189 | Atmel AT28C64B EEPROMs support the SDP feature which allows disabling 190 | EEPROM writes using a special sequence. It is recommended to enable this 191 | feature if you have this EEPROM type, as it will prevent accidential EEPROM 192 | modifications, while allowing the built-in configuration utility to modify 193 | the configuration without changing "EEPROM write protect" switch / jumper 194 | setting. 195 | 196 | Here is an example of enabling SDP feature using the DOS DEBUG command. Note 197 | that the first command (mov ax,e000) needs to be updated to reflect the segment 198 | address of the EEPROM, according to the configuration of the ISA FDC card. 199 | 200 | C:\>debug 201 | -a 202 | 151D:0100 mov ax,e000 203 | 151D:0103 mov ds,ax 204 | 151D:0105 mov byte [1555],aa 205 | 151D:010A mov byte [0aaa],55 206 | 151D:010F mov byte [1555],a0 207 | 151D:0114 xor cx,cx 208 | 151D:0116 loop 116 209 | 151D:0118 int 20 210 | -g 211 | 212 | Note: This command sequence is only supported on Atmel AT28C64B EEPROM, it 213 | won't work on other EEPROMs and will corrupt the EEPROM content instead. 214 | 215 | TODO 216 | ==== 217 | 218 | - Better check for HDD BIOS presence? (e.g. call INT 13h AH=15h) 219 | 220 | - Detect and initialize FDC controllers on initialization. Display a warning 221 | message on timeout/controller not present. 222 | 223 | - Implement IRQ/DRQ sharing for primary FDC and secondary FDC. 224 | 225 | - Make the ROM PnP specs compliant? 226 | -------------------------------------------------------------------------------- /images/xt-ide/biosdrvs.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/images/xt-ide/biosdrvs.com -------------------------------------------------------------------------------- /images/xt-ide/xtide591.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/images/xt-ide/xtide591.bin -------------------------------------------------------------------------------- /images/xt-ide/xtidecfg.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/images/xt-ide/xtidecfg.com -------------------------------------------------------------------------------- /linux/exe2rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/linux/exe2rom -------------------------------------------------------------------------------- /linux/inject: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/linux/inject -------------------------------------------------------------------------------- /linux/romfill: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/linux/romfill -------------------------------------------------------------------------------- /linux/split: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/linux/split -------------------------------------------------------------------------------- /linux/wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/linux/wasm -------------------------------------------------------------------------------- /linux/wdis: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/linux/wdis -------------------------------------------------------------------------------- /linux/wlink: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/linux/wlink -------------------------------------------------------------------------------- /make_dos.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem *** Set listing=1 to generate listing file (requires 386+) 4 | rem *** Set floppy=1 to include Sergey's Floppy BIOS 5 | rem *** Set ide=1 to include XT-IDE BIOS 6 | rem *** Set basic=1 to include IBM ROM BASIC 7 | 8 | set bios=pcxtbios 9 | set listing=1 10 | 11 | set floppy=0 12 | set ide=0 13 | set basic=1 14 | 15 | if exist %bios%.obj del %bios%.obj 16 | if exist %bios%.lst del %bios%.lst 17 | if exist %bios%.exe del %bios%.exe 18 | if exist %bios%.bin del %bios%.bin 19 | 20 | @echo ******************************************************************************* 21 | @echo Assembling BIOS 22 | @echo ******************************************************************************* 23 | dos\wasmr -zcm=tasm -d1 -e=1 -fe=nul -fo=%bios%.obj %bios%.asm 24 | if errorlevel 1 goto errasm 25 | if not exist %bios%.obj goto errasm 26 | 27 | if %listing%==0 goto link 28 | @echo. 29 | @echo ******************************************************************************* 30 | @echo Generating Listing 31 | @echo ******************************************************************************* 32 | set oldpath=%path% 33 | set path=%path%;dos\ 34 | dos\wdis -l=%bios%.lst -s=%bios%.asm %bios%.obj 35 | if errorlevel 1 goto errlist 36 | if not exist %bios%.lst goto errlist 37 | set path=%oldpath% 38 | echo Ok 39 | 40 | :link 41 | @echo. 42 | @echo ******************************************************************************* 43 | @echo Linking BIOS 44 | @echo ******************************************************************************* 45 | dos\warplink /wn pcxtbios.obj,pcxtbios.exe 46 | del %bios%.obj 47 | if not exist %bios%.exe goto errlink 48 | 49 | @echo ******************************************************************************* 50 | @echo Building ROM Images 51 | @echo ******************************************************************************* 52 | 53 | dos\exe2rom /8 %bios%.exe %bios%.bin 54 | del %bios%.exe 55 | 56 | if exist test\picoxt.exe dos\inject /70D0 %bios%.bin test\picoxt.exe 57 | 58 | if not exist eproms\nul mkdir eproms 59 | if not exist eproms\2764\nul mkdir eproms\2764 60 | if not exist eproms\27128\nul mkdir eproms\27128 61 | if not exist eproms\27256\nul mkdir eproms\27256 62 | if not exist eproms\27512\nul mkdir eproms\27512 63 | if not exist eproms\ibmxt\nul mkdir eproms\ibmxt 64 | 65 | if %floppy%==1 dos\romfill /8 images\floppy\floppy22.bin eproms\2764\floppy22.rom 66 | if %ide%==1 dos\romfill /8 images\xt-ide\xtide591.bin eproms\2764\xtide591.rom 67 | if %basic%==1 dos\romfill /8 images\basicc11.f6 eproms\2764\basicf6.rom 68 | if %basic%==1 dos\romfill /8 images\basicc11.f8 eproms\2764\basicf8.rom 69 | if %basic%==1 dos\romfill /8 images\basicc11.fa eproms\2764\basicfa.rom 70 | if %basic%==1 dos\romfill /8 images\basicc11.fc eproms\2764\basicfc.rom 71 | dos\romfill /8 %bios%.bin eproms\2764\%bios%.rom 72 | if %floppy%==0 del eproms\2764\floppy22.rom >nul 73 | if %ide%==0 del eproms\2764\xtide591.rom >nul 74 | if %basic%==0 del eproms\2764\basicf6.rom >nul 75 | if %basic%==0 del eproms\2764\basicf8.rom >nul 76 | if %basic%==0 del eproms\2764\basicfa.rom >nul 77 | if %basic%==0 del eproms\2764\basicfc.rom >nul 78 | 79 | if %floppy%==1 dos\romfill /16 images\floppy\floppy22.bin eproms\27128\floppy22.rom 80 | if %ide%==1 dos\romfill /16 images\xt-ide\xtide591.bin eproms\27128\xtide591.rom 81 | if %basic%==1 dos\romfill /16 images\basicc11.f6 eproms\27128\basicf6.rom 82 | if %basic%==1 dos\romfill /16 images\basicc11.f8 eproms\27128\basicf8.rom 83 | if %basic%==1 dos\romfill /16 images\basicc11.fa eproms\27128\basicfa.rom 84 | if %basic%==1 dos\romfill /16 images\basicc11.fc eproms\27128\basicfc.rom 85 | dos\romfill /16 %bios%.bin eproms\27128\%bios%.rom 86 | if %floppy%==0 del eproms\27128\floppy22.rom >nul 87 | if %ide%==0 del eproms\27128\xtide591.rom >nul 88 | if %basic%==0 del eproms\27128\basicf6.rom >nul 89 | if %basic%==0 del eproms\27128\basicf8.rom >nul 90 | if %basic%==0 del eproms\27128\basicfa.rom >nul 91 | if %basic%==0 del eproms\27128\basicfc.rom >nul 92 | 93 | if %floppy%==1 dos\romfill /32 images\floppy\floppy22.bin eproms\27256\floppy22.rom 94 | if %ide%==1 dos\romfill /32 images\xt-ide\xtide591.bin eproms\27256\xtide591.rom 95 | if %basic%==1 dos\romfill /32 images\basicc11.f6 eproms\27256\basicf6.rom 96 | if %basic%==1 dos\romfill /32 images\basicc11.f8 eproms\27256\basicf8.rom 97 | if %basic%==1 dos\romfill /32 images\basicc11.fa eproms\27256\basicfa.rom 98 | if %basic%==1 dos\romfill /32 images\basicc11.fc eproms\27256\basicfc.rom 99 | dos\romfill /32 %bios%.bin eproms\27256\%bios%.rom 100 | if %floppy%==0 del eproms\27256\floppy22.rom >nul 101 | if %ide%==0 del eproms\27256\xtide591.rom >nul 102 | if %basic%==0 del eproms\27256\basicf6.rom >nul 103 | if %basic%==0 del eproms\27256\basicf8.rom >nul 104 | if %basic%==0 del eproms\27256\basicfa.rom >nul 105 | if %basic%==0 del eproms\27256\basicfc.rom >nul 106 | 107 | if %floppy%==1 dos\romfill /64 images\floppy\floppy22.bin eproms\27512\floppy22.rom 108 | if %ide%==1 dos\romfill /64 images\xt-ide\xtide591.bin eproms\27512\xtide591.rom 109 | if %basic%==1 dos\romfill /64 images\basicc11.f6 eproms\27512\basicf6.rom 110 | if %basic%==1 dos\romfill /64 images\basicc11.f8 eproms\27512\basicf8.rom 111 | if %basic%==1 dos\romfill /64 images\basicc11.fa eproms\27512\basicfa.rom 112 | if %basic%==1 dos\romfill /64 images\basicc11.fc eproms\27512\basicfc.rom 113 | dos\romfill /64 %bios%.bin eproms\27512\%bios%.rom 114 | if %floppy%==0 del eproms\27512\floppy22.rom >nul 115 | if %ide%==0 del eproms\27512\xtide591.rom >nul 116 | if %basic%==0 del eproms\27512\basicf6.rom >nul 117 | if %basic%==0 del eproms\27512\basicf8.rom >nul 118 | if %basic%==0 del eproms\27512\basicfa.rom >nul 119 | if %basic%==0 del eproms\27512\basicfc.rom >nul 120 | 121 | if exist eproms\ibmxt\u18.rom del eproms\ibmxt\u18.rom 122 | if exist eproms\ibmxt\u19.rom del eproms\ibmxt\u19.rom 123 | copy images\blank32.bin eproms\ibmxt\u18.rom 124 | copy images\blank32.bin eproms\ibmxt\u19.rom 125 | if %floppy%==1 dos\inject /0000 images\floppy\floppy22.bin eproms\ibmxt\u19.rom 126 | if %ide%==1 dos\inject /2000 images\xt-ide\xtide591.bin eproms\ibmxt\u19.rom 127 | if %basic%==1 dos\inject /6000 images\basicc11.f6 eproms\ibmxt\u19.rom 128 | if %basic%==1 dos\inject /0000 images\basicc11.f8 eproms\ibmxt\u18.rom 129 | if %basic%==1 dos\inject /2000 images\basicc11.fa eproms\ibmxt\u18.rom 130 | if %basic%==1 dos\inject /4000 images\basicc11.fc eproms\ibmxt\u18.rom 131 | dos\inject /6000 %bios%.bin eproms\ibmxt\u18.rom 132 | 133 | @echo ******************************************************************************* 134 | @echo SUCCESS!: BIOS successfully built 135 | @echo ******************************************************************************* 136 | goto end 137 | 138 | :errasm 139 | @echo. 140 | @echo. 141 | @echo ******************************************************************************* 142 | @echo ERROR: Error assembling BIOS 143 | @echo ******************************************************************************* 144 | goto end 145 | 146 | :errlist 147 | @echo. 148 | @echo. 149 | @echo ******************************************************************************* 150 | @echo ERROR: Error generating listing file 151 | @echo ******************************************************************************* 152 | set path=%oldpath% 153 | goto end 154 | 155 | :errlink 156 | @echo. 157 | @echo. 158 | @echo ******************************************************************************* 159 | @echo ERROR: Error linking BIOS 160 | @echo ******************************************************************************* 161 | goto end 162 | 163 | :end 164 | if exist %bios%.obj del %bios%.obj 165 | if exist %bios%.exe del %bios%.exe 166 | 167 | set bios= 168 | set listing= 169 | set floppy= 170 | set ide= 171 | set basic= 172 | 173 | pause 174 | -------------------------------------------------------------------------------- /make_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # *** Set floppy=1 to include Sergey's Floppy BIOS 4 | # *** Set ide=1 to include XT-IDE BIOS 5 | # *** Set basic=1 to include IBM ROM BASIC 6 | 7 | bios=pcxtbios 8 | 9 | floppy=0 10 | ide=0 11 | basic=1 12 | 13 | function goto 14 | { 15 | label=$1 16 | cmd=$(sed -n "/$label:/{:a;n;p;ba};" $0 | grep -v ':$') 17 | eval "$cmd" 18 | exit 19 | } 20 | 21 | rm -f $bios.obj 2>/dev/null 22 | rm -f $bios.lst 2>/dev/null 23 | rm -f $bios.exe 2>/dev/null 24 | rm -f $bios.bin 2>/dev/null 25 | 26 | chmod +x linux/* 27 | 28 | echo "*******************************************************************************" 29 | echo "Assembling BIOS" 30 | echo "*******************************************************************************" 31 | linux/wasm -zcm=tasm -d1 -e=1 -fe=/dev/null -fo=$bios.obj $bios.asm 32 | if [ $? = "1" ]; then goto errasm; fi 33 | if [ ! -e "$bios.obj" ]; then goto errasm; fi 34 | 35 | echo 36 | echo "*******************************************************************************" 37 | echo "Generating Listing" 38 | echo "*******************************************************************************" 39 | linux/wdis -l=$bios.lst -s=$bios.asm $bios.obj 40 | if [ $? = "1" ]; then goto errlist; fi 41 | if [ ! -e "$bios.lst" ]; then goto errlist; fi 42 | echo Ok 43 | 44 | echo 45 | echo "*******************************************************************************" 46 | echo "Linking BIOS" 47 | echo "*******************************************************************************" 48 | linux/wlink format dos name $bios.exe file $bios.obj 49 | rm -f $bios.obj 2>/dev/null 50 | if [ ! -e "$bios.exe" ]; then goto errlink; fi 51 | 52 | echo 53 | echo "*******************************************************************************" 54 | echo "Building ROM Images" 55 | echo "*******************************************************************************" 56 | 57 | linux/exe2rom /8 $bios.exe $bios.bin 58 | rm -f $bios.exe 2>/dev/null 59 | 60 | if [ -e "test/picoxt.exe" ]; then linux/inject /70D0 $bios.bin test/picoxt.exe; fi 61 | 62 | mkdir eproms 2>/dev/null 63 | mkdir eproms/2764 2>/dev/null 64 | mkdir eproms/27128 2>/dev/null 65 | mkdir eproms/27256 2>/dev/null 66 | mkdir eproms/27512 2>/dev/null 67 | mkdir eproms/ibmxt 2>/dev/null 68 | 69 | if [ $floppy = "1" ]; then linux/romfill /8 images/floppy/floppy22.bin eproms/2764/floppy22.rom; fi 70 | if [ $ide = "1" ]; then linux/romfill /8 images/xt-ide/xtide591.bin eproms/2764/xtide591.rom; fi 71 | if [ $basic = "1" ]; then linux/romfill /8 images/basicc11.f6 eproms/2764/basicf6.rom 72 | linux/romfill /8 images/basicc11.f8 eproms/2764/basicf8.rom 73 | linux/romfill /8 images/basicc11.fa eproms/2764/basicfa.rom 74 | linux/romfill /8 images/basicc11.fc eproms/2764/basicfc.rom; fi 75 | linux/romfill /8 $bios.bin eproms/2764/$bios.rom 76 | if [ $floppy = "0" ]; then rm -f eproms/2764/floppy22.rom 2>/dev/null; fi 77 | if [ $ide = "0" ]; then rm -f eproms/2764/xtide591.rom 2>/dev/null; fi 78 | if [ $basic = "0" ]; then rm -f eproms/2764/basicf6.rom 2>/dev/null 79 | rm -f eproms/2764/basicf8.rom 2>/dev/null 80 | rm -f eproms/2764/basicfa.rom 2>/dev/null 81 | rm -f eproms/2764/basicfc.rom 2>/dev/null; fi 82 | 83 | if [ $floppy = "1" ]; then linux/romfill /16 images/floppy/floppy22.bin eproms/27128/floppy22.rom; fi 84 | if [ $ide = "1" ]; then linux/romfill /16 images/xt-ide/xtide591.bin eproms/27128/xtide591.rom; fi 85 | if [ $basic = "1" ]; then linux/romfill /16 images/basicc11.f6 eproms/27128/basicf6.rom 86 | linux/romfill /16 images/basicc11.f8 eproms/27128/basicf8.rom 87 | linux/romfill /16 images/basicc11.fa eproms/27128/basicfa.rom 88 | linux/romfill /16 images/basicc11.fc eproms/27128/basicfc.rom; fi 89 | linux/romfill /16 $bios.bin eproms/27128/$bios.rom 90 | if [ $floppy = "0" ]; then rm -f eproms/27128/floppy22.rom 2>/dev/null; fi 91 | if [ $ide = "0" ]; then rm -f eproms/27128/xtide591.rom 2>/dev/null; fi 92 | if [ $basic = "0" ]; then rm -f eproms/27128/basicf6.rom 2>/dev/null 93 | rm -f eproms/27128/basicf8.rom 2>/dev/null 94 | rm -f eproms/27128/basicfa.rom 2>/dev/null 95 | rm -f eproms/27128/basicfc.rom 2>/dev/null; fi 96 | 97 | if [ $floppy = "1" ]; then linux/romfill /32 images/floppy/floppy22.bin eproms/27256/floppy22.rom; fi 98 | if [ $ide = "1" ]; then linux/romfill /32 images/xt-ide/xtide591.bin eproms/27256/xtide591.rom; fi 99 | if [ $basic = "1" ]; then linux/romfill /32 images/basicc11.f6 eproms/27256/basicf6.rom 100 | linux/romfill /32 images/basicc11.f8 eproms/27256/basicf8.rom 101 | linux/romfill /32 images/basicc11.fa eproms/27256/basicfa.rom 102 | linux/romfill /32 images/basicc11.fc eproms/27256/basicfc.rom; fi 103 | linux/romfill /32 $bios.bin eproms/27256/$bios.rom 104 | if [ $floppy = "0" ]; then rm -f eproms/27256/floppy22.rom 2>/dev/null; fi 105 | if [ $ide = "0" ]; then rm -f eproms/27256/xtide591.rom 2>/dev/null; fi 106 | if [ $basic = "0" ]; then rm -f eproms/27256/basicf6.rom 2>/dev/null 107 | rm -f eproms/27256/basicf8.rom 2>/dev/null 108 | rm -f eproms/27256/basicfa.rom 2>/dev/null 109 | rm -f eproms/27256/basicfc.rom 2>/dev/null; fi 110 | 111 | if [ $floppy = "1" ]; then linux/romfill /64 images/floppy/floppy22.bin eproms/27512/floppy22.rom; fi 112 | if [ $ide = "1" ]; then linux/romfill /64 images/xt-ide/xtide591.bin eproms/27512/xtide591.rom; fi 113 | if [ $basic = "1" ]; then linux/romfill /64 images/basicc11.f6 eproms/27512/basicf6.rom 114 | linux/romfill /64 images/basicc11.f8 eproms/27512/basicf8.rom 115 | linux/romfill /64 images/basicc11.fa eproms/27512/basicfa.rom 116 | linux/romfill /64 images/basicc11.fc eproms/27512/basicfc.rom; fi 117 | linux/romfill /64 $bios.bin eproms/27512/$bios.rom 118 | if [ $floppy = "0" ]; then rm -f eproms/27512/floppy22.rom 2>/dev/null; fi 119 | if [ $ide = "0" ]; then rm -f eproms/27512/xtide591.rom 2>/dev/null; fi 120 | if [ $basic = "0" ]; then rm -f eproms/27512/basicf6.rom 2>/dev/null 121 | rm -f eproms/27512/basicf8.rom 2>/dev/null 122 | rm -f eproms/27512/basicfa.rom 2>/dev/null 123 | rm -f eproms/27512/basicfc.rom 2>/dev/null; fi 124 | 125 | rm -f eproms/ibmxt/u18.rom 2>/dev/null 126 | rm -f eproms/ibmxt/u19.rom 2>/dev/null 127 | cp -f images/blank32.bin eproms/ibmxt/u18.rom 128 | cp -f images/blank32.bin eproms/ibmxt/u19.rom 129 | if [ $floppy = "1" ]; then linux/inject /0000 images/floppy/floppy22.bin eproms/ibmxt/u19.rom; fi 130 | if [ $ide = "1" ]; then linux/inject /2000 images/xt-ide/xtide591.bin eproms/ibmxt/u19.rom; fi 131 | if [ $basic = "1" ]; then linux/inject /6000 images/basicc11.f6 eproms/ibmxt/u19.rom 132 | linux/inject /0000 images/basicc11.f8 eproms/ibmxt/u18.rom 133 | linux/inject /2000 images/basicc11.fa eproms/ibmxt/u18.rom 134 | linux/inject /4000 images/basicc11.fc eproms/ibmxt/u18.rom; fi 135 | linux/inject /6000 $bios.bin eproms/ibmxt/u18.rom 136 | 137 | echo "*******************************************************************************" 138 | echo "SUCCESS!: BIOS successfully built" 139 | echo "*******************************************************************************" 140 | goto end 141 | 142 | errasm: 143 | echo 144 | echo 145 | echo "*******************************************************************************" 146 | echo "ERROR: Error assembling BIOS" 147 | echo "*******************************************************************************" 148 | goto end 149 | 150 | errlist: 151 | echo 152 | echo 153 | echo "*******************************************************************************" 154 | echo "ERROR: Error generating listing file" 155 | echo "*******************************************************************************" 156 | goto end 157 | 158 | errlink: 159 | echo 160 | echo "*******************************************************************************" 161 | echo "ERROR: Error linking BIOS" 162 | echo "*******************************************************************************" 163 | goto end 164 | 165 | end: 166 | rm -f $bios.obj 2>/dev/null 167 | rm -f $bios.exe 2>/dev/null 168 | 169 | bios= 170 | floppy= 171 | ide= 172 | basic= 173 | 174 | -------------------------------------------------------------------------------- /make_win.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem *** Set floppy=1 to include Sergey's Floppy BIOS 4 | rem *** Set ide=1 to include XT-IDE BIOS 5 | rem *** Set basic=1 to include IBM ROM BASIC 6 | 7 | set bios=pcxtbios 8 | 9 | set floppy=0 10 | set ide=0 11 | set basic=1 12 | 13 | if exist %bios%.obj del %bios%.obj 14 | if exist %bios%.lst del %bios%.lst 15 | if exist %bios%.exe del %bios%.exe 16 | if exist %bios%.bin del %bios%.bin 17 | 18 | @echo ******************************************************************************* 19 | @echo Assembling BIOS 20 | @echo ******************************************************************************* 21 | win32\wasm -zcm=tasm -d1 -e=1 -fe=nul -fo=%bios%.obj %bios%.asm 22 | if errorlevel 1 goto errasm 23 | if not exist %bios%.obj goto errasm 24 | 25 | @echo. 26 | @echo ******************************************************************************* 27 | @echo Generating Listing 28 | @echo ******************************************************************************* 29 | win32\wdis -l=%bios%.lst -s=%bios%.asm %bios%.obj 30 | if errorlevel 1 goto errlist 31 | if not exist %bios%.lst goto errlist 32 | echo Ok 33 | 34 | @echo. 35 | @echo ******************************************************************************* 36 | @echo Linking BIOS 37 | @echo ******************************************************************************* 38 | win32\wlink format dos name %bios%.exe file %bios%.obj 39 | del %bios%.obj 40 | if not exist %bios%.exe goto errlink 41 | 42 | @echo. 43 | @echo ******************************************************************************* 44 | @echo Building ROM Images 45 | @echo ******************************************************************************* 46 | 47 | win32\exe2rom /8 %bios%.exe %bios%.bin 48 | del %bios%.exe 49 | 50 | if exist test\picoxt.exe win32\inject /70D0 %bios%.bin test\picoxt.exe 51 | 52 | if not exist eproms\nul mkdir eproms 53 | if not exist eproms\2764\nul mkdir eproms\2764 54 | if not exist eproms\27128\nul mkdir eproms\27128 55 | if not exist eproms\27256\nul mkdir eproms\27256 56 | if not exist eproms\27512\nul mkdir eproms\27512 57 | if not exist eproms\ibmxt\nul mkdir eproms\ibmxt 58 | 59 | if %floppy%==1 win32\romfill /8 images\floppy\floppy22.bin eproms\2764\floppy22.rom 60 | if %ide%==1 win32\romfill /8 images\xt-ide\xtide591.bin eproms\2764\xtide591.rom 61 | if %basic%==1 win32\romfill /8 images\basicc11.f6 eproms\2764\basicf6.rom 62 | if %basic%==1 win32\romfill /8 images\basicc11.f8 eproms\2764\basicf8.rom 63 | if %basic%==1 win32\romfill /8 images\basicc11.fa eproms\2764\basicfa.rom 64 | if %basic%==1 win32\romfill /8 images\basicc11.fc eproms\2764\basicfc.rom 65 | win32\romfill /8 %bios%.bin eproms\2764\%bios%.rom 66 | if %floppy%==0 del eproms\2764\floppy22.rom 2>nul 67 | if %ide%==0 del eproms\2764\xtide591.rom 2>nul 68 | if %basic%==0 del eproms\2764\basicf6.rom 2>nul 69 | if %basic%==0 del eproms\2764\basicf8.rom 2>nul 70 | if %basic%==0 del eproms\2764\basicfa.rom 2>nul 71 | if %basic%==0 del eproms\2764\basicfc.rom 2>nul 72 | 73 | if %floppy%==1 win32\romfill /16 images\floppy\floppy22.bin eproms\27128\floppy22.rom 74 | if %ide%==1 win32\romfill /16 images\xt-ide\xtide591.bin eproms\27128\xtide591.rom 75 | if %basic%==1 win32\romfill /16 images\basicc11.f6 eproms\27128\basicf6.rom 76 | if %basic%==1 win32\romfill /16 images\basicc11.f8 eproms\27128\basicf8.rom 77 | if %basic%==1 win32\romfill /16 images\basicc11.fa eproms\27128\basicfa.rom 78 | if %basic%==1 win32\romfill /16 images\basicc11.fc eproms\27128\basicfc.rom 79 | win32\romfill /16 %bios%.bin eproms\27128\%bios%.rom 80 | if %floppy%==0 del eproms\27128\floppy22.rom 2>nul 81 | if %ide%==0 del eproms\27128\xtide591.rom 2>nul 82 | if %basic%==0 del eproms\27128\basicf6.rom 2>nul 83 | if %basic%==0 del eproms\27128\basicf8.rom 2>nul 84 | if %basic%==0 del eproms\27128\basicfa.rom 2>nul 85 | if %basic%==0 del eproms\27128\basicfc.rom 2>nul 86 | 87 | if %floppy%==1 win32\romfill /32 images\floppy\floppy22.bin eproms\27256\floppy22.rom 88 | if %ide%==1 win32\romfill /32 images\xt-ide\xtide591.bin eproms\27256\xtide591.rom 89 | if %basic%==1 win32\romfill /32 images\basicc11.f6 eproms\27256\basicf6.rom 90 | if %basic%==1 win32\romfill /32 images\basicc11.f8 eproms\27256\basicf8.rom 91 | if %basic%==1 win32\romfill /32 images\basicc11.fa eproms\27256\basicfa.rom 92 | if %basic%==1 win32\romfill /32 images\basicc11.fc eproms\27256\basicfc.rom 93 | win32\romfill /32 %bios%.bin eproms\27256\%bios%.rom 94 | if %floppy%==0 del eproms\27256\floppy22.rom 2>nul 95 | if %ide%==0 del eproms\27256\xtide591.rom 2>nul 96 | if %basic%==0 del eproms\27256\basicf6.rom 2>nul 97 | if %basic%==0 del eproms\27256\basicf8.rom 2>nul 98 | if %basic%==0 del eproms\27256\basicfa.rom 2>nul 99 | if %basic%==0 del eproms\27256\basicfc.rom 2>nul 100 | 101 | if %floppy%==1 win32\romfill /64 images\floppy\floppy22.bin eproms\27512\floppy22.rom 102 | if %ide%==1 win32\romfill /64 images\xt-ide\xtide591.bin eproms\27512\xtide591.rom 103 | if %basic%==1 win32\romfill /64 images\basicc11.f6 eproms\27512\basicf6.rom 104 | if %basic%==1 win32\romfill /64 images\basicc11.f8 eproms\27512\basicf8.rom 105 | if %basic%==1 win32\romfill /64 images\basicc11.fa eproms\27512\basicfa.rom 106 | if %basic%==1 win32\romfill /64 images\basicc11.fc eproms\27512\basicfc.rom 107 | win32\romfill /64 %bios%.bin eproms\27512\%bios%.rom 108 | if %floppy%==0 del eproms\27512\floppy22.rom 2>nul 109 | if %ide%==0 del eproms\27512\xtide591.rom 2>nul 110 | if %basic%==0 del eproms\27512\basicf6.rom 2>nul 111 | if %basic%==0 del eproms\27512\basicf8.rom 2>nul 112 | if %basic%==0 del eproms\27512\basicfa.rom 2>nul 113 | if %basic%==0 del eproms\27512\basicfc.rom 2>nul 114 | 115 | if exist eproms\ibmxt\u18.rom del eproms\ibmxt\u18.rom 116 | if exist eproms\ibmxt\u19.rom del eproms\ibmxt\u19.rom 117 | copy images\blank32.bin eproms\ibmxt\u18.rom 118 | copy images\blank32.bin eproms\ibmxt\u19.rom 119 | if %floppy%==1 win32\inject /0000 images\floppy\floppy22.bin eproms\ibmxt\u19.rom 120 | if %ide%==1 win32\inject /2000 images\xt-ide\xtide591.bin eproms\ibmxt\u19.rom 121 | if %basic%==1 win32\inject /6000 images\basicc11.f6 eproms\ibmxt\u19.rom 122 | if %basic%==1 win32\inject /0000 images\basicc11.f8 eproms\ibmxt\u18.rom 123 | if %basic%==1 win32\inject /2000 images\basicc11.fa eproms\ibmxt\u18.rom 124 | if %basic%==1 win32\inject /4000 images\basicc11.fc eproms\ibmxt\u18.rom 125 | win32\inject /6000 %bios%.bin eproms\ibmxt\u18.rom 126 | 127 | @echo ******************************************************************************* 128 | @echo SUCCESS!: BIOS successfully built 129 | @echo ******************************************************************************* 130 | goto end 131 | 132 | :errasm 133 | @echo. 134 | @echo. 135 | @echo ******************************************************************************* 136 | @echo ERROR: Error assembling BIOS 137 | @echo ******************************************************************************* 138 | goto end 139 | 140 | :errlist 141 | @echo. 142 | @echo. 143 | @echo ******************************************************************************* 144 | @echo ERROR: Error generating listing file 145 | @echo ******************************************************************************* 146 | goto end 147 | 148 | :errlink 149 | @echo. 150 | @echo ******************************************************************************* 151 | @echo ERROR: Error linking BIOS 152 | @echo ******************************************************************************* 153 | goto end 154 | 155 | :end 156 | if exist %bios%.obj del %bios%.obj 157 | if exist %bios%.exe del %bios%.exe 158 | 159 | set bios= 160 | set floppy= 161 | set ide= 162 | set basic= 163 | 164 | pause 165 | -------------------------------------------------------------------------------- /original/bios.doc: -------------------------------------------------------------------------------- 1 | From: Ya`akov Miles 2 | To: Info-IBMPC at MIT-MC 3 | Re: BIOS Musings 4 | 5 | You may be interested in a history of where this BIOS came from, and 6 | how it arrived in its present form. A heavily patched, 7 | partially-functionally BIOS (with no copyright statement, or other 8 | visible indication of origin) was supplied with my IBM-PC/xt 9 | compatible 10 mHz motherboard. In order to get my motherboard to 10 | function correctly, in other words, to work with the parity interrupt 11 | enabled and to operate with the NEC "V20", it was necessary to 12 | disassemble and thoroughly go thru this "anonymous" bios, which was 13 | hinted as supplied by Taiwan, while limping along on a name brand 14 | bios, as supplied on my previous motherboard by a different vendor. 15 | In the course of this disassembly, aided by comparison with the 16 | published IBM-PC/xt listings, it became apparent that the 17 | synchronization on horizontal retrace in the video INT 10h service was 18 | the root cause of the failure to operate with the NEC "V20", and that 19 | correcting it to correspond with logic (as in IBM's bios) caused the 20 | glitch to disappear. I am unable to account as to why several name 21 | brand BIOS brands (excluding IBM's) had similar glitches - maybe they 22 | they were produced from similar source code, although this seems 23 | unlikely. In any case, as evidenced by DEBUG, some of these 24 | name-brand BIOS were full of machine-level patches - did the vendor 25 | ever bother to reassemble and optimize the source code. The code that 26 | I examined was full of recursive INT(errupt) instructions, which did 27 | not to contribute to screaming fast BIOS. Therefore, the assembly 28 | code was rearranged so as to eliminate some of the unnecessary CALL, 29 | JMP, and especially INT instructions, as the optimization proceeded 30 | with the later releases. The bios is (c)Anonymous, because there was 31 | no indication of the original authors... 32 | 33 | ps: While playing around with my 10 mHz motherboard, I encountered an 34 | unusual program called HELPME.COM, which ran at a higher pitch 35 | than normal. Since this program behaved normally on other (8 mHz) 36 | turbo motherboards, my curiousity was aroused. This eventually 37 | led me to discover that the 10 mHz motherboard was refreshed in 38 | hardware by channel 1 of the 8253 timer ic, and that this channel 39 | appeared to be counting down from an unusually fast oscillator. 40 | Maybe this could cause problems with other programs... 41 | -------------------------------------------------------------------------------- /phatcode.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/phatcode.exe -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | ============================================================================ 2 | Super PC/Turbo XT BIOS for Intel 8088 or NEC "V20" Motherboards 3 | Additions by Ya`akov Miles (1987) and Jon Petrosky (2008-2017) 4 | http://www.phatcode.net/ 5 | ---------------------------------------------------------------------------- 6 | Version 3.1 - October 28 2017 7 | ============================================================================ 8 | 9 | 10 | About 11 | ===== 12 | This is a modification of the widely-distributed "(c) Anonymous Generic 13 | Turbo XT" BIOS, which is actually a Taiwanese BIOS that was 14 | reverse-engineered by Ya`akov Miles in 1987. 15 | 16 | Back in 2008 I put together an XT system and wanted a BIOS that supported 17 | booting from a hard drive. The Generic XT BIOS did not support this, but 18 | since source code was provided it was easy to add this feature. While I was 19 | at it, I fixed some bugs I found, added more features, and cleaned up the 20 | code. Initially I only modified this BIOS for my computer, but I decided I 21 | might as well release my new version in case it proves useful for someone 22 | else. 23 | 24 | In 2011 I was informed that this BIOS did not work correctly with the 25 | original IBM PC (5150). I made some additional changes and now the 5150 is 26 | supported as well as the 5160 (XT) and just about all PC/XT clones. 27 | 28 | You do not need to have a turbo motherboard to use this BIOS, but if you do, 29 | then you can use the "CTRL ALT -" key combination to toggle the computer 30 | speed between fast and slow. When the speed is toggled, the PC speaker will 31 | sound a high/low pitched blip to indicate the system speed selected. 32 | 33 | 34 | Licenses 35 | ======== 36 | The BIOS source (pcxtbios.asm) and assembled binary image (pcxtbios.bin) are 37 | public domain. 38 | 39 | The included ROM tools (exe2rom, inject, romfill, and split) are public 40 | domain. 41 | 42 | The Watcom tools (wasm, wasmr, wdis, and wlink) are distributed under the 43 | Sybase Open Watcom Public License. 44 | 45 | DOS/32a (renamed to dos4gw.exe) is freeware copyright 1996-2006 by Narech K. 46 | 47 | WarpLink is public domain as of November 4, 1999. 48 | 49 | Sergey's Floppy BIOS is GPL3 copyright 2011-2013 Sergey Malinov. 50 | 51 | XT-IDE Universal BIOS is GPL2 copyright 2009-2010 Tomi Tilli and 52 | 2011-2012 XTIDE Universal BIOS Team. 53 | 54 | IBM ROM BASIC is copyright 1981 IBM and is included for educational use only. 55 | 56 | 57 | Changes 58 | ======= 59 | Version 3.1 Changes: 60 | 61 | Bug Fixes: 62 | * IBM 5150 PC config switches corrected (previously had problems with CGA 63 | and/or FPU) 64 | * 40-column CGA boot fixed 65 | 66 | Changed: 67 | * Int 10h/ah=0 ignores invalid video modes 68 | 69 | Version 3.0 Changes: 70 | 71 | Tools: 72 | * TASM replaced with Open Watcom Assembler (WASM) 73 | * Win32 and Linux versions of tools now included so BIOS can be built in 74 | more environments 75 | * Disassembly listing now automatically generated 76 | 77 | ROMs: 78 | * Ably-Tech HD Floppy BIOS replaced with Sergey's Floppy BIOS 2.2 79 | * Western Digital IDE SuperBIOS replaced with XT-IDE Universal BIOS 80 | 2.0.0.3+ r591 81 | * Future Domain TMC-850M BIOS removed 82 | * Option added to batch files to exclude IBM ROM BASIC 83 | 84 | Code: 85 | * First pass at optimizing code for space 86 | * Some instructions corrected for stricter assemblers 87 | * Slight modifications to assemble with WASM (still assembles with TASM) 88 | * Location of strings and procs optimized to maximize continguous free 89 | space for additional code 90 | * Free space now filled with 90h instead of FFh so it appears more unique 91 | in a hex editor 92 | 93 | Added: 94 | * ROM_START and ROM_END defines set scanning region for expansion ROMs 95 | (can overlap BASIC region) 96 | * Option to delay after expansion ROMs init before clearing screen 97 | (ROM_DELAY) 98 | * Option to always retry disk boot, even if ROM BASIC present 99 | (define RETRY_DISK) 100 | * Keyboard buffer cleared after memory check so BASIC prompt isn't 101 | accidentally skipped 102 | * Added base port 2C0h to RTC (clock) detection 103 | * Option for title bar "fade" 104 | 105 | Changed: 106 | * Memory check now 16-bit access; will be faster on 8086/V30 and some 107 | emulators 108 | 109 | Version 2.6 Changes: 110 | 111 | Bug Fixed: 112 | * Fixed bug preventing programs from performing warm boot by setting 113 | 0040:0072 to 1234h and jumping to F000:FFF0 or F000:E05B (previously 114 | would always cold boot). This bug was also present in the original 115 | BIOS. 116 | 117 | Version 2.5 Changes: 118 | 119 | Added: 120 | * Option to clear user-defined memory region in upper memory area (UMA) 121 | for systems with non-EMS UMBs. These UMBs should be cleared before 122 | use or parity errors may occur. Define CLEAR_UMA and set the region 123 | with UMA_START and UMA_END. Because of ROM space limitations, 124 | TEST_VIDEO must be disabled if using CLEAR_UMA. 125 | * Option to display ROM BASIC boot prompt during warm boot (define 126 | WARM_BOOT_BASIC). 127 | 128 | Version 2.4 Changes: 129 | 130 | Added: 131 | * Improved support for 101-key enhanced keyboards (define ENHANCED_KEYB to 132 | enable) 133 | * CPU test now optional (define TEST_CPU). Must be disabled if 134 | ENHANCED_KEYB is enabled due to ROM space limitations. 135 | * Video memory test now optional (define TEST_VIDEO). Applies only to 136 | Mono/Herc/CGA cards; video memory is never tested on EGA/VGA cards. 137 | 138 | Changed: 139 | * Int 16h extended keyboard functions now fully implemented 140 | (ah=00h/01h/02h/05h/10h/11h/12h). Note that ENHANCED_KEYB does not 141 | need to be enabled to use these functions. 142 | * KEYB_SHIFT_FIX removed; use ENHANCED_KEYB instead. 143 | * NO_MEM_CHECK now faster; only zeroes out memory and does not blank check. 144 | * Removed Int 15h hooks for future expansion BIOS (not used) 145 | 146 | Version 2.3 Changes: 147 | 148 | Changed: 149 | * Int 16h enhanced keyboard functions (ah=10h/11h/12h) now mapped to 150 | standard functions (ah=00h/01h/02h) for programs that expect enhanced 151 | keyboard support. 152 | 153 | Version 2.2 Changes: 154 | 155 | Tools: 156 | * Make batch file generates proper 32K ROMs for IBM 5155 and 5160 157 | 158 | Bug Fixed/Changed: 159 | * FAST_MEM_CHECK option now clears memory after testing. This fixes 160 | problems with programs unable to find free interrupt vectors. However 161 | the "fast" memory check is now slower. For the fastest startup you can 162 | now disable the memory check with the NO_MEM_CHECK option. 163 | 164 | Version 2.1 Changes: 165 | 166 | Added: 167 | * Optional define for IBM PC 5150 support (config switches on motherboard 168 | are read differently) 169 | * Original IBM PC 5150 Int 2 (NMI) entry point now supported for better 170 | IBM PC compatibility 171 | * Optional define to disable turbo support completely (for non-turbo 4.77 172 | MHz systems) 173 | * Int 15h hooks are called for future expansion BIOS to display drives and 174 | boot menu if present 175 | * Optional define to set boot delay length 176 | 177 | Changed: 178 | * Hard drive boot sector load is now only attempted 2 times rather than 4 179 | * Boot delay now based on system timer rather than fixed loops, useful for 180 | very fast systems 181 | * Pressing any key during boot delay message will end delay and start 182 | booting 183 | 184 | Bug Fixes: 185 | * Boots to BASIC if no floppy or hard drive controller (previously would 186 | hang) 187 | * Screen cleared after error if user chooses to continue booting 188 | 189 | Version 2.0 Changes: 190 | 191 | Code: 192 | * Changed from MASM 4.x to TASM IDEAL mode 193 | * Cleaned up source code: added procs, more descriptive labels 194 | (...still some spaghetti due to necessary hard-coded entry points) 195 | 196 | Bug Fixes: 197 | * Warm boot flag restored after external ROM initialization code (fixes 198 | CTRL+ALT+DEL warm boot) 199 | * Equipment Flag in BIOS Data Area now set correctly 200 | * Fixed cursor shape when using Hercules card (was in the middle of the 201 | character) 202 | 203 | Added: 204 | * Optional define to always boot up in turbo mode (TURBO_BOOT) 205 | * Optional define for fast memory check (FAST_MEM_CHECK); uses one test 206 | pattern only 207 | * Optional define for 101-key keyboard shift+nav keys work-around 208 | (KEYB_SHIFT_FIX) 209 | * BIOS is now EGA/VGA aware; will only test video memory on Mono/Herc/CGA 210 | cards 211 | * Nicer boot screen with color support for CGA/EGA/VGA 212 | * Processor and Math Coprocessor detection 213 | * Memory test displays count every 8K; speeds up check on fast systems 214 | with slow video cards 215 | * User has option to boot ROM BASIC even if bootable disk present 216 | * Supports booting from hard drive (if external controller ROM present) 217 | * Toggling turbo on/off sounds high/low-pitched beep rather than changing 218 | cursor shape 219 | 220 | 221 | Notes 222 | ===== 223 | 224 | Error Codes 225 | ----------- 226 | The BIOS may give a "System Error" code at bootup. This error code is a 227 | combination of the following codes: 228 | 229 | 01h - Bad system BIOS checksum 230 | 02h - Bad RAM in main system memory 231 | 04h - Bad RAM in video card 232 | 10h - Bad RAM in vector area (this also in main system memory) 233 | 20h - Bad expansion ROM checksum 234 | 235 | Note that the codes are in hexadecimal. The "System Error" code given by the 236 | BIOS is a sum of the above codes. For example, if the code 26 is given, the 237 | individual errors are 02h, 04h, and 20h. 238 | 239 | Hard Drives 240 | ----------- 241 | The BIOS supports booting from hard drives through the INT 13h interface, 242 | but it _does not_ interface with the drive itself. This means that an 243 | external hard drive BIOS must be present, either on the drive controller 244 | or on the motherboard. 245 | 246 | Floppy Drives 247 | ------------- 248 | High-density floppy disks (3.5" 1.44MB and 5.25" 1.2MB) are not supported 249 | due to lack of ROM space. You will need to use an external floppy controller 250 | BIOS for this. Another option is to run DR-DOS, which loads software support 251 | for high-density drives (this still requires a high-density controller, but 252 | no ROM required). There is also a DOS TSR called "2M-XBIOS" which adds this 253 | support to any DOS, but you cannot boot from a high-density disk. 254 | 255 | Cassette Support 256 | ---------------- 257 | Cassette functions are not supported, also due to lack of ROM space. This 258 | only affects IBM PC 5150s or exact clones since XTs do not have a cassette 259 | port. 260 | 261 | Special Thanks 262 | -------------- 263 | I would like to thank Michael Mruzek for donating an IBM 5150 motherboard so 264 | I could implement original PC support. 265 | 266 | I would also like to thank the following people for identifying bugs and/or 267 | suggesting improvements: 268 | 269 | * Greg Saling 270 | * Roger Flores 271 | * Carlos Teixeira 272 | * Tim Arts 273 | * Luis Felipe Antoniosi 274 | 275 | 276 | Building and Installing the BIOS 277 | ================================ 278 | 279 | Source Code 280 | ----------- 281 | The source code for the BIOS is provided in the file pcxtbios.asm. It has 282 | been formatted for a 100-column page with 8-space tabs. The BIOS will 283 | assemble with any version of Borland TASM. It will also assemble with Open 284 | Watcom WASM 1.9 or later with the -zcm=tasm flag. 285 | 286 | Once assembled and linked, the actual BIOS image is the last 8K of the EXE 287 | produced, with the exception of the final checksum byte which needs to be 288 | calculated and added to the end. (The checksum byte makes the sum of all the 289 | bytes in the image = 0 mod 256.) 290 | 291 | Options 292 | ------- 293 | There are 21 optional defines in the BIOS source code. To enable/disable 294 | them, simply comment or uncomment the definition in the code and then 295 | rebuild the BIOS. 296 | 297 | IBM_PC: 298 | Define only if using with original IBM PC (5150) or exact clone. This 299 | will read the 5150 config switches correctly and set the BIOS computer 300 | type to FFh (PC) rather than FEh (XT). You should also disable the 301 | TURBO_ENABLED and SLOW_FLOPPY definitions if using with an original PC. 302 | 303 | TURBO_ENABLED: 304 | Define to enable "turbo" support and the CTRL ALT - hotkey for switching 305 | from fast/slow speeds. If you have a non-turbo system (4.77 MHz) you 306 | can disable this definition. 307 | 308 | TURBO_BOOT: 309 | If defined, system speed is switched to "turbo" at bootup. This is done 310 | after hardware detection, but before external ROM initialization and 311 | memory check. Has no effect on non-turbo systems. 312 | 313 | TURBO_HOTKEY: 314 | If defined, enables the "CTRL ALT -" hotkey to toggle turbo mode. If 315 | your system has a physical turbo switch, you can disable this to save 316 | ROM space. 317 | 318 | SLOW_FLOPPY: 319 | If defined, will always run the floppy drive at 4.77 MHz. If your system 320 | is faster than 4.77 MHz, you may experience problems accessing the 321 | floppy drive when the system is in "turbo" mode. Usually this only 322 | happens with very old controllers. 323 | 324 | TEST_CPU: 325 | Define to test flags/registers of CPU at power on. If an error is found 326 | the system will be halted with no error codes or beeps. TEST_CPU must be 327 | disabled if using ENHANCED_KEYB due to limited ROM space. 328 | 329 | TEST_VIDEO: 330 | Define to test video memory at power on. Note that this applies only to 331 | monochrome, Hercules, or CGA graphics cards. The system BIOS never tests 332 | Video memory on EGA/VGA cards. (Video memory on EGA/VGA cards may be 333 | tested by their own BIOS.) 334 | 335 | MAX_MEMORY: 336 | Set the maximum memory allowed in KB. If not defined, 640 is used. 337 | Setting a value larger than your system has will not "give" it more 338 | memory; it only changes the amount that may be detected. 339 | 340 | FAST_MEM_CHECK: 341 | Uses only a single pattern (+clear) to test memory, rather than the 342 | original three pattern (+clear) check. 343 | 344 | NO_MEM_CHECK: 345 | Does not test any patterns; clears memory only. 346 | 347 | CLEAR_UMA: 348 | Define to clear a specified region in the upper memory area. This is 349 | useful for systems that can provide non-EMS UMBs. If the UMBs are not 350 | cleared before use, memory parity errors can occur. 351 | 352 | UMA_START: 353 | Starting segment. Must be 8K aligned. Uses A000h if not defined. 354 | 355 | UMA_END: 356 | Ending segment. Must be 8K aligned. Uses F000h if not defined. 357 | 358 | ENHANCED_KEYB: 359 | Define to enable Int 9h enhanced (101-key) keyboard support. This adds 360 | support for F11/F12 as well as SHIFT + gray cursor and nav keys (Insert, 361 | Home, etc). Standard 83/84-key XT keyboards can still be used if this 362 | option is enabled. 363 | 364 | ROM_START: 365 | Expansion ROM search start segment. Must be 2K aligned. Uses C000h if 366 | not defined. If you have an EGA/VGA card this must include the video 367 | BIOS region. 368 | 369 | ROM_END: 370 | Expansion ROM search end segment. Must be 2K aligned. Previously was 371 | F000h; now can be extended all the way to the system BIOS (FE00h). Uses 372 | FE00h if not defined. ROM BASIC at F600h will still work if it is in the 373 | search area. 374 | 375 | ROM_DELAY: 376 | The number of seconds to wait after expantion ROMs initialize, before 377 | clearing the screen and starting the main BIOS display. If not defined, 378 | there will be no delay. Pressing any key will bypass the delay. 379 | 380 | BOOT_DELAY: 381 | The number of seconds to wait after the memory test, before booting or 382 | starting BASIC. Pressing any key will bypass the delay. 383 | 384 | WARM_BOOT_BASIC: 385 | If defined, will display the ROM BASIC boot prompt during a warm boot 386 | (i.e. when CTRL+ALT+DEL is pressed). Normally this prompt is only shown 387 | during a cold boot. 388 | 389 | RETRY_DISK: 390 | Define to prevent booting to ROM BASIC (if present) when a floppy disk 391 | is inserted but the boot sector failed to load after 4 attemps. 392 | 393 | TITLE_BAR_FADE: 394 | Define for a fancy title bar. Disable to save ROM space. 395 | 396 | Building 397 | -------- 398 | To automate building the BIOS, run either make_dos.bat, make_win.bat, or 399 | make_linux.sh. 400 | 401 | make_dos - 16-bit DOS tools (except optional 32-bit wdis.exe for listings) 402 | Requires DOS 3.1 and 286 CPU (386+ for listings) 403 | 404 | make_win - 32-bit Windows tools (compatible with 64-bit Windows) 405 | 406 | make_linux - 32-bit Linux tools (compatible with 64-bit Linux) 407 | 408 | Any of these batch/scripts will assemble and link the BIOS for you. The BIOS 409 | image with correct checksum is output to pcxtbios.bin. 410 | 411 | (In Linux, you will need to enable execute permission for the script by 412 | running "chmod +x make_linux.sh", before running "./make_linux.sh" to build 413 | the BIOS.) 414 | 415 | If you'd like to test out the BIOS, you can run picoxt.exe in the "test" 416 | directory. (PicoXT is an IBM XT emulator for Windows by Picofactory. It will 417 | also run in Linux with Wine.) No configuration is necessary; the new BIOS 418 | image is injected into picoxt.exe when it is built by the batch/script. 419 | 420 | The batch/script will also generate (E)EPROM images of the PC/XT BIOS, and 421 | optionally ROM BASIC, external floppy, and IDE BIOSes. You can use these 422 | files with an EPROM programmer to "burn" your own BIOS chips for use with 423 | your motherboard. The EPROM images are output to the "eproms" directory, 424 | which has the following structure: 425 | 426 | \2764 427 | floppy22.rom (8K, optional) 428 | xtide591.rom (8K, optional) 429 | basicf6.rom (8K, optional) 430 | basicf8.rom (8K, optional) 431 | basicfa.rom (8K, optional) 432 | basicfc.rom (8K, optional) 433 | pcxtbios.rom (8K) 434 | \27128 435 | floppy22.rom (16K, optional) 436 | xtide591.rom (16K, optional) 437 | basicf6.rom (16K, optional) 438 | basicf8.rom (16K, optional) 439 | basicfa.rom (16K, optional) 440 | basicfc.rom (16K, optional) 441 | pcxtbios.rom (16K) 442 | \27256 443 | floppy22.rom (32K, optional) 444 | xtide591.rom (32K, optional) 445 | basicf6.rom (32K, optional) 446 | basicf8.rom (32K, optional) 447 | basicfa.rom (32K, optional) 448 | basicfc.rom (32K, optional) 449 | pcxtbios.rom (32K) 450 | \27512 451 | floppy22.rom (64K, optional) 452 | xtide591.rom (64K, optional) 453 | basicf6.rom (64K, optional) 454 | basicf8.rom (64K, optional) 455 | basicfa.rom (64K, optional) 456 | basicfc.rom (64K, optional) 457 | pcxtbios.rom (64K) 458 | \ibmxt 459 | u18.rom (32K) 460 | u19.rom (32K) 461 | 462 | XT clones with 8K ROMs 463 | ---------------------- 464 | The files in 2764, 27128, 27256, and 27512 are for use with motherboards 465 | that have 8K BIOS ROM sockets. (Usually these boards have 5-8 sockets.) The 466 | files are all 8K images, but those in 27128, 27256, and 27512 use repeating 467 | 8K images to fill 16K/32K/64K EPROM chips, which allows them to work in 8K 468 | sockets. So you can, for example, use 27512 EPROMs when the motherboard 469 | expects 2764 EPROMs with no problems. 470 | 471 | The pcxtbios.rom is the only required ROM, although it is nice to have BASIC 472 | if your board has the sockets. The BIOS typically goes in the last socket, 473 | which corresponds to segment FE00. The BASIC ROMs go in the next 4 sockets 474 | (FC00, FA00, F800, and F600). If you are using the external floppy/IDE 475 | BIOSes, they can go in any socket except FE00. 476 | 477 | IBM PC ROM Note 478 | --------------- 479 | Unlike virtually all XT clones, the IBM PC (5150) uses 2364 EPROMs instead 480 | of 2764 EPROMs. These are still 8K ROMs but the pinout is slightly different. 481 | If you are having a hard time finding or burning 2364 EPROMs, you can make 482 | or buy an adapter that will let you use 27xxx EPROMs in your IBM PC: 483 | 484 | http://www.minuszerodegrees.net/5150_u33.htm 485 | http://store.go4retro.com/2364-adapter/ 486 | 487 | IBM XT and clones with 32K ROMs 488 | ------------------------------- 489 | If you have an IBM XT (5155 or 5160) or clone with two 32K ROM sockets, you 490 | should use the ROM images in the "ibmxt" folder. U19 is mapped to F000 and 491 | U18 is mapped to F800. The external floppy/IDE BIOSes and the first 8K of 492 | BASIC are in u19.rom. The last 24K of BASIC is in u18.rom along with the 8K 493 | BIOS. 494 | 495 | External BIOS Note 496 | ------------------ 497 | Two external BIOSes are included: 498 | 499 | floppy22.bin - Sergey's Floppy BIOS 2.2 (supports HD floppy drives) 500 | xtide591.bin - XT-IDE Universal BIOS 2.0.0.3+ r591 (supports IDE drives) 501 | 502 | To generate corresponding EPROM images of these BIOSes, change the defines at 503 | the beginning of make_dos.bat/make_win.bat/make_linux.sh to equal 1 instead 504 | of 0. For example, 505 | 506 | set floppy=1 507 | set ide=1 508 | 509 | Please note that using these external BIOSes without the corresponding 510 | hardware may give unpredictable results. 511 | 512 | IBM ROM BASIC 513 | ------------- 514 | If you want to exclude IBM ROM BASIC from the EPROM images, change the 515 | "basic" define to 0 in make_dos.bat/make_win.bat/make_linux.sh. 516 | 517 | 518 | Modifying the BIOS 519 | ================== 520 | Because some XT clones only have a single 8K ROM socket, the entire BIOS 521 | has been designed to fit into an 8K ROM. Many features have been added, and 522 | now that space is almost full. 523 | 524 | If you try to add some additional code and build the BIOS, you will likely 525 | see an error similar to this: 526 | 527 | pcxtbios.asm(242): Error! E582: forced error: 528 | pcxtbios.asm(242): Note! N592: macro called from file pcxtbios.asm(1419) 529 | pcxtbios.asm(242): 574: Too many errors 530 | 531 | This indicates that the entry point on line 1419 can't be met, because the 532 | code before that point is too large and has pushed past the target address. 533 | The BIOS has several hard entry points that must be preserved in order to 534 | maintain 100% compatibility with IBM BIOSes. 535 | 536 | To get around this, you can move any string or proc that isn't directly after 537 | an entry point to free up code space where it's needed. The code has been 538 | optimized so that with the most common BIOS options enabled, most of the 539 | free space is grouped before the entry point at FA6E (line 4828). Depending 540 | on the options enabled, there will be 57 to 213 bytes free at that location. 541 | 542 | There may also be free space in other areas if more options are disabled. 543 | For example, if TEST_CPU and ENHANCED_KEYB are both disabled, there will be 544 | 130 bytes free before the entry point at E6F2 (line 1664). 545 | 546 | You can refer to the listing file (pcxtbios.lst) generated during the build 547 | process to determine the size of various procs to see what can be moved 548 | around. 549 | 550 | You can also view the BIOS image (pcxtbios.bin) with a hex editor and search 551 | for strings of the "pad" byte (90h) to visually see the free space. Add E000h 552 | to the offset in the BIOS image to find the matching entry point in the 553 | source code. For example, offset 1A6E in pcxtbios.bin corresponds to the 554 | FA6E entry point in pcxtbios.asm. 555 | 556 | 557 | BIOS History from Ya`akov Miles 558 | =============================== 559 | From: Ya`akov Miles 560 | To: Info-IBMPC at MIT-MC 561 | Re: BIOS Musings 562 | 563 | You may be interested in a history of where this BIOS came from, and how it 564 | arrived in its present form. A heavily patched, partially-functionally BIOS 565 | (with no copyright statement, or other visible indication of origin) was 566 | supplied with my IBM-PC/XT compatible 10 MHz motherboard. 567 | 568 | In order to get my motherboard to function correctly, in other words, to 569 | work with the parity interrupt enabled and to operate with the NEC "V20", 570 | it was necessary to disassemble and thoroughly go through this "anonymous" 571 | BIOS, which was hinted as supplied by Taiwan, while limping along on a name 572 | brand BIOS, as supplied on my previous motherboard by a different vendor. 573 | 574 | In the course of this disassembly, aided by comparison with the published 575 | IBM-PC/XT listings, it became apparent that the synchronization on 576 | horizontal retrace in the video INT 10h service was the root cause of the 577 | failure to operate with the NEC "V20", and that correcting it to correspond 578 | with logic (as in IBM's BIOS) caused the glitch to disappear. I am unable to 579 | account as to why several name brand BIOS brands (excluding IBM's) had 580 | similar glitches--maybe they they were produced from similar source code, 581 | although this seems unlikely. 582 | 583 | In any case, as evidenced by DEBUG, some of these name-brand BIOS were full 584 | of machine-level patches--did the vendor ever bother to reassemble and 585 | optimize the source code? The code that I examined was full of recursive 586 | INT(errupt) instructions, which did not to contribute to screaming fast 587 | BIOS. Therefore, the assembly code was rearranged so as to eliminate some of 588 | the unnecessary CALL, JMP, and especially INT instructions, as the 589 | optimization proceeded with the later releases. 590 | 591 | The BIOS is copyright (c) Anonymous, because there was no indication of the 592 | original authors... 593 | 594 | ps: While playing around with my 10 MHz motherboard, I encountered an 595 | unusual program called HELPME.COM, which ran at a higher pitch than 596 | normal. Since this program behaved normally on other (8 MHz) turbo 597 | motherboards, my curiosity was aroused. This eventually led me to 598 | discover that the 10 MHz motherboard was refreshed in hardware by 599 | channel 1 of the 8253 timer IC, and that this channel appeared to be 600 | counting down from an unusually fast oscillator. Maybe this could cause 601 | problems with other programs... 602 | 603 | ;--------------------------------------------------------------------------- 604 | ; Email Header from Original BIOS 605 | ;--------------------------------------------------------------------------- 606 | ; Date: Wed, 13 Jan 88 04:26 PST 607 | ; From: 608 | ; Subject: BIOS.ASM update INFO-IBMPC librarys 609 | ; To: hicks@walker-emh.arpa 610 | ;--------------------------------------------------------------------------- 611 | -------------------------------------------------------------------------------- /test/basicc11.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/test/basicc11.bin -------------------------------------------------------------------------------- /test/et4000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/test/et4000.bin -------------------------------------------------------------------------------- /test/picoxt.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/test/picoxt.exe -------------------------------------------------------------------------------- /toolsrc/exe2rom.bas: -------------------------------------------------------------------------------- 1 | DEFINT A-Z 2 | '$DYNAMIC 3 | 4 | PRINT "EXE2ROM - Makes BIOS ROM image from EXE file" 5 | PRINT "Version 1.0 by Plasma / Jon Petrosky [01-05-2008]" 6 | PRINT 7 | 8 | Size = 8 9 | 10 | Cmd$ = LTRIM$(RTRIM$(COMMAND$)) 11 | IF LEN(Cmd$) < 3 GOTO Help 12 | 13 | IF LEFT$(Cmd$, 1) = "/" THEN 14 | Size = VAL(MID$(Cmd$, 2, 2)) 15 | IF Size <> 4 AND Size <> 8 AND Size <> 16 AND Size <> 32 AND Size <> 64 THEN GOTO Help 16 | Cmd$ = LTRIM$(RIGHT$(Cmd$, LEN(Cmd$) - 3)) 17 | END IF 18 | 19 | RomSize = Size * 1024 20 | PRINT "Using ROM Size" + STR$(Size) + "K" 21 | 22 | Split = INSTR(Cmd$, " ") 23 | IF Split = 0 THEN GOTO Help 24 | 25 | SrcFile$ = RTRIM$(LEFT$(Cmd$, Split)) 26 | DstFile$ = LTRIM$(RIGHT$(Cmd$, LEN(Cmd$) - Split)) 27 | 28 | OPEN SrcFile$ FOR BINARY AS #1 29 | 30 | OPEN DstFile$ FOR BINARY AS #2 31 | CLOSE #2 32 | KILL DstFile$ 33 | OPEN DstFile$ FOR BINARY AS #2 34 | 35 | SEEK #1, LOF(1) - RomSize + 2 36 | 37 | Buffer$ = SPACE$(RomSize / 4) 38 | CheckSum = 0 39 | 40 | PRINT "Reading EXE file '" + SrcFile$ + "'" 41 | PRINT "Writing ROM file '" + DstFile$ + "'" 42 | 43 | FOR i = 1 TO 4 44 | GET #1, , Buffer$ 45 | 46 | FOR j = 1 TO LEN(Buffer$) 47 | Byte = ASC(MID$(Buffer$, j, 1)) 48 | CheckSum = CheckSum + Byte 49 | IF CheckSum > 255 THEN CheckSum = CheckSum - 256 50 | NEXT 51 | 52 | IF i = 4 THEN 53 | LastByte = 255 - CheckSum + 1 54 | IF LastByte < 256 THEN MID$(Buffer$, LEN(Buffer$), 1) = CHR$(LastByte) 55 | END IF 56 | 57 | PUT #2, , Buffer$ 58 | NEXT 59 | 60 | CLOSE #2 61 | CLOSE #1 62 | 63 | PRINT "Complete" 64 | PRINT 65 | END 66 | 67 | Help: 68 | PRINT "Syntax: EXE2ROM [/{size}] exefile romfile" 69 | PRINT 70 | PRINT "/{size} Output ROM image size in KB (4, 8, 16, 32, or 64), default /8" 71 | PRINT "exefile EXE file to use, must be properly assembled" 72 | PRINT "romfile ROM file to output, existing files will be overwritten" 73 | END 74 | 75 | -------------------------------------------------------------------------------- /toolsrc/inject.bas: -------------------------------------------------------------------------------- 1 | DEFINT A-Z 2 | '$DYNAMIC 3 | 4 | PRINT "INJECT - Overwrites part of a binary file with another binary file" 5 | PRINT "Version 1.0 by Plasma / Jon Petrosky [04-21-2008]" 6 | PRINT 7 | 8 | Cmd$ = LTRIM$(RTRIM$(COMMAND$)) 9 | IF LEN(Cmd$) < 3 GOTO Help 10 | 11 | Split = INSTR(Cmd$, " ") 12 | IF Split = 0 THEN GOTO Help 13 | 14 | IF LEFT$(Cmd$, 1) = "/" THEN 15 | Offs = VAL("&H0" + MID$(Cmd$, 2, Split - 2)) 16 | Cmd$ = LTRIM$(RIGHT$(Cmd$, LEN(Cmd$) - Split)) 17 | END IF 18 | 19 | Offset& = Offs 20 | IF Offs < 0 THEN Offset& = 65536& + Offs 21 | PRINT "Using offset " + HEX$(Offset&) + "H" 22 | 23 | Split = INSTR(Cmd$, " ") 24 | IF Split = 0 THEN GOTO Help 25 | 26 | InsFile$ = RTRIM$(LEFT$(Cmd$, Split)) 27 | DstFile$ = LTRIM$(RIGHT$(Cmd$, LEN(Cmd$) - Split)) 28 | 29 | PRINT "Inserting file '" + InsFile$ + "'" 30 | PRINT "Into destination file '" + DstFile$ + "'" 31 | 32 | OPEN InsFile$ FOR BINARY AS #1 33 | OPEN DstFile$ FOR BINARY AS #2 34 | 35 | SEEK #2, Offset& + 1 36 | DO WHILE NOT EOF(1) 37 | Buffer$ = INPUT$(4096, #1) 38 | PUT #2, , Buffer$ 39 | LOOP 40 | 41 | CLOSE #2 42 | CLOSE #1 43 | 44 | PRINT "Complete" 45 | PRINT 46 | END 47 | 48 | Help: 49 | PRINT "Syntax: INJECT [/{offset}] insertfile destfile" 50 | PRINT 51 | PRINT "/{offset} Offset into destfile to start insertion (value in hex, default 0)" 52 | PRINT "insertfile Binary file to insert, will not be modified" 53 | PRINT "destfile Destination binary file to be modified" 54 | END 55 | 56 | -------------------------------------------------------------------------------- /toolsrc/readme.txt: -------------------------------------------------------------------------------- 1 | These tools were originally written in QuickBASIC and compiled for DOS. 2 | 3 | However, they can be compiled for Windows/Linux with no modifications using 4 | 5 | the FreeBASIC compiler with the "-lang qb" switch. 6 | -------------------------------------------------------------------------------- /toolsrc/romfill.bas: -------------------------------------------------------------------------------- 1 | DEFINT A-Z 2 | '$DYNAMIC 3 | 4 | PRINT "ROMFILL - Duplicates ROM image to fill oversized EPROM" 5 | PRINT "Version 1.0 by Plasma / Jon Petrosky [04-21-2008]" 6 | PRINT 7 | 8 | Size = 64 9 | 10 | Cmd$ = LTRIM$(RTRIM$(COMMAND$)) 11 | IF LEN(Cmd$) < 3 GOTO Help 12 | 13 | IF LEFT$(Cmd$, 1) = "/" THEN 14 | Size = VAL(MID$(Cmd$, 2, 2)) 15 | IF Size <> 4 AND Size <> 8 AND Size <> 16 AND Size <> 32 AND Size <> 64 THEN GOTO Help 16 | Cmd$ = LTRIM$(RIGHT$(Cmd$, LEN(Cmd$) - 3)) 17 | END IF 18 | DstSize& = Size * 1024& 19 | 20 | Split = INSTR(Cmd$, " ") 21 | IF Split = 0 THEN GOTO Help 22 | 23 | SrcFile$ = RTRIM$(LEFT$(Cmd$, Split)) 24 | DstFile$ = LTRIM$(RIGHT$(Cmd$, LEN(Cmd$) - Split)) 25 | 26 | OPEN SrcFile$ FOR BINARY AS #1 27 | SrcSize& = LOF(1) 28 | 29 | IF SrcSize& <> 1024 AND SrcSize& <> 2048 AND SrcSize& <> 4096 AND SrcSize& <> 8192 AND SrcSize& <> 16384 AND SrcSize& <> 32768 AND SrcSize& <> 65536 THEN 30 | PRINT "Source ROM image (" + LTRIM$(STR$(SrcSize& \ 1024)) + "K) has invalid size" 31 | END 32 | ELSEIF SrcSize& > DstSize& THEN 33 | PRINT "Source ROM image (" + LTRIM$(STR$(SrcSize& \ 1024)) + "K) too big for destination image (" + LTRIM$(STR$(Size)) + "K)" 34 | END 35 | END IF 36 | 37 | PRINT "Source ROM Image" + STR$(SrcSize& \ 1024) + "K" 38 | PRINT "Using EPROM Size" + STR$(Size) + "K" 39 | 40 | OPEN DstFile$ FOR BINARY AS #2 41 | CLOSE #2 42 | KILL DstFile$ 43 | OPEN DstFile$ FOR BINARY AS #2 44 | 45 | Buffer$ = SPACE$(SrcSize& / 4) 46 | 47 | PRINT "Reading ROM file '" + SrcFile$ + "'" 48 | PRINT "Writing ROM file '" + DstFile$ + "'" 49 | 50 | FOR i = 1 TO DstSize& \ SrcSize& 51 | FOR j = 1 TO 4 52 | GET #1, , Buffer$ 53 | PUT #2, , Buffer$ 54 | NEXT 55 | SEEK #1, 1 56 | NEXT 57 | 58 | CLOSE #2 59 | CLOSE #1 60 | 61 | PRINT "Complete" 62 | PRINT 63 | END 64 | 65 | Help: 66 | PRINT "Syntax: ROMFILL [/{size}] infile outfile" 67 | PRINT 68 | PRINT "/{size} Output ROM size in KB (4, 8, 16, 32, or 64), default /64" 69 | PRINT "infile Input ROM file to use, must be 1, 2, 4, 8, 16, 32, or 64K" 70 | PRINT "outfile ROM file to output, existing files will be overwritten" 71 | END 72 | 73 | -------------------------------------------------------------------------------- /toolsrc/split.bas: -------------------------------------------------------------------------------- 1 | DEFINT A-Z 2 | '$DYNAMIC 3 | 4 | PRINT "SPLIT - Splits single binary file to even/odd files" 5 | PRINT "Version 1.0 by Plasma / Jon Petrosky [04-21-2008]" 6 | PRINT 7 | 8 | Cmd$ = LTRIM$(RTRIM$(COMMAND$)) 9 | IF LEN(Cmd$) < 5 GOTO Help 10 | 11 | Split = INSTR(Cmd$, " ") 12 | IF Split = 0 THEN GOTO Help 13 | 14 | SrcFile$ = RTRIM$(LEFT$(Cmd$, Split)) 15 | Cmd$ = LTRIM$(RIGHT$(Cmd$, LEN(Cmd$) - Split)) 16 | 17 | Split = INSTR(Cmd$, " ") 18 | IF Split = 0 THEN GOTO Help 19 | 20 | EvenFile$ = RTRIM$(LEFT$(Cmd$, Split)) 21 | OddFile$ = LTRIM$(RIGHT$(Cmd$, LEN(Cmd$) - Split)) 22 | 23 | OPEN SrcFile$ FOR BINARY AS #1 24 | 25 | OPEN EvenFile$ FOR BINARY AS #2 26 | CLOSE #2 27 | KILL EvenFile$ 28 | OPEN EvenFile$ FOR BINARY AS #2 29 | 30 | OPEN OddFile$ FOR BINARY AS #3 31 | CLOSE #3 32 | KILL OddFile$ 33 | OPEN OddFile$ FOR BINARY AS #3 34 | 35 | PRINT "Reading input file '" + SrcFile$ + "'" 36 | PRINT "Writing even file '" + EvenFile$ + "'" 37 | PRINT "Writing odd file '" + OddFile$ + "'" 38 | 39 | DO WHILE NOT EOF(1) 40 | Buffer$ = INPUT$(4096, #1) 41 | Even$ = "" 42 | Odd$ = "" 43 | FOR i = 1 TO LEN(Buffer$) STEP 2 44 | Even$ = Even$ + MID$(Buffer$, i, 1) 45 | Odd$ = Odd$ + MID$(Buffer$, i + 1, 1) 46 | NEXT 47 | PUT #2, , Even$ 48 | PUT #3, , Odd$ 49 | LOOP 50 | 51 | CLOSE 52 | 53 | PRINT "Complete" 54 | PRINT 55 | END 56 | 57 | Help: 58 | PRINT "Syntax: SPLIT binfile evenfile oddfile" 59 | PRINT 60 | PRINT "binfile Input binary image file, must be an even lenth" 61 | PRINT "evenfile Even binary file to output, existing files will be overwritten" 62 | PRINT "oddfile Odd binary file to outputt, existing files will be overwritten" 63 | END 64 | 65 | -------------------------------------------------------------------------------- /win32/exe2rom.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/win32/exe2rom.exe -------------------------------------------------------------------------------- /win32/inject.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/win32/inject.exe -------------------------------------------------------------------------------- /win32/romfill.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/win32/romfill.exe -------------------------------------------------------------------------------- /win32/split.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/win32/split.exe -------------------------------------------------------------------------------- /win32/wasm.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/win32/wasm.exe -------------------------------------------------------------------------------- /win32/wdis.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/win32/wdis.exe -------------------------------------------------------------------------------- /win32/wlink.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/win32/wlink.exe -------------------------------------------------------------------------------- /win32/wlinkd.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/virtualxt/pcxtbios/54751cc0ee25cb53173262e4f37be5344de580d6/win32/wlinkd.dll --------------------------------------------------------------------------------