[3] | 1 | ; Project name : XTIDE Universal BIOS
|
---|
[86] | 2 | ; Authors : Tomi Tilli
|
---|
| 3 | ; : aitotat@gmail.com
|
---|
| 4 | ; :
|
---|
[181] | 5 | ; : Greg Lindhorst
|
---|
| 6 | ; : gregli@hotmail.com
|
---|
| 7 | ; ;
|
---|
[86] | 8 | ; : Krister Nordvall
|
---|
| 9 | ; : krille_n_@hotmail.com
|
---|
| 10 | ; :
|
---|
[3] | 11 | ; Description : Main file for BIOS. This is the only file that needs
|
---|
| 12 | ; to be compiled since other files are included to this
|
---|
| 13 | ; file (so no linker needed, Nasm does it all).
|
---|
| 14 |
|
---|
[376] | 15 | ;
|
---|
[380] | 16 | ; XTIDE Universal BIOS and Associated Tools
|
---|
[625] | 17 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2023 by XTIDE Universal BIOS Team.
|
---|
[376] | 18 | ;
|
---|
| 19 | ; This program is free software; you can redistribute it and/or modify
|
---|
| 20 | ; it under the terms of the GNU General Public License as published by
|
---|
| 21 | ; the Free Software Foundation; either version 2 of the License, or
|
---|
| 22 | ; (at your option) any later version.
|
---|
[380] | 23 | ;
|
---|
[376] | 24 | ; This program is distributed in the hope that it will be useful,
|
---|
| 25 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 26 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
[380] | 27 | ; GNU General Public License for more details.
|
---|
[376] | 28 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
| 29 | ;
|
---|
| 30 |
|
---|
[294] | 31 | ORG 0 ; Code start offset 0000h
|
---|
[3] | 32 |
|
---|
[379] | 33 | ; We must define included libraries before including "AssemblyLibrary.inc".
|
---|
[592] | 34 | %define EXCLUDE_FROM_XUB ; Exclude unused library functions
|
---|
[379] | 35 | %ifdef MODULE_BOOT_MENU
|
---|
[567] | 36 | %define MENUEVENT_INLINE_OFFSETS ; Only one menu required, save space and inline offsets
|
---|
[379] | 37 | %define INCLUDE_MENU_LIBRARY
|
---|
[567] | 38 | %define MENU_NO_ESC ; User cannot 'esc' out of the menu
|
---|
[379] | 39 | %else ; If no boot menu included
|
---|
| 40 | %define INCLUDE_DISPLAY_LIBRARY
|
---|
[392] | 41 | %define INCLUDE_KEYBOARD_LIBRARY
|
---|
[379] | 42 | %define INCLUDE_TIME_LIBRARY
|
---|
| 43 | %endif
|
---|
| 44 |
|
---|
| 45 |
|
---|
[181] | 46 | ; Included .inc files
|
---|
| 47 | %include "AssemblyLibrary.inc" ; Assembly Library. Must be included first!
|
---|
[522] | 48 | %include "ModuleDependency.inc" ; Dependency checks for optional modules. Must be included second!
|
---|
[358] | 49 | %include "Version.inc"
|
---|
[181] | 50 | %include "ATA_ID.inc" ; For ATA Drive Information structs
|
---|
| 51 | %include "IdeRegisters.inc" ; For ATA Registers, flags and commands
|
---|
| 52 | %include "Int13h.inc" ; Equates for INT 13h functions
|
---|
| 53 | %include "CustomDPT.inc" ; For Disk Parameter Table
|
---|
| 54 | %include "RomVars.inc" ; For ROMVARS and IDEVARS structs
|
---|
| 55 | %include "RamVars.inc" ; For RAMVARS struct
|
---|
[254] | 56 | %include "BootVars.inc" ; For BOOTVARS struct
|
---|
[400] | 57 | %include "IdeIO.inc" ; Macros for IDE port I/O
|
---|
[181] | 58 | %include "DeviceIDE.inc" ; For IDE device equates
|
---|
[3] | 59 |
|
---|
| 60 |
|
---|
[397] | 61 |
|
---|
[3] | 62 | ; Section containing code
|
---|
| 63 | SECTION .text
|
---|
| 64 |
|
---|
| 65 | ; ROM variables (must start at offset 0)
|
---|
[625] | 66 | CNT_ROM_BLOCKS EQU BIOS_SIZE / 512 ; number of 512B blocks, 16 = 8kB BIOS
|
---|
[3] | 67 | istruc ROMVARS
|
---|
[625] | 68 | at ROMVARS.wRomSign, dw 0AA55h ; PC ROM signature
|
---|
| 69 | at ROMVARS.bRomSize, db CNT_ROM_BLOCKS ; ROM size in 512B blocks
|
---|
| 70 | at ROMVARS.rgbJump, jmp Initialize_FromMainBiosRomSearch
|
---|
| 71 | at ROMVARS.rgbSign, db FLASH_SIGNATURE
|
---|
| 72 | at ROMVARS.szTitle, db TITLE_STRING
|
---|
| 73 | at ROMVARS.szVersion, db "r"
|
---|
| 74 | db ROM_VERSION_STRING
|
---|
| 75 | db BUILD_DATE_STRING,NULL
|
---|
| 76 | %ifdef MODULE_BOOT_MENU
|
---|
| 77 | at ROMVARS.pColorTheme, dw ColorTheme ; Offset to the ATTRIBUTE_CHARS struc that holds the color theme
|
---|
| 78 | %endif
|
---|
[3] | 79 |
|
---|
| 80 | ;---------------------------;
|
---|
| 81 | ; AT Build default settings ;
|
---|
| 82 | ;---------------------------;
|
---|
| 83 | %ifdef USE_AT
|
---|
[593] | 84 | %ifdef USE_386
|
---|
[605] | 85 | at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | FLG_ROMVARS_CLEAR_BDA_HD_COUNT | MASK_ROMVARS_INCLUDED_MODULES
|
---|
[593] | 86 | %else
|
---|
[397] | 87 | at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | MASK_ROMVARS_INCLUDED_MODULES
|
---|
[593] | 88 | %endif
|
---|
[625] | 89 | at ROMVARS.wRamVars, dw NULL ; Use 'stolen' top of conventional memory by default in Full mode
|
---|
[143] | 90 | at ROMVARS.wDisplayMode, dw DEFAULT_TEXT_MODE
|
---|
[397] | 91 | %ifdef MODULE_BOOT_MENU
|
---|
[491] | 92 | at ROMVARS.wBootTimeout, dw BOOT_MENU_DEFAULT_TIMEOUT
|
---|
[397] | 93 | %endif
|
---|
[625] | 94 | %ifdef USE_PS2
|
---|
| 95 | at ROMVARS.bIdeCnt, db 4 ; Number of supported controllers with two McIDE adapters
|
---|
| 96 | %else
|
---|
[485] | 97 | at ROMVARS.bIdeCnt, db 2 ; Number of supported controllers
|
---|
[625] | 98 | %endif
|
---|
[3] | 99 | at ROMVARS.bBootDrv, db 80h ; Boot Menu default drive
|
---|
| 100 | at ROMVARS.bMinFddCnt, db 0 ; Do not force minimum number of floppy drives
|
---|
| 101 | at ROMVARS.bStealSize, db 1 ; Steal 1kB from base memory
|
---|
[380] | 102 | at ROMVARS.bIdleTimeout, db 0 ; Standby timer disabled by default
|
---|
[3] | 103 |
|
---|
[491] | 104 | at ROMVARS.ideVars0+IDEVARS.wBasePort, dw DEVICE_ATA_PRIMARY_PORT ; Controller Command Block base port
|
---|
| 105 | at ROMVARS.ideVars0+IDEVARS.wControlBlockPort, dw DEVICE_ATA_PRIMARY_PORTCTRL ; Controller Control Block base port
|
---|
[473] | 106 | at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_16BIT_ATA
|
---|
[621] | 107 | %ifdef MODULE_IRQ
|
---|
[625] | 108 | %ifdef USE_PS2
|
---|
| 109 | at ROMVARS.ideVars0+IDEVARS.bIRQ, db 0
|
---|
| 110 | %else
|
---|
[524] | 111 | at ROMVARS.ideVars0+IDEVARS.bIRQ, db 14
|
---|
[621] | 112 | %endif
|
---|
[625] | 113 | %endif
|
---|
[422] | 114 | at ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
| 115 | at ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
[3] | 116 |
|
---|
[485] | 117 | at ROMVARS.ideVars1+IDEVARS.wBasePort, dw DEVICE_ATA_SECONDARY_PORT
|
---|
| 118 | at ROMVARS.ideVars1+IDEVARS.wControlBlockPort, dw DEVICE_ATA_SECONDARY_PORTCTRL
|
---|
| 119 | at ROMVARS.ideVars1+IDEVARS.bDevice, db DEVICE_16BIT_ATA
|
---|
[621] | 120 | %ifdef MODULE_IRQ
|
---|
[625] | 121 | %ifdef USE_PS2
|
---|
| 122 | at ROMVARS.ideVars1+IDEVARS.bIRQ, db 0
|
---|
| 123 | %else
|
---|
[524] | 124 | at ROMVARS.ideVars1+IDEVARS.bIRQ, db 15
|
---|
[621] | 125 | %endif
|
---|
[625] | 126 | %endif
|
---|
[422] | 127 | at ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
| 128 | at ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
[3] | 129 |
|
---|
[485] | 130 | at ROMVARS.ideVars2+IDEVARS.wBasePort, dw DEVICE_ATA_TERTIARY_PORT
|
---|
| 131 | at ROMVARS.ideVars2+IDEVARS.wControlBlockPort, dw DEVICE_ATA_TERTIARY_PORTCTRL
|
---|
| 132 | at ROMVARS.ideVars2+IDEVARS.bDevice, db DEVICE_16BIT_ATA
|
---|
[621] | 133 | %ifdef MODULE_IRQ
|
---|
[625] | 134 | %ifdef USE_PS2
|
---|
| 135 | at ROMVARS.ideVars2+IDEVARS.bIRQ, db 0
|
---|
| 136 | %else
|
---|
[592] | 137 | at ROMVARS.ideVars2+IDEVARS.bIRQ, db 0 ; Should be 11 on the GSI Inc. Model 2C
|
---|
[621] | 138 | %endif
|
---|
[625] | 139 | %endif
|
---|
[422] | 140 | at ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
| 141 | at ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
[143] | 142 |
|
---|
[473] | 143 | at ROMVARS.ideVars3+IDEVARS.wBasePort, dw DEVICE_ATA_QUATERNARY_PORT
|
---|
| 144 | at ROMVARS.ideVars3+IDEVARS.wControlBlockPort, dw DEVICE_ATA_QUATERNARY_PORTCTRL
|
---|
| 145 | at ROMVARS.ideVars3+IDEVARS.bDevice, db DEVICE_16BIT_ATA
|
---|
[621] | 146 | %ifdef MODULE_IRQ
|
---|
[625] | 147 | %ifdef USE_PS2
|
---|
| 148 | at ROMVARS.ideVars3+IDEVARS.bIRQ, db 0
|
---|
| 149 | %else
|
---|
[592] | 150 | at ROMVARS.ideVars3+IDEVARS.bIRQ, db 0 ; Should be 10 on the GSI Inc. Model 2C
|
---|
[621] | 151 | %endif
|
---|
[625] | 152 | %endif
|
---|
[422] | 153 | at ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
| 154 | at ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, dw DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
[175] | 155 |
|
---|
| 156 | %ifdef MODULE_SERIAL
|
---|
[589] | 157 | at ROMVARS.ideVarsSerialAuto+IDEVARS.bDevice, db DEVICE_SERIAL_PORT
|
---|
[181] | 158 | %endif
|
---|
[3] | 159 | %else
|
---|
| 160 | ;-----------------------------------;
|
---|
| 161 | ; XT and XT+ Build default settings ;
|
---|
| 162 | ;-----------------------------------;
|
---|
[397] | 163 | at ROMVARS.wFlags, dw MASK_ROMVARS_INCLUDED_MODULES
|
---|
[625] | 164 | at ROMVARS.wRamVars, dw LITE_MODE_RAMVARS_SEGMENT
|
---|
[143] | 165 | at ROMVARS.wDisplayMode, dw DEFAULT_TEXT_MODE
|
---|
[397] | 166 | %ifdef MODULE_BOOT_MENU
|
---|
[491] | 167 | at ROMVARS.wBootTimeout, dw BOOT_MENU_DEFAULT_TIMEOUT
|
---|
[397] | 168 | %endif
|
---|
[567] | 169 | at ROMVARS.bIdeCnt, db 1
|
---|
[3] | 170 | at ROMVARS.bBootDrv, db 80h ; Boot Menu default drive
|
---|
[461] | 171 | at ROMVARS.bMinFddCnt, db 0 ; Do not force minimum number of floppy drives
|
---|
[3] | 172 | at ROMVARS.bStealSize, db 1 ; Steal 1kB from base memory in full mode
|
---|
[380] | 173 | at ROMVARS.bIdleTimeout, db 0 ; Standby timer disabled by default
|
---|
[3] | 174 |
|
---|
[589] | 175 | %ifndef MODULE_8BIT_IDE
|
---|
| 176 | at ROMVARS.ideVars0+IDEVARS.wBasePort, dw DEVICE_ATA_PRIMARY_PORT ; Controller Command Block base port
|
---|
| 177 | at ROMVARS.ideVars0+IDEVARS.wControlBlockPort, dw DEVICE_ATA_PRIMARY_PORTCTRL ; Controller Control Block base port
|
---|
| 178 | at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_16BIT_ATA
|
---|
| 179 | %elifdef MODULE_8BIT_IDE_ADVANCED
|
---|
| 180 | at ROMVARS.ideVars0+IDEVARS.wBasePort, dw DEVICE_XTIDE_DEFAULT_PORT ; Controller Command Block base port
|
---|
| 181 | at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_8BIT_XTCF_PIO8
|
---|
[559] | 182 | %else
|
---|
[589] | 183 | at ROMVARS.ideVars0+IDEVARS.wBasePort, dw DEVICE_XTIDE_DEFAULT_PORT ; Controller Command Block base port
|
---|
| 184 | at ROMVARS.ideVars0+IDEVARS.wControlBlockPort, dw DEVICE_XTIDE_DEFAULT_PORTCTRL ; Controller Control Block base port
|
---|
| 185 | at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_8BIT_XTIDE_REV1
|
---|
[559] | 186 | %endif
|
---|
[447] | 187 | at ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
| 188 | at ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
[143] | 189 |
|
---|
[589] | 190 | at ROMVARS.ideVars1+IDEVARS.wBasePort, dw DEVICE_ATA_SECONDARY_PORT
|
---|
| 191 | at ROMVARS.ideVars1+IDEVARS.wControlBlockPort, dw DEVICE_ATA_SECONDARY_PORTCTRL
|
---|
| 192 | at ROMVARS.ideVars1+IDEVARS.bDevice, db DEVICE_16BIT_ATA
|
---|
[447] | 193 | at ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
| 194 | at ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
[143] | 195 |
|
---|
[589] | 196 | at ROMVARS.ideVars2+IDEVARS.wBasePort, dw DEVICE_ATA_TERTIARY_PORT
|
---|
| 197 | at ROMVARS.ideVars2+IDEVARS.wControlBlockPort, dw DEVICE_ATA_TERTIARY_PORTCTRL
|
---|
| 198 | at ROMVARS.ideVars2+IDEVARS.bDevice, db DEVICE_16BIT_ATA
|
---|
[447] | 199 | at ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
| 200 | at ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
[143] | 201 |
|
---|
[589] | 202 | at ROMVARS.ideVars3+IDEVARS.wBasePort, dw DEVICE_ATA_QUATERNARY_PORT
|
---|
| 203 | at ROMVARS.ideVars3+IDEVARS.wControlBlockPort, dw DEVICE_ATA_QUATERNARY_PORTCTRL
|
---|
| 204 | at ROMVARS.ideVars3+IDEVARS.bDevice, db DEVICE_16BIT_ATA
|
---|
[447] | 205 | at ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
| 206 | at ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE | (TRANSLATEMODE_AUTO<<TRANSLATEMODE_FIELD_POSITION)
|
---|
[175] | 207 |
|
---|
| 208 | %ifdef MODULE_SERIAL
|
---|
[589] | 209 | at ROMVARS.ideVarsSerialAuto+IDEVARS.bDevice, db DEVICE_SERIAL_PORT
|
---|
[3] | 210 | %endif
|
---|
[181] | 211 | %endif
|
---|
[3] | 212 | iend
|
---|
| 213 |
|
---|
[380] | 214 | ; Strings are first to avoid them moving unnecessarily when code is turned on and off with %ifdef's
|
---|
[334] | 215 | ; since some groups of strings need to be on the same 256-byte page.
|
---|
| 216 | ;
|
---|
| 217 | %ifdef MODULE_STRINGS_COMPRESSED
|
---|
| 218 | %define STRINGSCOMPRESSED_STRINGS
|
---|
[380] | 219 | %include "StringsCompressed.asm"
|
---|
[334] | 220 | %else
|
---|
| 221 | %include "Strings.asm" ; For BIOS message strings
|
---|
| 222 | %endif
|
---|
| 223 |
|
---|
[248] | 224 | ; Libraries, data, Initialization and drive detection
|
---|
[334] | 225 |
|
---|
[181] | 226 | %include "AssemblyLibrary.asm"
|
---|
[605] | 227 | %ifdef MODULE_WIN9X_CMOS_HACK
|
---|
[593] | 228 | %include "CMOS.asm" ; This belongs in the Assembly Library
|
---|
| 229 | %endif
|
---|
[334] | 230 |
|
---|
| 231 | ; String compression tables need to come after the AssemblyLibrary (since they depend on addresses
|
---|
[380] | 232 | ; established in the assembly library), and are unnecessary if strings are not compressed.
|
---|
[334] | 233 | ;
|
---|
| 234 | %ifdef MODULE_STRINGS_COMPRESSED
|
---|
[380] | 235 | %undef STRINGSCOMPRESSED_STRINGS
|
---|
[334] | 236 | %define STRINGSCOMPRESSED_TABLES
|
---|
| 237 | %include "StringsCompressed.asm"
|
---|
| 238 | %endif
|
---|
[380] | 239 |
|
---|
[248] | 240 | %include "Initialize.asm" ; For BIOS initialization
|
---|
| 241 | %include "Interrupts.asm" ; For Interrupt initialization
|
---|
| 242 | %include "RamVars.asm" ; For RAMVARS initialization and access
|
---|
[399] | 243 | %include "BootVars.asm" ; For initializing variables used during init and boot
|
---|
[392] | 244 | %include "FloppyDrive.asm" ; Floppy Drive related functions
|
---|
[285] | 245 | %include "CreateDPT.asm" ; For creating DPTs
|
---|
| 246 | %include "FindDPT.asm" ; For finding DPTs
|
---|
[181] | 247 | %include "AccessDPT.asm" ; For accessing DPTs
|
---|
[421] | 248 | %include "AtaGeometry.asm" ; For generating L-CHS parameters
|
---|
[397] | 249 | %include "DrvDetectInfo.asm" ; For creating DRVDETECTINFO structs
|
---|
[181] | 250 | %include "AtaID.asm" ; For ATA Identify Device information
|
---|
| 251 | %include "DetectDrives.asm" ; For detecting IDE drives
|
---|
| 252 | %include "DetectPrint.asm" ; For printing drive detection strings
|
---|
[550] | 253 | %ifdef MODULE_COMPATIBLE_TABLES
|
---|
| 254 | %include "CompatibleDPT.asm"
|
---|
| 255 | %endif
|
---|
[395] | 256 |
|
---|
| 257 | ; Hotkey Bar
|
---|
| 258 | %ifdef MODULE_HOTKEYS
|
---|
[392] | 259 | %include "HotkeyBar.asm" ; For hotkeys during drive detection and boot menu
|
---|
[526] | 260 | %endif
|
---|
[492] | 261 | %ifdef MODULE_DRIVEXLATE
|
---|
| 262 | %include "DriveXlate.asm" ; For swapping drive numbers, must come immediately after HotkeyBar.asm
|
---|
[395] | 263 | %endif
|
---|
[248] | 264 |
|
---|
[181] | 265 | ; Boot menu
|
---|
[379] | 266 | %ifdef MODULE_BOOT_MENU
|
---|
[181] | 267 | %include "BootMenu.asm" ; For Boot Menu operations
|
---|
| 268 | %include "BootMenuEvent.asm" ; For menu library event handling
|
---|
[192] | 269 | ; NOTE: BootMenuPrint needs to come immediately after BootMenuEvent
|
---|
[258] | 270 | ; so that jump table entries in BootMenuEvent stay within 8-bits
|
---|
| 271 | %include "BootMenuPrint.asm" ; For printing Boot Menu strings, also includes "BootMenuPrintCfg.asm"
|
---|
[379] | 272 | %endif
|
---|
| 273 |
|
---|
| 274 | ; Boot loader
|
---|
[567] | 275 | %ifdef MODULE_VERY_LATE_INIT
|
---|
[560] | 276 | %include "Int13hBiosInit.asm"
|
---|
| 277 | %endif
|
---|
[379] | 278 | %include "Int19h.asm" ; For Int 19h, Boot Loader
|
---|
[492] | 279 | %include "BootSector.asm" ; For loading boot sector
|
---|
[392] | 280 | %include "Int19hReset.asm" ; INT 19h handler for proper system reset
|
---|
[3] | 281 |
|
---|
[181] | 282 | ; For all device types
|
---|
[192] | 283 | %include "Idepack.asm"
|
---|
[181] | 284 | %include "Device.asm"
|
---|
| 285 | %include "Timer.asm" ; For timeout and delay
|
---|
[155] | 286 |
|
---|
[181] | 287 | ; IDE Device support
|
---|
[363] | 288 | %ifdef MODULE_ADVANCED_ATA
|
---|
| 289 | %include "AdvAtaInit.asm" ; For initializing VLB and PCI controllers
|
---|
| 290 | %include "Vision.asm" ; QDI Vision QD6500 and QD6580 support
|
---|
[587] | 291 | %include "PDC20x30.asm" ; Promise PDC 20230-C and 20630 support
|
---|
[363] | 292 | %endif
|
---|
[181] | 293 | %include "IdeCommand.asm"
|
---|
[493] | 294 | %ifdef MODULE_8BIT_IDE_ADVANCED
|
---|
[400] | 295 | %include "JrIdeTransfer.asm" ; Must be included after IdeCommand.asm
|
---|
[480] | 296 | %include "IdeDmaBlock.asm"
|
---|
[400] | 297 | %endif
|
---|
| 298 | %include "IdeTransfer.asm"
|
---|
[473] | 299 | %include "IdePioBlock.asm"
|
---|
[192] | 300 | %include "IdeWait.asm"
|
---|
[294] | 301 | %include "IdeError.asm" ; Must be included after IdeWait.asm
|
---|
[181] | 302 | %include "IdeDPT.asm"
|
---|
| 303 | %include "IdeIO.asm"
|
---|
[398] | 304 | %ifdef MODULE_IRQ
|
---|
[181] | 305 | %include "IdeIrq.asm"
|
---|
[398] | 306 | %endif
|
---|
[155] | 307 |
|
---|
[400] | 308 | ; Serial Device support
|
---|
[181] | 309 | %ifdef MODULE_SERIAL ; Serial Port Device support
|
---|
| 310 | %include "SerialCommand.asm"
|
---|
| 311 | %include "SerialDPT.asm"
|
---|
[175] | 312 | %endif
|
---|
[155] | 313 |
|
---|
[181] | 314 | ; INT 13h Hard Disk BIOS functions
|
---|
[594] | 315 | %ifdef MODULE_MFM_COMPATIBILITY
|
---|
| 316 | %include "Int13hMFMcompatibility.asm"
|
---|
| 317 | %endif
|
---|
[181] | 318 | %include "Int13h.asm" ; For Int 13h, Disk functions
|
---|
[529] | 319 | %include "AH0h_HReset.asm"
|
---|
| 320 | %include "AH1h_HStatus.asm"
|
---|
| 321 | %include "AH2h_HRead.asm"
|
---|
| 322 | %include "AH3h_HWrite.asm"
|
---|
| 323 | %include "AH4h_HVerify.asm"
|
---|
| 324 | %include "AH8h_HParams.asm"
|
---|
| 325 | %include "AH9h_HInit.asm"
|
---|
| 326 | %include "AHCh_HSeek.asm"
|
---|
| 327 | %include "AH10h_HReady.asm"
|
---|
| 328 | %include "AH11h_HRecal.asm"
|
---|
| 329 | %include "AH15h_HSize.asm"
|
---|
[493] | 330 | %ifdef MODULE_8BIT_IDE_ADVANCED
|
---|
[471] | 331 | %include "AH1Eh_XTCF.asm"
|
---|
| 332 | %endif
|
---|
[529] | 333 | %include "AH23h_HFeatures.asm"
|
---|
| 334 | %include "AH24h_HSetBlocks.asm"
|
---|
| 335 | %include "AH25h_HDrvID.asm"
|
---|
[221] | 336 | %include "Address.asm" ; For sector address translations
|
---|
| 337 | %include "Prepare.asm" ; For buffer pointer normalization
|
---|
[176] | 338 | %ifdef MODULE_EBIOS
|
---|
[181] | 339 | %include "AH42h_ExtendedReadSectors.asm"
|
---|
| 340 | %include "AH43h_ExtendedWriteSectors.asm"
|
---|
| 341 | %include "AH44h_ExtendedVerifySectors.asm"
|
---|
| 342 | %include "AH47h_ExtendedSeek.asm"
|
---|
| 343 | %include "AH48h_GetExtendedDriveParameters.asm"
|
---|
[221] | 344 | %include "AH41h_CheckIfExtensionsPresent.asm"
|
---|
[176] | 345 | %endif
|
---|
[589] | 346 |
|
---|
| 347 |
|
---|
[592] | 348 | %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
|
---|
[589] | 349 | ; Although it's very unlikely to happen, we give warnings for builds that cannot be automatically checksummed due to the size being too large.
|
---|
| 350 | ; In some cases it's theoretically possible to checksum the build anyway (manually) which is why these are warnings and not errors.
|
---|
| 351 | %if BIOS_SIZE = 8192 ; A small build, possibly a candidate for the ROM socket on a 3Com 3C503 card.
|
---|
| 352 | %if ($-$$) <= BIOS_SIZE ; Only give warnings when the problem isn't obvious anyway.
|
---|
| 353 | %if ($-$$) > BIOS_SIZE - 3
|
---|
| 354 | %warning "This build is too large to be auto-checksummed!"
|
---|
| 355 | %endif
|
---|
| 356 | %endif
|
---|
[592] | 357 | %elif ($-$$) = BIOS_SIZE ; A large or tiny build.
|
---|
[589] | 358 | %warning "This build is too large to be auto-checksummed!"
|
---|
| 359 | %endif
|
---|
[592] | 360 | %endif
|
---|