Changeset 397 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- Apr 19, 2012, 11:11:41 AM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
r395 r397 107 107 108 108 ; Check if ROM boot (INT 18h) wanted 109 %ifdef MODULE_HOTKEYS 109 110 cmp BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], ROM_BOOT_HOTKEY_SCANCODE 110 111 je SHORT JumpToBootSector_or_RomBoot ; CF clear so ROM boot 112 %endif 111 113 112 114 ; Try to boot from Primary boot drive (00h by default) -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r395 r397 211 211 ; ES:SI Ptr to ATA information for the drive 212 212 ; DS: RAMVARS segment 213 ; ES: BDA /Bootnfosegment213 ; ES: BDA segment 214 214 ; Returns: 215 215 ; Nothing … … 220 220 call CreateDPT_FromAtaInformation 221 221 jc SHORT DetectDrives_DriveNotFound 222 call BootMenuInfo_CreateForHardDisk223 jmp SHORT DetectPrint_DriveNameFrom BootnfoInESBX222 call DriveDetectInfo_CreateForHardDisk 223 jmp SHORT DetectPrint_DriveNameFromDrvDetectInfoInESBX -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r395 r397 153 153 154 154 ;-------------------------------------------------------------------- 155 ; DetectPrint_DriveNameFrom BootnfoInESBX156 ; Parameters: 157 ; ES:BX: Ptr to BOOTMENUINFO (if drive found)155 ; DetectPrint_DriveNameFromDrvDetectInfoInESBX 156 ; Parameters: 157 ; ES:BX: Ptr to DRVDETECTINFO (if drive found) 158 158 ; Returns: 159 159 ; Nothing … … 161 161 ; AX, SI 162 162 ;-------------------------------------------------------------------- 163 DetectPrint_DriveNameFrom BootnfoInESBX:163 DetectPrint_DriveNameFromDrvDetectInfoInESBX: 164 164 push di 165 165 push bx 166 166 167 lea si, [bx+ BOOTMENUINFO.szDrvName]167 lea si, [bx+DRVDETECTINFO.szDrvName] 168 168 mov bx, es 169 169 CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromBXSI -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r395 r397 52 52 %include "IdeRegisters.inc" ; For ATA Registers, flags and commands 53 53 %include "Int13h.inc" ; Equates for INT 13h functions 54 %ifdef MODULE_EBIOS55 %include "EBIOS.inc" ; Equates for EBIOS functions56 %endif57 54 %include "CustomDPT.inc" ; For Disk Parameter Table 58 55 %include "RomVars.inc" ; For ROMVARS and IDEVARS structs 59 56 %include "RamVars.inc" ; For RAMVARS struct 60 57 %include "BootVars.inc" ; For BOOTVARS struct 61 %include "HotkeyBar.inc" ; For Hotkeys62 %include "BootMenu.inc" ; For Boot Menu63 58 %include "IDE_8bit.inc" ; For IDE 8-bit data port macros 64 59 %include "DeviceIDE.inc" ; For IDE device equates 65 %include "Vision.inc" ; For QDI Vision QD65xx VLB IDE Controllers 60 66 61 67 62 … … 79 74 at ROMVARS.szVersion, db ROM_VERSION_STRING 80 75 81 ;;; For OR'ing into wFlags below82 ;;;83 %ifdef MODULE_SERIAL84 MAIN_FLG_MODULE_SERIAL equ FLG_ROMVARS_MODULE_SERIAL85 %else86 MAIN_FLG_MODULE_SERIAL equ 087 %endif88 89 %ifdef MODULE_EBIOS90 MAIN_FLG_MODULE_EBIOS equ FLG_ROMVARS_MODULE_EBIOS91 %else92 MAIN_FLG_MODULE_EBIOS equ 093 %endif94 95 %ifdef MODULE_JRIDE96 MAIN_FLG_MODULE_JRIDE equ FLG_ROMVARS_MODULE_JRIDE97 %else98 MAIN_FLG_MODULE_JRIDE equ 099 %endif100 101 %ifdef MODULE_ADVANCED_ATA102 MAIN_FLG_MODULE_ADVATA equ FLG_ROMVARS_MODULE_ADVATA103 %else104 MAIN_FLG_MODULE_ADVATA equ 0105 %endif106 107 108 76 ;---------------------------; 109 77 ; AT Build default settings ; 110 78 ;---------------------------; 111 79 %ifdef USE_AT 112 at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | FLG_ROMVARS_DRVXLAT | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_JRIDE | MAIN_FLG_MODULE_ADVATA80 at ROMVARS.wFlags, dw FLG_ROMVARS_FULLMODE | MASK_ROMVARS_INCLUDED_MODULES 113 81 at ROMVARS.wDisplayMode, dw DEFAULT_TEXT_MODE 114 at ROMVARS.wBootTimeout, dw BOOT_MENU_DEFAULT_TIMEOUT 82 %ifdef MODULE_BOOT_MENU 83 at ROMVARS.wBootTimeout, dw BOOT_MENU_DEFAULT_TIMEOUT 84 %endif 115 85 at ROMVARS.bIdeCnt, db 4 ; Number of supported controllers 116 86 at ROMVARS.bBootDrv, db 80h ; Boot Menu default drive … … 154 124 ; XT and XT+ Build default settings ; 155 125 ;-----------------------------------; 156 at ROMVARS.wFlags, dw FLG_ROMVARS_DRVXLAT | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_JRIDE | MAIN_FLG_MODULE_ADVATA126 at ROMVARS.wFlags, dw MASK_ROMVARS_INCLUDED_MODULES 157 127 at ROMVARS.wDisplayMode, dw DEFAULT_TEXT_MODE 158 at ROMVARS.wBootTimeout, dw BOOT_MENU_DEFAULT_TIMEOUT 128 %ifdef MODULE_BOOT_MENU 129 at ROMVARS.wBootTimeout, dw BOOT_MENU_DEFAULT_TIMEOUT 130 %endif 159 131 at ROMVARS.bIdeCnt, db 1 ; Number of supported controllers 160 132 at ROMVARS.bBootDrv, db 80h ; Boot Menu default drive … … 165 137 at ROMVARS.ideVars0+IDEVARS.wPort, dw DEVICE_XTIDE_DEFAULT_PORT ; Controller Command Block base port 166 138 at ROMVARS.ideVars0+IDEVARS.wPortCtrl, dw DEVICE_XTIDE_DEFAULT_PORTCTRL ; Controller Control Block base port 167 %ifdef MODULE_JRIDE168 at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_JRIDE_ISA169 %else170 139 at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_XTIDE_REV1 171 %endif172 at ROMVARS.ideVars0+IDEVARS.bIRQ, db 0 ; IRQ173 140 at ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 174 141 at ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE … … 221 188 %include "AccessDPT.asm" ; For accessing DPTs 222 189 %include "LbaAssist.asm" ; For generating L-CHS parameters to LBA drives 223 %include " BootMenuInfo.asm" ; For creating BOOTMENUINFO structs190 %include "DrvDetectInfo.asm" ; For creating DRVDETECTINFO structs 224 191 %include "AtaID.asm" ; For ATA Identify Device information 225 192 %include "DetectDrives.asm" ; For detecting IDE drives -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm
r392 r397 42 42 jc .notOurs 43 43 44 call BootMenuInfo_ConvertDPTtoBX44 call DriveDetectInfo_ConvertDPTtoBX 45 45 mov si, g_szDriveNumBOOTNFO ; special g_szDriveNum that prints from BDA 46 46 jmp .go … … 186 186 .HardDiskMenuitemInfoForOurDrive: 187 187 ePUSH_T ax, g_szInformation ; Add substring for our hard disk information 188 call BootMenuInfo_GetTotalSectorCount ; Get Total LBA Size188 call GetTotalSectorCount 189 189 jmp .ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 190 190 … … 218 218 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 5 219 219 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 6 220 221 222 ;-------------------------------------------------------------------- 223 ; GetTotalSectorCount 224 ; Parameters: 225 ; DS:DI: DPT Pointer 226 ; Returns: 227 ; BX:DX:AX: 48-bit sector count 228 ; Corrupts registers: 229 ; CX 230 ;-------------------------------------------------------------------- 231 GetTotalSectorCount: 232 test BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA 233 jnz SHORT .ReturnFullCapacity 234 jmp AH15h_GetSectorCountToBXDXAX 235 .ReturnFullCapacity: 236 jmp AccessDPT_GetLbaSectorCountToBXDXAX -
trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm
r395 r397 33 33 ALIGN JUMP_ALIGN 34 34 DriveXlate_ToOrBack: 35 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_DRVXLAT36 jz SHORT .Return ; Return if translation disabled37 35 xchg di, ax ; Backup AX 38 36 … … 57 55 .RestoreAXandReturn: 58 56 xchg ax, di ; Restore AX 59 ALIGN JUMP_ALIGN, ret60 .Return:61 57 ret 62 58 … … 73 69 ; Nothing 74 70 ;-------------------------------------------------------------------- 75 ALIGN JUMP_ALIGN76 71 DriveXlate_Reset: 77 72 mov WORD [RAMVARS.xlateVars+XLATEVARS.wFDandHDswap], 8000h … … 91 86 ; Nothing 92 87 ;-------------------------------------------------------------------- 93 ALIGN JUMP_ALIGN94 88 DriveXlate_SetDriveToSwap: 95 89 test dl, dl ; Floppy drive? 96 js SHORT .SetHardDiskToSwap 97 .SetFloppyDriveToSwap: 90 js SHORT .SetHardDriveToSwap 91 92 ; Set Floppy Drive to swap 98 93 mov [RAMVARS.xlateVars+XLATEVARS.bFDSwap], dl 99 94 ret 100 ALIGN JUMP_ALIGN 101 .SetHardD iskToSwap:95 96 .SetHardDriveToSwap: 102 97 mov [RAMVARS.xlateVars+XLATEVARS.bHDSwap], dl 103 98 ret -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm
r395 r397 33 33 BootVars_Initialize: 34 34 ; Clear to zero 35 mov al, BOOTMENUINFO_size35 mov al, DRVDETECTINFO_size 36 36 mul BYTE [cs:ROMVARS.bIdeCnt] 37 mov di, BOOTVARS. hotkeyVars; We must not initialize anything before this!37 mov di, BOOTVARS.clearToZeroFromThisPoint ; We must not initialize anything before this! 38 38 add ax, BOOTVARS_size 39 39 sub ax, di -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/DrvDetectInfo.asm
r395 r397 23 23 24 24 ;-------------------------------------------------------------------- 25 ; Creates new BOOTMENUINFO struct for detected hard disk.25 ; Creates new DRVDETECTINFO struct for detected hard disk. 26 26 ; 27 ; BootMenuInfo_CreateForHardDisk27 ; DriveDetectInfo_CreateForHardDisk 28 28 ; Parameters: 29 29 ; DL: Drive number … … 31 31 ; ES:SI: Ptr to 512-byte ATA information read from the drive 32 32 ; Returns: 33 ; ES:BX: Ptr to BOOTMENUINFO (if successful)33 ; ES:BX: Ptr to DRVDETECTINFO (if successful) 34 34 ; Corrupts registers: 35 35 ; AX, BX, CX, DX, DI 36 36 ;-------------------------------------------------------------------- 37 BootMenuInfo_CreateForHardDisk:38 call BootMenuInfo_ConvertDPTtoBX ; ES:BX now points to new BOOTMENUINFO37 DriveDetectInfo_CreateForHardDisk: 38 call DriveDetectInfo_ConvertDPTtoBX ; ES:BX now points to new DRVDETECTINFO 39 39 40 40 ; Store Drive Name … … 46 46 47 47 add si, BYTE ATA1.strModel ; DS:SI now points drive name 48 lea di, [bx+ BOOTMENUINFO.szDrvName] ; ES:DI now points to name destination48 lea di, [bx+DRVDETECTINFO.szDrvName] ; ES:DI now points to name destination 49 49 mov cx, MAX_HARD_DISK_NAME_LENGTH / 2 ; Max number of WORDs allowed 50 50 .CopyNextWord: … … 63 63 64 64 ;-------------------------------------------------------------------- 65 ; BootMenuInfo_GetTotalSectorCount 66 ; Parameters: 67 ; DS:DI: DPT Pointer 68 ; Returns: 69 ; BX:DX:AX: 48-bit sector count 70 ; Corrupts registers: 71 ; CX 72 ;-------------------------------------------------------------------- 73 %ifdef MODULE_BOOT_MENU 74 BootMenuInfo_GetTotalSectorCount: 75 test BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA 76 jnz SHORT .ReturnFullCapacity 77 jmp AH15h_GetSectorCountToBXDXAX 78 .ReturnFullCapacity: 79 jmp AccessDPT_GetLbaSectorCountToBXDXAX 80 %endif 81 82 83 ;-------------------------------------------------------------------- 84 ; Returns offset to BOOTMENUINFO based on DPT pointer. 65 ; Returns offset to DRVDETECTINFO based on DPT pointer. 85 66 ; 86 ; BootMenuInfo_ConvertDPTtoBX67 ; DriveDetectInfo_ConvertDPTtoBX 87 68 ; Parameters: 88 69 ; DS:DI: DPT Pointer 89 70 ; Returns: 90 ; BX: Offset to BOOTMENUINFO struct71 ; BX: Offset to DRVDETECTINFO struct 91 72 ; Corrupts registers: 92 73 ; AX 93 74 ;-------------------------------------------------------------------- 94 BootMenuInfo_ConvertDPTtoBX:75 DriveDetectInfo_ConvertDPTtoBX: 95 76 mov ax, di 96 77 sub ax, BYTE RAMVARS_size ; subtract off base of DPTs 97 mov bl, DPT_ BOOTMENUINFO_SIZE_MULTIPLIER ; BOOTMENUINFO'sare a whole number multiple of DPT size78 mov bl, DPT_DRVDETECTINFO_SIZE_MULTIPLIER ; DRVDETECTINFO are a whole number multiple of DPT size 98 79 mul bl 99 add ax, BOOTVARS.rg BootNfo ; add base of BOOTMENUINFO80 add ax, BOOTVARS.rgDrvDetectInfo ; add base of DRVDETECTINFO 100 81 xchg ax, bx 101 82 ret
Note:
See TracChangeset
for help on using the changeset viewer.