Changeset 593 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS
- Timestamp:
- Jun 30, 2018, 8:27:04 AM (6 years ago)
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/ATA_ID.inc
r567 r593 56 56 PIO_6_MIN_ACTIVE_TIME_NS EQU 55 57 57 58 ; PIO Minimum Recovery Times or Inactive Times (t2i) can be calculated 59 ; from Minimum Cycle Time (t0) - Minimum Active Time (t2) - Address Valid Time (t1). 60 ; I'm not sure about this calculation so correct me if I'm wrong! 61 ; Recovery time should be calculated at run time since Cycle Time t0 can be 62 ; read from ATA information (ATA2+) but most drives just report the 63 ; Min Cycle Times listed above. 64 58 ; PIO 0...2 Maximum Addr valid to IOCS16- released (t8) 59 PIO_0_MAX_ADDR_VALID_TO_IOCS16_RELEASED EQU 60 60 PIO_1_MAX_ADDR_VALID_TO_IOCS16_RELEASED EQU 45 61 PIO_2_MAX_ADDR_VALID_TO_IOCS16_RELEASED EQU 30 62 63 ; PIO DIOR-/DIOW- to address valid hold (t9) 64 PIO_0_DIORW_TO_ADDR_VALID_HOLD EQU 20 65 PIO_1_DIORW_TO_ADDR_VALID_HOLD EQU 15 66 PIO_2_DIORW_TO_ADDR_VALID_HOLD EQU 10 65 67 66 68 -
trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
r592 r593 29 29 BOOT_READ_RETRY_TIMES EQU 3 30 30 31 ; Pre-boot variables. These do not exist after successful boot to OS.32 ; Segment is always 0000h, same as BDA segment33 struc BOOTVARS34 resb 7C00h35 .rgbAtaInfo: ; 7C00h, ATA Information for drive detection36 .rgbBootSect resb 512 ; 7C00h, Boot sector37 resb 256 ; Boot Menu stack38 .rgbMnuStack:39 .dwPostStack resb 4 ; POST stack pointer when entering INT 19h40 %ifdef MODULE_HOTKEYS41 .hotkeyVars resb HOTKEYVARS_size42 %endif43 .rgDrvDetectInfo: ; Array containing DRVDETECTINFO structs44 endstruc45 46 31 47 32 %ifdef MODULE_HOTKEYS … … 66 51 67 52 %endif ; MODULE_HOTKEYS 53 54 55 ; Pre-boot variables. These do not exist after successful boot to OS. 56 ; Segment is always 0000h, same as BDA segment 57 struc BOOTVARS 58 resb 7C00h 59 .rgbAtaInfo: ; 7C00h, ATA Information for drive detection 60 .rgbBootSect resb 512 ; 7C00h, Boot sector 61 resb 256 ; Boot Menu stack 62 .rgbMnuStack: 63 .dwPostStack resb 4 ; POST stack pointer when entering INT 19h 64 %ifdef MODULE_HOTKEYS 65 .hotkeyVars resb HOTKEYVARS_size ; Must be located just before DRVDETECTINFO structs 66 %endif 67 .rgDrvDetectInfo: ; Array containing DRVDETECTINFO structs 68 endstruc 69 68 70 69 71 ; MAX_HARD_DISK_NAME_LENGTH must be defined ahead of the DRVDETECTINFO structure to avoid problems with NASM -
trunk/XTIDE_Universal_BIOS/Inc/HotkeyBar.inc
r528 r593 23 23 MIN_TIME_TO_DISPLAY_HOTKEY_BAR EQU (4000/55) ; 4000 ms 24 24 25 FIRST_FUNCTION_KEY_SCANCODE EQU 3Bh ; F1 key 26 25 27 ROM_BOOT_HOTKEY_SCANCODE EQU 42h ; F8 26 28 -
trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc
r589 r593 29 29 %ifdef MODULE_SERIAL_FLOPPY OR MODULE_DRIVEXLATE 30 30 %define NEED_XLATEVARS 31 %endif 32 33 34 %ifdef NEED_XLATEVARS 35 ; Variables for translating drive numbers. 36 struc XLATEVARS 37 %ifdef MODULE_SERIAL_FLOPPY 38 .bFlopCreateCnt: 39 .bFlopCntAndFirst resb 1 ; Normally, packed starting floppy drive number (high order 7 bits) 40 ; and number of drives (low order bit, max 2 drives supported). 41 ; During initialization, until the end of DetectDrives_FromAllIDEControllers, 42 ; this byte contains the raw number of floppy drives seen 43 ; (using .bFlopCreateCnt) 44 %else 45 resb 1 ; alignment 46 %endif 47 48 %ifdef MODULE_DRIVEXLATE 49 .bXlatedDrv resb 1 ; Drive number after translation 50 .wFDandHDswap: 51 .bFDSwap resb 1 ; Floppy Drive to swap to 00h and vice versa 52 .bHDSwap resb 1 ; Hard Drive to swap to 80h and vice versa 53 %else 54 resb 1 ; alignment 55 %endif 56 endstruc 31 57 %endif 32 58 … … 66 92 RAMVARS_DRV_DETECT_SIGNATURE EQU 5A5Ah ; Signature when BIOS is in drive detection mode 67 93 68 69 %ifdef NEED_XLATEVARS70 ; Variables for translating drive numbers.71 struc XLATEVARS72 %ifdef MODULE_SERIAL_FLOPPY73 .bFlopCreateCnt:74 .bFlopCntAndFirst resb 1 ; Normally, packed starting floppy drive number (high order 7 bits)75 ; and number of drives (low order bit, max 2 drives supported).76 ; During initialization, until the end of DetectDrives_FromAllIDEControllers,77 ; this byte contains the raw number of floppy drives seen78 ; (using .bFlopCreateCnt)79 %else80 resb 1 ; alignment81 %endif82 83 %ifdef MODULE_DRIVEXLATE84 .bXlatedDrv resb 1 ; Drive number after translation85 .wFDandHDswap:86 .bFDSwap resb 1 ; Floppy Drive to swap to 00h and vice versa87 .bHDSwap resb 1 ; Hard Drive to swap to 80h and vice versa88 %else89 resb 1 ; alignment90 %endif91 endstruc92 %endif93 94 94 95 %ifdef MODULE_SERIAL_FLOPPY -
trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
r592 r593 22 22 %define ROMVARS_INC 23 23 24 ; ROM Variables. Written to the ROM image before flashing. 25 struc ROMVARS 26 .wRomSign resb 2 ; ROM Signature (AA55h) 27 .bRomSize resb 1 ; ROM size in 512 byte blocks 28 .rgbJump resb 3 ; First instruction to ROM init (jmp) 29 30 .rgbSign resb 8 ; Signature for XTIDE Configurator Program 31 .szTitle resb 31 ; BIOS title string 32 .szVersion resb 25 ; BIOS version string 33 34 .wFlags resb 2 ; Word for ROM flags 35 .wDisplayMode resb 2 ; Display mode for boot menu 36 .wBootTimeout resb 2 ; Boot Menu selection timeout in system timer ticks 37 .pColorTheme resb 2 ; Ptr to the color attribute struc used by the boot menu and hotkey bar 38 .bIdeCnt resb 1 ; Number of available IDE controllers 39 .bBootDrv resb 1 ; Default drive to boot from 40 .bMinFddCnt resb 1 ; Minimum number of Floppy Drives 41 .bStealSize resb 1 ; Number of 1kB blocks stolen from 640kB base RAM 42 .bIdleTimeout resb 1 ; Standby timer value 43 44 .ideVarsBegin: 45 .ideVars0 resb IDEVARS_size 46 .ideVars1 resb IDEVARS_size 47 .ideVars2 resb IDEVARS_size 48 .ideVars3 resb IDEVARS_size 49 50 %ifdef MODULE_SERIAL 51 .ideVarsSerialAuto resb IDEVARS_size 52 %endif 53 54 .ideVarsEnd: 24 25 ; Master/Slave drive specific parameters 26 struc DRVPARAMS 27 .wFlags resb 2 ; Drive flags 28 .dwMaximumLBA: ; User specified maximum number of sectors 29 .wCylinders resb 2 ; User specified cylinders (1...16383) 30 .wHeadsAndSectors: 31 .bHeads resb 1 ; User specified Heads (1...16) 32 .bSect resb 1 ; User specified Sectors per track (1...63) 55 33 endstruc 56 34 57 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 58 %if ROMVARS.ideVarsEnd & 0xff00 <> 0 59 %error ".ideVars structures must fit within the first 256 bytes of the ROM image" 60 %endif 61 %if (ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) = 0 62 %error "there must be at least one .ideVars structure, it would be bizarre if this were not true, but it is assumed in the ah0h reset code." 63 %endif 64 %endif 65 66 NUMBER_OF_IDEVARS EQU ((ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) / IDEVARS_size) 67 68 ; Bit defines for ROMVARS.wFlags 69 FLG_ROMVARS_FULLMODE EQU (1<<0) ; Full operating mode (steals base RAM, supports EBIOS etc.) 70 FLG_ROMVARS_SERIAL_SCANDETECT EQU (1<<3) ; Scan COM ports at the end of drive detection. Can also be invoked 71 ; by holding down the ALT key at the end of drive detection. 72 ; (Conveniently, this is 8, a fact we exploit when testing the bit) 73 74 ; Here in case the configuration needs to know functionality is present. Note! Changing the order/location of these flags 75 ; also requires changes elsewhere as they are usually tested using byte-accesses for efficiency. 76 FLG_ROMVARS_MODULE_POWER_MANAGEMENT EQU (1<<5) 77 FLG_ROMVARS_MODULE_8BIT_IDE EQU (1<<6) 78 FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED EQU (1<<7) 79 FLG_ROMVARS_MODULE_ADVANCED_ATA EQU (1<<8) 80 FLG_ROMVARS_MODULE_BOOT_MENU EQU (1<<9) 81 FLG_ROMVARS_MODULE_EBIOS EQU (1<<10) 82 FLG_ROMVARS_MODULE_HOTKEYS EQU (1<<11) 83 FLG_ROMVARS_MODULE_IRQ EQU (1<<12) 84 FLG_ROMVARS_MODULE_SERIAL EQU (1<<13) 85 FLG_ROMVARS_MODULE_SERIAL_FLOPPY EQU (1<<14) 86 FLG_ROMVARS_MODULE_STRINGS_COMPRESSED EQU (1<<15) 87 88 89 ; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes) 90 DEFAULT_TEXT_MODE EQU 4 35 ; Bit defines for DRVPARAMS.wFlags - these flags are accessed as bytes so changes here might require changes elsewhere 36 MASK_DRVPARAMS_WRITECACHE EQU (3<<0) ; Bits 0...1, Drive internal write cache settings (must start at bit 0) 37 DEFAULT_WRITE_CACHE EQU 0 ; Must be 0 38 DISABLE_WRITE_CACHE EQU 1 39 ENABLE_WRITE_CACHE EQU 2 40 MASK_DRVPARAMS_TRANSLATEMODE EQU (3<<TRANSLATEMODE_FIELD_POSITION) ; Bits 2...3, Position shared with DPT 41 TRANSLATEMODE_FIELD_POSITION EQU 2 42 TRANSLATEMODE_NORMAL EQU 0 ; Must be zero 43 TRANSLATEMODE_LARGE EQU 1 44 TRANSLATEMODE_ASSISTED_LBA EQU 2 ; 28-bit or 48-bit LBA 45 TRANSLATEMODE_AUTO EQU 3 ; Only available in ROMVARS, not in DPTs 46 FLG_DRVPARAMS_BLOCKMODE EQU (1<<4) ; Enable Block mode transfers 47 FLG_DRVPARAMS_USERCHS EQU (1<<5) ; User specified P-CHS values 48 MAX_PCHS_CYLINDERS EQU 16383 49 MAX_PCHS_HEADS EQU 16 50 MAX_PCHS_SECTORS_PER_TRACK EQU 63 51 MAX_PCHS_TOTAL_SECTOR_COUNT EQU (MAX_PCHS_CYLINDERS * MAX_PCHS_HEADS * MAX_PCHS_SECTORS_PER_TRACK) ; 16,514,064 52 FLG_DRVPARAMS_USERLBA EQU (1<<6) ; User specified LBA value 91 53 92 54 … … 173 135 XTCF_DEVICE_OFFSET EQU FIRST_XTCF_DEVICE ; Used for XT-CF device <--> mode conversion 174 136 175 ; Master/Slave drive specific parameters 176 struc DRVPARAMS 177 .wFlags resb 2 ; Drive flags 178 .dwMaximumLBA: ; User specified maximum number of sectors 179 .wCylinders resb 2 ; User specified cylinders (1...16383) 180 .wHeadsAndSectors: 181 .bHeads resb 1 ; User specified Heads (1...16) 182 .bSect resb 1 ; User specified Sectors per track (1...63) 137 138 ; ROM Variables. Written to the ROM image before flashing. 139 struc ROMVARS 140 .wRomSign resb 2 ; ROM Signature (AA55h) 141 .bRomSize resb 1 ; ROM size in 512 byte blocks 142 .rgbJump resb 3 ; First instruction to ROM init (jmp) 143 144 .rgbSign resb 8 ; Signature for XTIDE Configurator Program 145 .szTitle resb 31 ; BIOS title string 146 .szVersion resb 25 ; BIOS version string 147 148 .wFlags resb 2 ; Word for ROM flags 149 .wDisplayMode resb 2 ; Display mode for boot menu 150 .wBootTimeout resb 2 ; Boot Menu selection timeout in system timer ticks 151 .pColorTheme resb 2 ; Ptr to the color attribute struc used by the boot menu and hotkey bar 152 .bIdeCnt resb 1 ; Number of available IDE controllers 153 .bBootDrv resb 1 ; Default drive to boot from 154 .bMinFddCnt resb 1 ; Minimum number of Floppy Drives 155 .bStealSize resb 1 ; Number of 1kB blocks stolen from 640kB base RAM 156 .bIdleTimeout resb 1 ; Standby timer value 157 158 .ideVarsBegin: 159 .ideVars0 resb IDEVARS_size 160 .ideVars1 resb IDEVARS_size 161 .ideVars2 resb IDEVARS_size 162 .ideVars3 resb IDEVARS_size 163 164 %ifdef MODULE_SERIAL 165 .ideVarsSerialAuto resb IDEVARS_size 166 %endif 167 168 .ideVarsEnd: 183 169 endstruc 184 170 185 ; Bit defines for DRVPARAMS.wFlags - these flags are accessed as bytes so changes here might require changes elsewhere 186 MASK_DRVPARAMS_WRITECACHE EQU (3<<0) ; Bits 0...1, Drive internal write cache settings (must start at bit 0) 187 DEFAULT_WRITE_CACHE EQU 0 ; Must be 0 188 DISABLE_WRITE_CACHE EQU 1 189 ENABLE_WRITE_CACHE EQU 2 190 MASK_DRVPARAMS_TRANSLATEMODE EQU (3<<TRANSLATEMODE_FIELD_POSITION) ; Bits 2...3, Position shared with DPT 191 TRANSLATEMODE_FIELD_POSITION EQU 2 192 TRANSLATEMODE_NORMAL EQU 0 ; Must be zero 193 TRANSLATEMODE_LARGE EQU 1 194 TRANSLATEMODE_ASSISTED_LBA EQU 2 ; 28-bit or 48-bit LBA 195 TRANSLATEMODE_AUTO EQU 3 ; Only available in ROMVARS, not in DPTs 196 FLG_DRVPARAMS_BLOCKMODE EQU (1<<4) ; Enable Block mode transfers 197 FLG_DRVPARAMS_USERCHS EQU (1<<5) ; User specified P-CHS values 198 MAX_PCHS_CYLINDERS EQU 16383 199 MAX_PCHS_HEADS EQU 16 200 MAX_PCHS_SECTORS_PER_TRACK EQU 63 201 MAX_PCHS_TOTAL_SECTOR_COUNT EQU (MAX_PCHS_CYLINDERS * MAX_PCHS_HEADS * MAX_PCHS_SECTORS_PER_TRACK) ; 16,514,064 202 FLG_DRVPARAMS_USERLBA EQU (1<<6) ; User specified LBA value 171 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 172 %if ROMVARS.ideVarsEnd & 0xff00 <> 0 173 %error ".ideVars structures must fit within the first 256 bytes of the ROM image" 174 %endif 175 %if (ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) = 0 176 %error "there must be at least one .ideVars structure, it would be bizarre if this were not true, but it is assumed in the ah0h reset code." 177 %endif 178 %endif 179 180 NUMBER_OF_IDEVARS EQU ((ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) / IDEVARS_size) 181 182 ; Bit defines for ROMVARS.wFlags 183 FLG_ROMVARS_FULLMODE EQU (1<<0) ; Full operating mode (steals base RAM, supports EBIOS etc.) 184 FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES EQU (1<<1) ; Ignores drives configured in motherboard BIOS setup. 185 ; For now it is a hack to get Windows 95 IDE drivers working 186 ; but it will be needed later when XTUB supports dynamic drive overlay. 187 ; Because of that this must be included into AT builds and cannot be a 188 ; module (any AT or 386 must be installable to the hard drive so 189 ; there won't be need for even more different builds). 190 FLG_ROMVARS_SERIAL_SCANDETECT EQU (1<<3) ; Scan COM ports at the end of drive detection. Can also be invoked 191 ; by holding down the ALT key at the end of drive detection. 192 ; (Conveniently, this is 8, a fact we exploit when testing the bit) 193 194 ; Here in case the configuration needs to know functionality is present. Note! Changing the order/location of these flags 195 ; also requires changes elsewhere as they are usually tested using byte-accesses for efficiency. 196 FLG_ROMVARS_MODULE_POWER_MANAGEMENT EQU (1<<5) 197 FLG_ROMVARS_MODULE_8BIT_IDE EQU (1<<6) 198 FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED EQU (1<<7) 199 FLG_ROMVARS_MODULE_ADVANCED_ATA EQU (1<<8) 200 FLG_ROMVARS_MODULE_BOOT_MENU EQU (1<<9) 201 FLG_ROMVARS_MODULE_EBIOS EQU (1<<10) 202 FLG_ROMVARS_MODULE_HOTKEYS EQU (1<<11) 203 FLG_ROMVARS_MODULE_IRQ EQU (1<<12) 204 FLG_ROMVARS_MODULE_SERIAL EQU (1<<13) 205 FLG_ROMVARS_MODULE_SERIAL_FLOPPY EQU (1<<14) 206 FLG_ROMVARS_MODULE_STRINGS_COMPRESSED EQU (1<<15) 207 208 209 ; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes) 210 DEFAULT_TEXT_MODE EQU 4 211 203 212 204 213 %endif ; ROMVARS_INC -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r592 r593 90 90 ;-------------------------------------------------------------------- 91 91 .InitializeBiosAndDetectDrives: 92 %ifdef MODULE_HOTKEYS93 call TimerTicks_ReadFromBdaToAX94 mov [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wTimeWhenDisplayed], ax95 %endif96 97 92 call Initialize_AndDetectDrives 98 93 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r592 r593 33 33 ; Cleared if no controller 34 34 ; Corrupts registers: 35 ; BX 35 ; BX, CX 36 36 ;-------------------------------------------------------------------- 37 37 AdvAtaInit_DetectControllerForIdeBaseInBX: 38 ; Detect if system has PCI bus. If it does, we can skip VLB detection. This is 39 ; good thing since detecting Vision QD6850 is dangerous since Intel PIIX4 south bridge 40 ; mirrors Interrupt Controller registers from Axh to Bxh. This can lead to faulty 41 ; detection of QD6850 that will eventually crash the system when ports are written. 42 43 ; We should save the 32-bit registers but we don't since system BIOS has stored 44 ; them already and we don't use the 32-bit registers ourselves anywhere at the moment. 45 push bx 46 push di 47 xor edi, edi ; Some BIOSes require this to be set to zero 48 mov ax, PCI_INSTALLATION_CHECK 49 int BIOS_TIME_PCI_PNP_1Ah 50 pop di 51 pop bx 52 test ah, ah 53 jz SHORT .ThisSystemHasPCIbus 54 55 ; Detect VLB controllers 38 56 call Vision_DetectAndReturnIDinAXandPortInDXifControllerPresent 39 57 jnz SHORT .NoVisionControllerFound … … 51 69 52 70 .NoAdvancedControllerForPortBX: 71 .ThisSystemHasPCIbus: 53 72 xor ax, ax ; Clear ID in AX and CF 54 73 ret -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/Vision.asm
r592 r593 41 41 in al, QD65XX_BASE_PORT + QD65XX_CONFIG_REGISTER_in 42 42 43 %ifdef DANGEROUS_DETECTION44 ; Checking alternative base port is currently commented away45 ; since Intel PIIX4 south bridge mirrors Interrupt Controller registers46 ; from Axh to Bxh.47 43 call IsConfigRegisterWithIDinAL 48 44 je SHORT VisionControllerDetected.Return … … 51 47 mov dl, QD65XX_ALTERNATIVE_BASE_PORT 52 48 in al, QD65XX_ALTERNATIVE_BASE_PORT + QD65XX_CONFIG_REGISTER_in 53 %endif ; DANGEROUS_DETECTION54 49 ; Fall to IsConfigRegisterWithIDinAL 55 50 … … 198 193 199 194 ; Calculate Recovery Time value for QD65xx IDE Timing Register 200 call AtaID_GetRecoveryTimeToAXfromPioModeInBXandCycleTimeInCX 195 xchg ax, cx 196 eMOVZX cx, BYTE [cs:bx+.rgbToSubtractFromCycleTimeBasedOnPIOmode] 197 sub ax, cx 201 198 mov bx, bp ; Active Time value now in BL 202 199 mov bp, QD65xx_MAX_RECOVERY_TIME_CLOCKS | (QD65xx_MIN_RECOVERY_TIME_CLOCKS << 8) … … 209 206 ret ; Return with CF cleared 210 207 208 .rgbToSubtractFromCycleTimeBasedOnPIOmode: 209 ; For PIO 0 to 2 this method (t0 - (t1+t8+t9)) seems to give closest (little less) values to the fixed preset 210 ; values used by QDI6580 DOS driver v3.7 211 db (PIO_0_MIN_ADDRESS_VALID_NS + PIO_0_MAX_ADDR_VALID_TO_IOCS16_RELEASED + PIO_0_DIORW_TO_ADDR_VALID_HOLD) 212 db (PIO_1_MIN_ADDRESS_VALID_NS + PIO_1_MAX_ADDR_VALID_TO_IOCS16_RELEASED + PIO_1_DIORW_TO_ADDR_VALID_HOLD) 213 db (PIO_2_MIN_ADDRESS_VALID_NS + PIO_2_MAX_ADDR_VALID_TO_IOCS16_RELEASED + PIO_2_DIORW_TO_ADDR_VALID_HOLD) 214 db 102 ; QDI6580 DOS driver v3.7 uses fixed values for PIO 3... 215 db 61 ; ...and PIO 4. No idea where these values come from. 216 db (PIO_5_MIN_CYCLE_TIME_NS / 2) ; PIO 5 and 6 were not available when QD6850 was released. Use values... 217 db (PIO_6_MIN_CYCLE_TIME_NS / 2) ; ...that resembles those used for PIO 4 218 211 219 212 220 ;-------------------------------------------------------------------- … … 226 234 227 235 ; Get VLB Cycle Time in nanosecs 228 mov cl, VLB_33MHZ_CYCLE_TIME ; Assume 33 MHz or slower VLB bus 236 mov cl, VLB_33MHZ_CYCLE_TIME ; Assume 33 MHz or slower VLB bus (30 ns) 229 237 test BYTE [di+DPT_ADVANCED_ATA.wControllerID], FLG_QDCONFIG_ID3 230 eCMOVZ cl, VLB_40MHZ_CYCLE_TIME 238 eCMOVZ cl, VLB_40MHZ_CYCLE_TIME ; (25 ns) 231 239 232 240 ; Convert value in AX to VLB ticks -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r592 r593 211 211 212 212 ;-------------------------------------------------------------------- 213 ; AtaID_GetRecoveryTimeToAXfromPioModeInBXandCycleTimeInCX214 ; Parameters:215 ; BX: PIO Mode216 ; CX: PIO Cycle Time in nanosecs217 ; Returns:218 ; AX: Active Time in nanosecs219 ; Corrupts registers:220 ; BX, CX221 ;--------------------------------------------------------------------222 AtaID_GetRecoveryTimeToAXfromPioModeInBXandCycleTimeInCX:223 call AtaID_GetActiveTimeToAXfromPioModeInBX224 mov bl, [cs:bx+.rgbPioModeToAddressValidTimeNs]225 sub cx, bx ; Cycle Time (t0) - Address Valid Time (t1)226 sub cx, ax ; - Active Time (t2)227 xchg ax, cx ; AX = Recovery Time (t2i)228 ret229 230 .rgbPioModeToAddressValidTimeNs:231 db PIO_0_MIN_ADDRESS_VALID_NS232 db PIO_1_MIN_ADDRESS_VALID_NS233 db PIO_2_MIN_ADDRESS_VALID_NS234 db PIO_3_MIN_ADDRESS_VALID_NS235 db PIO_4_MIN_ADDRESS_VALID_NS236 db PIO_5_MIN_ADDRESS_VALID_NS237 db PIO_6_MIN_ADDRESS_VALID_NS238 239 240 ;--------------------------------------------------------------------241 213 ; AtaID_GetActiveTimeToAXfromPioModeInBX 242 214 ; Parameters: -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r589 r593 95 95 ; FindDPT_ForDriveNumber will not find any drives that are ours. 96 96 ; 97 98 ; Here we might want to replace BIOS configured drives with the ones we detected. 99 ; Primary reason is to support dynamic overlay feature in the future. Second reason 100 ; is a hack to get Windows 95 load proper IDE drivers. 101 ; 102 ; The Windows hack has two parts. First part is to try to alter CMOS address 12h as that 103 ; is what Windows 95 driver reads to detect IDE drives. Altering is not possible on all 104 ; systems since CMOS has a checksum but it's location is not standardized. We will first 105 ; try to detect valid checksum. If it succeeds, then it is safe to assume this system 106 ; has compatible CMOS and we can alter it. 107 ; If verify fails, we do the more dirty hack to zero BDA drive count. Then Windows 95 works 108 ; as long as user has configured at least one drive in the BIOS setup. 109 110 %ifdef USE_AT ; FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES is for AT builds only 111 112 %ifdef MODULE_WIN95_CMOS_HACK 113 mov dl, HARD_DISK_TYPES 114 call CMOS_ReadFromIndexInDLtoAL 115 test al, al 116 jnz SHORT .ContinueInitialization ; CMOS byte 12h is ready for Windows 95 117 call CMOS_Verify10hTo2Dh 118 jnz SHORT .ClearBdaDriveCount ; Unsupported BIOS, use plan B 119 120 ; Now we can alter CMOS location 12h 121 mov dl, HARD_DISK_TYPES 122 mov al, 0F0h ; Drive 0 type 16...47 but Windows doesn't care as long as this is not zero 123 call CMOS_WriteALtoIndexInDL 124 call CMOS_StoreNewChecksumFor10hto2Dh 125 %endif 126 127 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES 128 jz SHORT .ContinueInitialization 129 .ClearBdaDriveCount: 130 mov BYTE [es:BDA.bHDCount], 0 ; Set hard disk count to zero 131 .ContinueInitialization: 132 %endif 133 97 134 mov cx, [RAMVARS.wDrvCntAndFlopCnt] ; Our count of hard disks 98 135 mov al, [es:BDA.bHDCount] -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r592 r593 77 77 ;---------------------------; 78 78 %ifdef USE_AT 79 %ifdef USE_386 80 at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES | MASK_ROMVARS_INCLUDED_MODULES 81 %else 79 82 at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | MASK_ROMVARS_INCLUDED_MODULES 83 %endif 80 84 at ROMVARS.wDisplayMode, dw DEFAULT_TEXT_MODE 81 85 %ifdef MODULE_BOOT_MENU … … 188 192 189 193 %include "AssemblyLibrary.asm" 194 %ifdef MODULE_WIN95_CMOS_HACK 195 %include "CMOS.asm" ; This belongs in the Assembly Library 196 %endif 190 197 191 198 ; String compression tables need to come after the AssemblyLibrary (since they depend on addresses -
trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm
r592 r593 75 75 mov cl, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFddLetter] 76 76 mov di, g_szFDD 77 78 ; Clear CH if floppy drive is selected for boot 79 mov ch, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags] 80 ;and ch, FLG_HOTKEY_HD_FIRST ; Needed if more flags are added 77 81 call FormatDriveHotkeyString 78 82 … … 92 96 call BootVars_GetLetterForFirstHardDriveToAX 93 97 mov ah, ANGLE_QUOTE_RIGHT 94 mov cl, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bHddLetter] 98 mov cx, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bHddLetter] ; Letter to CL, flags to CH 99 ;and ch, FLG_HOTKEY_HD_FIRST ; Needed if more flags are added 100 xor ch, FLG_HOTKEY_HD_FIRST ; Clear CH if HD is selected for boot, set otherwise 95 101 mov di, g_szHDD 96 102 call FormatDriveHotkeyString … … 182 188 ; FormatDriveHotkeyString 183 189 ; Parameters: 190 ; CH: Zero if letter in CL is selected for boot 184 191 ; CL: Drive letter hotkey from BOOTVARS 185 192 ; AL: First character for drive key string … … 192 199 ; AX, CX, DX, SI, DI 193 200 ;-------------------------------------------------------------------- 194 ;; No work to do before going into FormatFunctionHotkeyString 195 FormatDriveHotkeyString equ GetNonSelectedHotkeyDescriptionAttributeToDX 201 FormatDriveHotkeyString: 202 ; Invalid scancodes are filtered on HotkeyBar_StoreHotkeyToBootvarsIfValidKeystrokeInAX 203 ; so here we have either drive letter or function key pressed. If latter, draw 204 ; drive letters as unselected 205 cmp BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], FIRST_FUNCTION_KEY_SCANCODE 206 jae SHORT GetNonSelectedHotkeyDescriptionAttributeToDX 207 208 ; Drive selected to boot from? 209 test ch, ch 210 jnz SHORT GetNonSelectedHotkeyDescriptionAttributeToDX 211 jmp SHORT GetSelectedHotkeyDescriptionAttributeToDX 212 196 213 197 214 ;-------------------------------------------------------------------- … … 216 233 %ifdef MODULE_BOOT_MENU 217 234 235 GetSelectedHotkeyDescriptionAttributeToDX: 218 236 mov si, ATTRIBUTE_CHARS.cHurryTimeout ; Selected hotkey 219 je SHORT GetDescriptionAttributeToDX ; From compare with bScancode above 237 je SHORT GetDescriptionAttributeToDX ; From compare with bScancode above and from FormatDriveHotkeyString 220 238 221 239 GetNonSelectedHotkeyDescriptionAttributeToDX: … … 232 250 %else ; if no MODULE_BOOT_MENU - No boot menu so use simpler attributes 233 251 252 GetSelectedHotkeyDescriptionAttributeToDX: 234 253 mov dx, (COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_CYAN) << 8) | MONO_REVERSE_BLINK 235 je SHORT SelectAttributeFromDHorDLbasedOnVideoMode ; From compare with bScancode above 254 je SHORT SelectAttributeFromDHorDLbasedOnVideoMode ; From compare with bScancode above and from FormatDriveHotkeyString 236 255 237 256 GetNonSelectedHotkeyDescriptionAttributeToDX: -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
r589 r593 64 64 mov al, FLG_DEVCONTROL_nIEN ; Disable IRQ 65 65 .EnableDeviceIrq: 66 %else 66 %else ; ifndef MODULE_IRQ 67 67 mov al, FLG_DEVCONTROL_nIEN ; Disable IRQ 68 68 %endif ; MODULE_IRQ -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm
r547 r593 35 35 mov al, DRVDETECTINFO_size 36 36 mul BYTE [cs:ROMVARS.bIdeCnt] 37 mov di, BOOTVARS.rgDrvDetectInfo ; We must not initialize anything before this!38 37 xchg cx, ax 39 38 %ifndef MODULE_HOTKEYS 39 mov di, BOOTVARS.rgDrvDetectInfo ; We must not initialize anything before this! 40 40 jmp Memory_ZeroESDIwithSizeInCX 41 41 42 42 %else ; if MODULE_HOTKEYS 43 ; Also zero HOTKEYVARS located above DRVDETECTINFO structs 44 mov di, BOOTVARS.hotkeyVars 45 add cx, BYTE HOTKEYVARS_size 43 46 call Memory_ZeroESDIwithSizeInCX 47 48 ; Store time when hotkeybar is displayed 49 ; (it will be displayed after initialization is complete) 50 call TimerTicks_ReadFromBdaToAX 51 mov [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wTimeWhenDisplayed], ax 44 52 45 53 ; Initialize HOTKEYVARS by storing default drives to boot from -
trunk/XTIDE_Universal_BIOS/makefile
r592 r593 29 29 # MODULE_VERY_LATE_INIT Initialize on INT 13h if our INT 19h handler is not called # 30 30 # MODULE_POWER_MANAGEMENT Power Management support # 31 # MODULE_WIN95_CMOS_HACK Hack for Windows 95 compatibility # 31 32 # # 32 33 # Not modules but these affect the assembly: # … … 34 35 # RELOCATE_INT13H_STACK ** Relocates INT 13h stack to beginning of stolen conventional memory # 35 36 # RESERVE_DIAGNOSTIC_CYLINDER Reserve one L-CHS cylinder for compatibility with old BIOSes # 36 # DANGEROUS_DETECTION Scans Advanced Controllers from dangerous ports like mirrored PIC #37 37 # NO_ATAID_VALIDATION *** Excludes code that tries to ensure proper communication with drives # 38 38 # USE_186 Use instructions supported by 80188/80186 and V20/V30 and later # … … 41 41 # USE_AT Use features supported on AT and later systems (not available on XT) # 42 42 # USE_UNDOC_INTEL Optimizations for Intel CPU:s - do NOT use on NEC V20/V30/Sony CPU:s # 43 # USE_NEC_V Optimizations for use with NEC V20/V30 processors only # 43 44 # CLD_NEEDED Only needed for compatibility with buggy software/BIOSes # 44 45 # # … … 116 117 117 118 DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE NO_ATAID_VALIDATION CLD_NEEDED 118 DEFINES_386_8K = $(DEFINES_AT) USE_386 MODULE_ADVANCED_ATA 119 DEFINES_386 = $(DEFINES_AT) USE_386 MODULE_ADVANCED_ATA MODULE_WIN95_CMOS_HACK 120 DEFINES_386_LARGE = $(DEFINES_AT_LARGE) USE_386 MODULE_ADVANCED_ATA MODULE_WIN95_CMOS_HACK 119 121 120 122 DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_POWER_MANAGEMENT MODULE_COMPATIBLE_TABLES 121 DEFINES_ALL_FEATURES += ELIMINATE_CGA_SNOW RELOCATE_INT13H_STACK RESERVE_DIAGNOSTIC_CYLINDER 123 DEFINES_ALL_FEATURES += ELIMINATE_CGA_SNOW RELOCATE_INT13H_STACK RESERVE_DIAGNOSTIC_CYLINDER MODULE_WIN95_CMOS_HACK 122 124 123 125 … … 140 142 DEFS_AT_LARGE = $(DEFINES_AT_LARGE:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_LARGE) 141 143 DEFS_XT_TINY = $(DEFINES_XT_TINY:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_TINY) 142 DEFS_386_8K = $(DEFINES_386_8K:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_SMALL) 144 DEFS_386 = $(DEFINES_386:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_SMALL) 145 DEFS_386_LARGE = $(DEFINES_386_LARGE:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_LARGE) 143 146 DEFS_ALL_FEATURES = $(DEFINES_ALL_FEATURES:%=-D%) 144 147 … … 181 184 @echo All done! 182 185 183 small: xt_tiny xt xtplus at 386 _8k186 small: xt_tiny xt xtplus at 386 184 187 @echo All small binaries built! 185 188 186 large: xt_large xtplus_large at_large 189 large: xt_large xtplus_large at_large 386_large 187 190 @echo All large binaries built! 188 191 … … 215 218 @echo * Tiny XT version "$(TARGET)_tiny.bin" built. 216 219 217 386 _8k:218 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_386 _8K) -l"$(TARGET)_386.lst" -o"$(TARGET)_386.bin"220 386: 221 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_386) -l"$(TARGET)_386.lst" -o"$(TARGET)_386.bin" 219 222 @echo * Small 386 version "$(TARGET)_386.bin" built. 223 224 386_large: 225 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_386_LARGE) -l"$(TARGET)_386l.lst" -o"$(TARGET)_386l.bin" 226 @echo * Large 386 version "$(TARGET)_386l.bin" built. 220 227 221 228 strings: src\Strings.asm … … 237 244 @perl ..\Tools\checksum.pl $(TARGET)_atl.bin $(BIOS_SIZE_LARGE) 238 245 @perl ..\Tools\checksum.pl $(TARGET)_386.bin $(BIOS_SIZE_SMALL) 246 @perl ..\Tools\checksum.pl $(TARGET)_386l.bin $(BIOS_SIZE_LARGE) 239 247 240 248 unused:
Note:
See TracChangeset
for help on using the changeset viewer.