- Timestamp:
- Jan 30, 2011, 7:15:06 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
r96 r98 326 326 ; CF: Set since menu event was handled successfully 327 327 ; Corrupts registers: 328 ; AX , DI328 ; AX 329 329 ;-------------------------------------------------------------------- 330 330 ALIGN JUMP_ALIGN 331 331 BootMenuPrint_NullTerminatedStringFromCSSIandSetCF: 332 push di 332 333 CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI 334 pop di 333 335 stc 334 336 ret -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r97 r98 17 17 ; All (not segments) 18 18 ;-------------------------------------------------------------------- 19 ALIGN JUMP_ALIGN20 19 DetectDrives_FromAllIDEControllers: 21 20 call RamVars_GetIdeControllerCountToCX 22 21 mov bp, ROMVARS.ideVars0 ; CS:BP now points to first IDEVARS 23 ALIGN JUMP_ALIGN24 22 .DriveDetectLoop: 25 23 call DetectDrives_WithIDEVARS ; Detect Master and Slave … … 42 40 ; AX, BX, DX, SI, DI 43 41 ;-------------------------------------------------------------------- 44 ALIGN JUMP_ALIGN45 42 DetectDrives_WithIDEVARS: 46 43 push cx 47 44 mov ax, g_szMaster 48 call DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP 49 call DetectDrives_DetectMasterDrive ; Detect and create DPT + BOOTNFO 50 call DetectPrint_DriveNameOrNotFound ; Print found or not found string 45 mov bh, MASK_IDE_DRVHD_SET ; Select Master drive 46 call StartDetectionWithDriveSelectByteInBHandStringInAX ; Detect and create DPT + BOOTNFO 51 47 52 48 mov ax, g_szSlave 53 call DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP 54 call DetectDrives_DetectSlaveDrive 55 call DetectPrint_DriveNameOrNotFound 49 mov bh, MASK_IDE_DRVHD_SET | FLG_IDE_DRVHD_DRV 50 call StartDetectionWithDriveSelectByteInBHandStringInAX 56 51 pop cx 57 52 ret … … 59 54 60 55 ;-------------------------------------------------------------------- 61 ; Detects IDE Master or Slave drive. 62 ; 63 ; DetectDrives_DetectMasterDrive 64 ; DetectDrives_DetectSlaveDrive 56 ; StartDetectionWithDriveSelectByteInBHandStringInAX 65 57 ; Parameters: 66 ; CS:BP: Ptr to IDEVARS 67 ; DS: RAMVARS segment 68 ; ES: Zero (BDA segment) 69 ; Returns: 70 ; ES:BX: Ptr to BOOTNFO (if successful) 71 ; CF: Cleared if drive detected successfully 72 ; Set if any drive not found or other error 73 ; Corrupts registers: 74 ; AX, CX, DX, SI, DI 75 ;-------------------------------------------------------------------- 76 ALIGN JUMP_ALIGN 77 DetectDrives_DetectMasterDrive: 78 mov bh, MASK_IDE_DRVHD_SET ; Select Master drive 79 SKIP2B ax ; mov ax, <next instruction> 80 DetectDrives_DetectSlaveDrive: 81 mov bh, MASK_IDE_DRVHD_SET | FLG_IDE_DRVHD_DRV 82 ; Fall to DetectDrives_StartDetection 83 84 ;-------------------------------------------------------------------- 85 ; Detects IDE Master or Slave drive. 86 ; 87 ; DetectDrives_StartDetection 88 ; Parameters: 58 ; AX: Offset to "Master" or "Slave" string 89 59 ; BH: Drive Select byte for Drive and Head Register 90 60 ; CS:BP: Ptr to IDEVARS for the drive … … 92 62 ; ES: Zero (BDA segment) 93 63 ; Returns: 94 ; ES:BX: Ptr to BOOTNFO (if successful) 95 ; CF: Cleared if drive detected successfully 96 ; Set if any drive not found or other error 64 ; Nothing 97 65 ; Corrupts registers: 98 ; AX, CX, DX, SI, DI66 ; AX, BX, CX, DX, SI, DI 99 67 ;-------------------------------------------------------------------- 100 ALIGN JUMP_ALIGN 101 DetectDrives_StartDetection: 102 call DetectDrives_ReadAtaInfoFromDrive ; Assume hard disk103 jnc SHORT DetectDrives_CreateBiosTablesForHardDisk104 call DetectDrives_ReadAtapiInfoFromDrive ; Assume CD-ROM105 jnc SHORT DetectDrives_CreateBiosTablesForCDROM106 ret68 StartDetectionWithDriveSelectByteInBHandStringInAX: 69 call DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP 70 call ReadAtaInfoFromDrive ; Assume hard disk 71 jnc SHORT CreateBiosTablesForHardDisk 72 ;call ReadAtapiInfoFromDrive ; Assume CD-ROM (not yet implemented) 73 ;jnc SHORT _CreateBiosTablesForCDROM 74 jmp DetectPrint_DriveNotFound 107 75 108 76 109 77 ;-------------------------------------------------------------------- 110 ; Reads ATA information from the drive (for hard disks). 111 ; 112 ; DetectDrives_ReadAtaInfoFromDrive 78 ; ReadAtaInfoFromDrive 113 79 ; Parameters: 114 80 ; BH: Drive Select byte for Drive and Head Register … … 123 89 ; AX, BL, CX, DX, DI 124 90 ;-------------------------------------------------------------------- 125 ALIGN JUMP_ALIGN 126 DetectDrives_ReadAtaInfoFromDrive: 91 ReadAtaInfoFromDrive: 127 92 mov bl, [cs:bp+IDEVARS.bBusType]; Load BUS type 128 93 mov dx, [cs:bp+IDEVARS.wPort] ; Load IDE Base Port address … … 134 99 135 100 ;-------------------------------------------------------------------- 136 ; Creates all BIOS tables for detected hard disk. 137 ; 138 ; DetectDrives_CreateBiosTablesForHardDisk 101 ; CreateBiosTablesForHardDisk 139 102 ; Parameters: 140 103 ; BH: Drive Select byte for Drive and Head Register … … 142 105 ; ES:SI Ptr to ATA information for the drive 143 106 ; DS: RAMVARS segment 107 ; ES: BDA/Bootnfo segment 144 108 ; Returns: 145 ; ES:BX: Ptr to BOOTNFO (if successful) 146 ; CF: Cleared if BIOS tables created succesfully 147 ; Set if any error 109 ; Nothing 148 110 ; Corrupts registers: 149 ; AX, CX, DX, SI, DI111 ; AX, BX, CX, DX, SI, DI 150 112 ;-------------------------------------------------------------------- 151 ALIGN JUMP_ALIGN 152 DetectDrives_CreateBiosTablesForHardDisk: 113 CreateBiosTablesForHardDisk: 153 114 call CreateDPT_FromAtaInformation 154 115 jc SHORT .InvalidAtaInfo 155 116 call BootInfo_CreateForHardDisk 156 ;jc SHORT .InvalidAtaInfo 157 ; Call to search for BIOS partitions goes here 158 ;clc 117 jmp DetectPrint_DriveNameFromBootnfoInESBX 159 118 .InvalidAtaInfo: 160 ret 161 162 163 ;-------------------------------------------------------------------- 164 ; Reads ATAPI information from the drive (for CD/DVD-ROMs). 165 ; 166 ; DetectDrives_ReadAtapiInfoFromDrive 167 ; Parameters: 168 ; BH: Drive Select byte for Drive and Head Register 169 ; CS:BP: Ptr to IDEVARS for the drive 170 ; DS: RAMVARS segment 171 ; ES: Zero (BDA segment) 172 ; Returns: 173 ; ES:SI Ptr to ATAPI information (read with IDENTIFY PACKET DEVICE command) 174 ; CF: Cleared if ATAPI-information read successfully 175 ; Set if any error 176 ; Corrupts registers: 177 ; AX, BL, CX, DX, DI 178 ;-------------------------------------------------------------------- 179 ALIGN JUMP_ALIGN 180 DetectDrives_ReadAtapiInfoFromDrive: 181 ;stc 182 ;ret 183 ; Fall through to DetectDrives_CreateBiosTablesForCDROM 184 185 186 ;-------------------------------------------------------------------- 187 ; Creates all BIOS tables for detected CD/DVD-ROM. 188 ; 189 ; DetectDrives_CreateBiosTablesForCDROM 190 ; Parameters: 191 ; BH: Drive Select byte for Drive and Head Register 192 ; CS:BP: Ptr to IDEVARS for the drive 193 ; ES:SI Ptr to ATAPI information for the drive 194 ; DS: RAMVARS segment 195 ; Returns: 196 ; ES:BX: Ptr to BOOTNFO (if successful) 197 ; CF: Cleared if BIOS tables created succesfully 198 ; Set if any error 199 ; Corrupts registers: 200 ; AX, CX, DX, SI, DI 201 ;-------------------------------------------------------------------- 202 ALIGN JUMP_ALIGN 203 DetectDrives_CreateBiosTablesForCDROM: 204 stc 205 ret 119 jmp DetectPrint_DriveNotFound -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r97 r98 46 46 47 47 ;-------------------------------------------------------------------- 48 ; Displays Detected Drive Name from BOOTVARS or 49 ; drive not found string if no drive was found. 50 ; 51 ; DetectPrint_DriveNameOrNotFound 48 ; DetectPrint_DriveNameFromBootnfoInESBX 52 49 ; Parameters: 53 50 ; ES:BX: Ptr to BOOTNFO (if drive found) 54 ; CF: Cleared if drive found55 ; Set it drive not found56 51 ; Returns: 57 52 ; Nothing … … 59 54 ; AX, SI 60 55 ;-------------------------------------------------------------------- 61 DetectPrint_DriveName OrNotFound:56 DetectPrint_DriveNameFromBootnfoInESBX: 62 57 push di 63 jc SHORT .PrintDriveNotFound64 58 push bx 65 59 … … 73 67 ret 74 68 75 .PrintDriveNotFound: 69 70 ;-------------------------------------------------------------------- 71 ; DetectPrint_DriveNotFound 72 ; Parameters: 73 ; Nothing 74 ; Returns: 75 ; Nothing 76 ; Corrupts registers: 77 ; AX, SI 78 ;-------------------------------------------------------------------- 79 DetectPrint_DriveNotFound: 76 80 mov si, g_szNotFound 77 call BootMenuPrint_NullTerminatedStringFromCSSIandSetCF 78 pop di 79 ret 81 jmp BootMenuPrint_NullTerminatedStringFromCSSIandSetCF -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
r97 r98 74 74 call Interrupts_InitializeInterruptVectors 75 75 call DetectDrives_FromAllIDEControllers 76 ; Fall to .StoreDptPointersTo BDA76 ; Fall to .StoreDptPointersToIntVectors 77 77 78 78 ;-------------------------------------------------------------------- 79 ; .StoreDptPointersTo BDA79 ; .StoreDptPointersToIntVectors 80 80 ; Parameters: 81 81 ; DS: RAMVARS segment … … 86 86 ; DX, DI 87 87 ;-------------------------------------------------------------------- 88 .StoreDptPointersTo BDA:88 .StoreDptPointersToIntVectors: 89 89 mov dl, 80h 90 90 call FindDPT_ForDriveNumber ; DPT to DS:DI
Note:
See TracChangeset
for help on using the changeset viewer.