Changeset 241 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot
- Timestamp:
- Feb 9, 2012, 11:08:59 AM (13 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Boot
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Boot/BootInfo.asm
r181 r241 16 16 ; Returns: 17 17 ; ES:BX: Ptr to BOOTNFO (if successful) 18 ; CF: Cleared if BOOTNFO created succesfully19 ; Set if any error20 18 ; Corrupts registers: 21 ; AX, BX, CX, DX 19 ; AX, BX, CX, DX, DI, SI 22 20 ;-------------------------------------------------------------------- 23 21 BootInfo_CreateForHardDisk: 24 call BootInfo_ GetOffsetToBX ; ES:BX now points to new BOOTNFO25 ; Fall to .StoreSectorCount22 call BootInfo_ConvertDPTtoBX ; ES:BX now points to new BOOTNFO 23 push bx ; Preserve for return 26 24 27 ;-------------------------------------------------------------------- 28 ; .StoreSectorCount 29 ; Parameters: 30 ; ES:BX: Ptr to BOOTNFO 31 ; ES:SI: Ptr to 512-byte ATA information read from the drive 32 ; DS:DI: Ptr to Disk Parameter Table 33 ; Returns: 34 ; Nothing 35 ; Corrupts registers: 36 ; AX, CX, DX 37 ;-------------------------------------------------------------------- 38 .StoreSectorCount: 39 push bx 40 call AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI 41 mov cx, bx ; Now in CX:DX:AX 42 pop bx 43 mov [es:bx+BOOTNFO.twSectCnt], ax 44 mov [es:bx+BOOTNFO.twSectCnt+2], dx 45 mov [es:bx+BOOTNFO.twSectCnt+4], cx 46 ; Fall to .StoreDriveName 25 mov di, bx ; Starting pointer at beginning of structure 47 26 48 ;-------------------------------------------------------------------- 49 ; .StoreDriveName 50 ; Parameters: 51 ; ES:BX: Ptr to BOOTNFO 52 ; ES:SI: Ptr to 512-byte ATA information read from the drive 53 ; DS:DI: Ptr to Disk Parameter Table 54 ; Returns: 55 ; CF: Cleared if variables stored succesfully 56 ; Set if any error 57 ; Corrupts registers: 58 ; AX, CX 59 ;-------------------------------------------------------------------- 60 .StoreDriveName: 61 push ds 62 push si 63 push di 27 ; 28 ; Store Drive Name 29 ; 30 push ds ; Preserve RAMVARS 31 push si ; Preserve SI for call to GetTotalSectorCount... 64 32 65 push es 33 push es ; ES copied to DS 66 34 pop ds 35 67 36 add si, BYTE ATA1.strModel ; DS:SI now points drive name 68 37 lea di, [bx+BOOTNFO.szDrvName] ; ES:DI now points to name destination … … 74 43 loop .CopyNextWord 75 44 xor ax, ax ; Zero AX and clear CF 76 stos b; Terminate with NULL45 stosw ; Terminate with NULL 77 46 78 pop di79 47 pop si 80 48 pop ds 49 50 ; 51 ; Store Sector Count 52 ; 53 call AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI 54 55 stosw 56 xchg ax, dx 57 stosw 58 xchg ax, bx 59 stosw 60 61 pop bx 62 81 63 ret 82 64 83 65 84 66 ;-------------------------------------------------------------------- 85 67 ; Finds BOOTNFO for drive and returns total sector count. … … 87 69 ; BootInfo_GetTotalSectorCount 88 70 ; Parameters: 89 ; DL: Drive number 90 ; DS: RAMVARS segment 71 ; DS:DI: DPT Pointer 91 72 ; Returns: 92 73 ; BX:DX:AX: 48-bit sector count … … 97 78 BootInfo_GetTotalSectorCount: 98 79 push ds 99 call BootInfo_ GetOffsetToBX80 call BootInfo_ConvertDPTtoBX 100 81 LOAD_BDA_SEGMENT_TO ds, ax 101 82 mov ax, [bx+BOOTNFO.twSectCnt] … … 107 88 108 89 ;-------------------------------------------------------------------- 109 ; Returns offset to BOOTNFO for wanted drive.90 ; Returns offset to BOOTNFO based on DPT pointer. 110 91 ; 111 ; BootInfo_ GetOffsetToBX92 ; BootInfo_ConvertDPTtoBX 112 93 ; Parameters: 113 ; DL: Drive number 114 ; DS: RAMVARS segment 94 ; DS:DI: DPT Pointer 115 95 ; Returns: 116 96 ; BX: Offset to BOOTNFO struct … … 119 99 ;-------------------------------------------------------------------- 120 100 ALIGN JUMP_ALIGN 121 BootInfo_ GetOffsetToBX:122 mov bl, dl ; Copy drive number to BL123 mov al, BOOTNFO_size ; Size of struct124 sub bl, [RAMVARS.bFirstDrv] ; Drive number to index125 mul bl ; AX = Offset inside BOOTNFO array126 add ax, BOOTVARS.rgBootNfo ; Add offset to BOOTNFO array127 xchg bx, ax ; Move result to BX128 ret 101 BootInfo_ConvertDPTtoBX: 102 mov ax, di 103 sub ax, RAMVARS_size ; subtract off base of DPTs 104 mov bl, DPT_BOOTNFO_SIZE_MULTIPLIER ; BOOTNFO's are a whole number multiple of DPT size 105 mul bl 106 add ax, BOOTVARS.rgBootNfo ; add base of BOOTNFO 107 xchg ax, bx 108 ret -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm
r181 r241 22 22 call BootMenu_Enter ; Get selected menuitem index to CX 23 23 call BootMenuPrint_ClearScreen 24 c mp cx, BYTE NO_ITEM_SELECTED25 j e SHORT BootMenu_DisplayAndReturnSelection ; Clear screen and display menu26 ; Fall to BootMenu_GetDriveToDXforMenuitemInCX24 call BootMenu_GetDriveToDXforMenuitemInCX 25 jnc BootMenu_DisplayAndReturnSelection 26 ret 27 27 28 28 ;-------------------------------------------------------------------- … … 30 30 ; Parameters: 31 31 ; CX: Index of menuitem selected from Boot Menu 32 ; DS: RAMVARS segment33 32 ; Returns: 34 33 ; DX: Drive number to be used for booting 35 ; Corrupts registers: 36 ; CX 37 ;-------------------------------------------------------------------- 34 ; DS: RAMVARS segment 35 ; CF: Set: There is a selected menu item, DL is valid 36 ; Clear: There is no selected menu item, DL is not valid 37 ; Corrupts registers: 38 ; CX, DI 39 ;-------------------------------------------------------------------- 40 ALIGN JUMP_ALIGN 41 BootMenu_GetDriveToDXforMenuitemInCX_And_RamVars_GetSegmentToDS: 42 call RamVars_GetSegmentToDS 43 ;;; fall-through 44 38 45 ALIGN JUMP_ALIGN 39 46 BootMenu_GetDriveToDXforMenuitemInCX: 40 mov dx, cx ; Copy menuitem index to DX 41 call FloppyDrive_GetCountToCX 42 cmp dx, cx ; Floppy drive? 43 jb SHORT .ReturnFloppyDriveInDX 44 sub dx, cx ; Remove floppy drives from index 45 or dl, 80h 47 cmp cl, NO_ITEM_HIGHLIGHTED 48 je SHORT .ReturnFloppyDriveInDX ; Clear CF if branch taken 49 50 mov dl, cl ; Copy menuitem index to DX 51 call FloppyDrive_GetCountToCX 52 cmp dl, cl ; Floppy drive? 53 jb SHORT .ReturnFloppyDriveInDX ; Set CF if branch taken 54 or cl, 80h ; Or 80h into CL before the sub 55 ; to cause CF to be set after 56 ; and result has high order bit set 57 sub dl, cl ; Remove floppy drives from index 58 46 59 .ReturnFloppyDriveInDX: 47 60 ret -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm
r212 r241 25 25 26 26 MENUEVENT_InitializeMenuinitFromDSSI equ (BootMenuEvent_Handler.InitializeMenuinitFromDSSI - BootMenuEvent_Handler) 27 MENUEVENT_ExitMenu equ (BootMenuEvent_ Handler.EventCompleted - BootMenuEvent_Handler)27 MENUEVENT_ExitMenu equ (BootMenuEvent_EventCompleted - BootMenuEvent_Handler) 28 28 MENUEVENT_ItemHighlightedFromCX equ (BootMenuEvent_Handler.ItemHighlightedFromCX - BootMenuEvent_Handler) 29 29 MENUEVENT_ItemSelectedFromCX equ (BootMenuEvent_Handler.ItemSelectedFromCX - BootMenuEvent_Handler) 30 30 MENUEVENT_KeyStrokeInAX equ (BootMenuEvent_Handler.KeyStrokeInAX - BootMenuEvent_Handler) 31 31 MENUEVENT_RefreshTitle equ (BootMenuPrint_TitleStrings - BootMenuEvent_Handler) 32 MENUEVENT_RefreshInformation equ (BootMenu Event_Handler.RefreshInformation - BootMenuEvent_Handler)33 MENUEVENT_RefreshItemFromCX equ (BootMenu Event_Handler.RefreshItemFromCX- BootMenuEvent_Handler)32 MENUEVENT_RefreshInformation equ (BootMenuPrint_RefreshInformation - BootMenuEvent_Handler) 33 MENUEVENT_RefreshItemFromCX equ (BootMenuPrint_RefreshItem - BootMenuEvent_Handler) 34 34 ; 35 35 ; Note that there is no entry for MENUEVENT_IdleProcessing. If MENUEVENT_IDLEPROCESSING_ENABLE is not %defined, … … 49 49 ALIGN WORD_ALIGN 50 50 .rgfnEventSpecificHandlers: 51 dw .InitializeMenuinitFromDSSI ; MENUEVENT.InitializeMenuinitFromDSSI52 dw .EventCompleted; MENUEVENT.ExitMenu53 dw .EventNotHandled ; MENUEVENT.IdleProcessing54 dw .ItemHighlightedFromCX ; MENUEVENT.ItemHighlightedFromCX55 dw .ItemSelectedFromCX ; MENUEVENT.ItemSelectedFromCX56 dw .KeyStrokeInAX ; MENUEVENT.KeyStrokeInAX57 dw BootMenuPrint_TitleStrings ; MENUEVENT.RefreshTitle58 dw .RefreshInformation; MENUEVENT.RefreshInformation59 dw .RefreshItemFromCX; MENUEVENT.RefreshItemFromCX51 dw .InitializeMenuinitFromDSSI ; MENUEVENT.InitializeMenuinitFromDSSI 52 dw BootMenuEvent_EventCompleted ; MENUEVENT.ExitMenu 53 dw .EventNotHandled ; MENUEVENT.IdleProcessing 54 dw .ItemHighlightedFromCX ; MENUEVENT.ItemHighlightedFromCX 55 dw .ItemSelectedFromCX ; MENUEVENT.ItemSelectedFromCX 56 dw .KeyStrokeInAX ; MENUEVENT.KeyStrokeInAX 57 dw BootMenuPrint_TitleStrings ; MENUEVENT.RefreshTitle 58 dw BootMenuPrint_RefreshInformation ; MENUEVENT.RefreshInformation 59 dw BootMenuPrint_RefreshItem ; MENUEVENT.RefreshItemFromCX 60 60 61 61 %endif … … 103 103 .ItemHighlightedFromCX: 104 104 push cx 105 call RamVars_GetSegmentToDS105 call BootMenu_GetDriveToDXforMenuitemInCX_And_RamVars_GetSegmentToDS 106 106 call DriveXlate_Reset 107 call BootMenu_GetDriveToDXforMenuitemInCX108 107 call DriveXlate_SetDriveToSwap 109 108 … … 134 133 call BootMenu_GetMenuitemToAXforAsciiHotkeyInAL 135 134 cmp ax, [bp+MENUINIT.wItems] 136 jae SHORT .EventCompleted ; Invalid key135 jae SHORT BootMenuEvent_EventCompleted ; Invalid key 137 136 CALL_MENU_LIBRARY HighlightItemFromAX 138 137 ; Fall to .ItemSelectedFromCX … … 144 143 .ItemSelectedFromCX: 145 144 CALL_MENU_LIBRARY Close 146 .EventCompleted: 145 146 BootMenuEvent_EventCompleted: 147 147 stc 148 148 ret 149 149 150 151 ; Parameters:152 ; CX: Index of item to refresh153 ; Cursor has been positioned to the beginning of item line154 ALIGN JUMP_ALIGN155 .RefreshItemFromCX:156 xor bl, bl ; will result in SF being clear in .RefreshItemOrInformation...157 SKIP2B dx ; dx corrupted below by BootMenu_GetDriveToDXforMenuitemInCX158 ; Fall to .RefreshInformation159 160 ; Parameters:161 ; CX: Index of highlighted item162 ; Cursor has been positioned to the beginning of first line163 ; NO ALIGN - in the shadow of SKIP2B164 .RefreshInformation:165 mov bl,040h ; will result in SF being set in .RefreshItemOrInformation...166 ; Fall to .RefreshItemOrInformationWithJumpTableInCSBX167 168 ;--------------------------------------------------------------------169 ; RefreshItemOrInformationWithJumpTableInCSBX170 ; Parameters:171 ; CX: Index of selected menuitem172 ; CS:BX: Ptr to ITEM_TYPE_REFRESH jump table173 ; Returns:174 ; CF: set since event processed175 ;--------------------------------------------------------------------176 .RefreshItemOrInformationWithJumpTableInCSBX:177 cmp cl, NO_ITEM_HIGHLIGHTED178 je SHORT .EventCompleted179 180 call RamVars_GetSegmentToDS181 call BootMenu_GetDriveToDXforMenuitemInCX182 or bl,dl ; or drive number with bit from .RefreshItemFromCX or .RefreshInformation183 shl bl,1 ; drive letter high order bit to CF, Item/Information bit to SF184 jc SHORT BootMenuPrint_HardDiskMenuitem185 ; fall through to BootMenuEvent_FallThroughToFloppyMenuitem186 187 ;;;188 ;;; Fall-through (to BootMenuPrint_FloppyMenuitem)189 ;;; (checked at assembler time with the code after BootMenuPrint_FloppyMenuitem)190 ;;;191 ALIGN JUMP_ALIGN192 BootMenuEvent_FallThroughToFloppyMenuitem:193 ; fall through to BootMenuPrint_FloppyMenuitem -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
r200 r241 5 5 SECTION .text 6 6 7 ;;; 8 ;;; Fall-through from BootMenuEvent.asm! 9 ;;; BootMenuPrint_FloppyMenuitem must be the first routine in this file 10 ;;; (checked at assembler time with the code after BootMenuPrint_FloppyMenuitem) 11 ;;; 12 ;-------------------------------------------------------------------- 13 ; BootMenuPrint_FloppyMenuitem 7 ;-------------------------------------------------------------------- 8 ; BootMenuPrint_RefreshItem 9 ; 14 10 ; Parameters: 15 11 ; DL: Untranslated Floppy Drive number 16 ; SF: set for Information, clear for Item17 ; Returns:18 ; Nothing19 ; Corrupts registers:20 ; AX, DX, SI, DI21 ;-------------------------------------------------------------------- 22 ALIGN JUMP_ALIGN 23 BootMenuPrint_FloppyMenuitem: 24 j s short BootMenuPrint_FloppyMenuitemInformation25 call PrintDriveNumberAfterTranslationFromDL12 ; Returns: 13 ; Nothing 14 ; Corrupts registers: 15 ; AX, BX, DX, SI, DI 16 ;-------------------------------------------------------------------- 17 ALIGN JUMP_ALIGN 18 BootMenuPrint_RefreshItem: 19 call BootMenu_GetDriveToDXforMenuitemInCX_And_RamVars_GetSegmentToDS 20 jnc BootMenuEvent_EventCompleted ; if no menu item selected, out we go 21 26 22 push bp 27 23 mov bp, sp 28 mov si, g_szFDLetter 29 ePUSH_T ax, g_szFloppyDrv 30 add dl, 'A' 31 push dx ; Drive letter 24 25 call RamVars_IsDriveHandledByThisBIOS 26 jnc .notOurs 27 28 call FindDPT_ForDriveNumber ; if it is one of ours, print the string in bootnfo 29 call BootInfo_ConvertDPTtoBX 30 mov si, g_szDriveNumBOOTNFO ; special g_szDriveNum that prints from BDA 31 jmp .go 32 33 .notOurs: 34 mov si,g_szDriveNum 35 mov bx,g_szForeignHD ; assume a hard disk for the moment 36 37 test dl,80h 38 js .go 39 mov bl,((g_szFloppyDrv)-$$ & 0xff) ; and revisit the earlier assumption... 40 41 .go: 42 mov ax, dx ; preserve DL for the floppy drive letter addition 43 call DriveXlate_ToOrBack 44 push dx ; translated drive number 45 push bx ; sub string 46 add al, 'A' ; floppy drive letter (we always push this although 47 push ax ; the hard disks don't ever use it, but it does no harm) 48 32 49 jmp short BootMenuPrint_FormatCSSIfromParamsInSSBP 33 34 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS35 %if BootMenuPrint_FloppyMenuitem <> BootMenuEvent_FallThroughToFloppyMenuitem36 %error "BootMenuPrint.asm must follow BootMenuEvent.asm, and BootMenuPrint_FloppyMenuitem must be the first routine in BootMenuPrint.asm"37 %endif38 %endif39 40 ;--------------------------------------------------------------------41 ; ConvertSectorCountInBXDXAXtoSizeAndPushForFormat42 ; Parameters:43 ; BX:DX:AX: Sector count44 ; Returns:45 ; Size in stack46 ; Corrupts registers:47 ; AX, BX, CX, DX, SI48 ;--------------------------------------------------------------------49 ALIGN JUMP_ALIGN50 ConvertSectorCountInBXDXAXtoSizeAndPushForFormat:51 pop si ; Pop return address52 call Size_ConvertSectorCountInBXDXAXtoKiB53 mov cx, BYTE_MULTIPLES.kiB54 call Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX55 push ax ; Size in magnitude56 push cx ; Tenths57 push dx ; Magnitude character58 jmp si59 60 50 61 51 ;-------------------------------------------------------------------- … … 77 67 mov si, ROMVARS.szVersion 78 68 ; Fall to BootMenuPrint_NullTerminatedStringFromCSSIandSetCF 79 80 69 81 70 ;-------------------------------------------------------------------- … … 102 91 103 92 ;-------------------------------------------------------------------- 104 ; BootMenuPrint_HardDiskMenuitem105 ; Parameters:106 ; DL: Untranslated Hard Disk number107 ; DS: RAMVARS segment108 ; SF: set for Information, clear for Item109 ; Returns:110 ; CF: Set since menu event handled111 ; Corrupts registers:112 ; AX, BX, SI, DI113 ;--------------------------------------------------------------------114 ALIGN JUMP_ALIGN115 BootMenuPrint_HardDiskMenuitem:116 js short BootMenuPrint_HardDiskMenuitemInformation117 call PrintDriveNumberAfterTranslationFromDL118 call RamVars_IsDriveHandledByThisBIOS119 jnc SHORT .HardDiskMenuitemForForeignDrive120 ; Fall to .HardDiskMenuitemForOurDrive121 122 ;--------------------------------------------------------------------123 ; .HardDiskMenuitemForOurDrive124 ; Parameters:125 ; DL: Untranslated Hard Disk number126 ; DS: RAMVARS segment127 ; Returns:128 ; CF: Set since menu event handled129 ; Corrupts registers:130 ; AX, BX, SI, DI131 ;--------------------------------------------------------------------132 .HardDiskMenuitemForOurDrive:133 call BootInfo_GetOffsetToBX134 lea si, [bx+BOOTNFO.szDrvName]135 xor bx, bx ; BDA segment136 CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromBXSI137 stc138 ret139 140 ;--------------------------------------------------------------------141 ; BootMenuPrint_HardDiskMenuitemForForeignDrive142 ; Parameters:143 ; DL: Untranslated Hard Disk number144 ; DS: RAMVARS segment145 ; Returns:146 ; CF: Set since menu event handled147 ; Corrupts registers:148 ; AX, SI, DI149 ;--------------------------------------------------------------------150 ALIGN JUMP_ALIGN151 .HardDiskMenuitemForForeignDrive:152 mov si, g_szforeignHD153 jmp SHORT BootMenuPrint_NullTerminatedStringFromCSSIandSetCF154 155 156 ;--------------------------------------------------------------------157 93 ; BootMenuPrint_FloppyMenuitemInformation 158 94 ; Parameters: … … 165 101 ;-------------------------------------------------------------------- 166 102 167 FloppyTypes: 168 .rgbCapacityMultiplier equ 20 ; Multiplier to reduce word sized values to byte size 169 .rgbCapacity: 170 db 360 / FloppyTypes.rgbCapacityMultiplier ; type 1 171 db 1200 / FloppyTypes.rgbCapacityMultiplier ; type 2 172 db 720 / FloppyTypes.rgbCapacityMultiplier ; type 3 173 db 1440 / FloppyTypes.rgbCapacityMultiplier ; type 4 174 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 5 175 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 6 176 177 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 178 %if g_szFddFiveQuarter <> g_szFddThreeHalf+g_szFddThreeFive_Displacement 179 %error "FddThreeFive_Displacement incorrect" 180 %endif 181 %endif 182 183 ALIGN JUMP_ALIGN 184 BootMenuPrint_FloppyMenuitemInformation: 185 call BootMenuPrint_ClearInformationArea 186 call FloppyDrive_GetType ; Get Floppy Drive type to BX 103 ALIGN JUMP_ALIGN 104 BootMenuPrint_RefreshInformation: 105 CALL_MENU_LIBRARY ClearInformationArea 106 107 call BootMenu_GetDriveToDXforMenuitemInCX_And_RamVars_GetSegmentToDS 108 jnc BootMenuEvent_EventCompleted ; if no menu selection, abort 187 109 188 110 push bp 189 111 mov bp, sp 190 ePUSH_T ax, g_szCapacity 191 192 mov si, g_szFddSizeOr ; .PrintXTFloppyType 193 test bx, bx ; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD) 194 jz SHORT .output 195 196 mov si, g_szFddUnknown ; .PrintUnknownFloppyType 112 113 test dl, dl ; are we a hard disk? 114 js BootMenuPrint_HardDiskRefreshInformation 115 116 call FloppyDrive_GetType ; Get Floppy Drive type to BX 117 118 mov cx, g_szFddSizeOr ; .PrintXTFloppyType 119 test bx, bx ; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD) 120 jz SHORT BootMenuPrint_HardDiskRefreshInformation.output 121 122 mov cl, (g_szFddUnknown - $$) & 0xff ; .PrintUnknownFloppyType 197 123 cmp bl, FLOPPY_TYPE_35_ED 198 ja SHORT .output124 ja SHORT BootMenuPrint_HardDiskRefreshInformation.output 199 125 200 126 ; Fall to .PrintKnownFloppyType 201 202 127 203 128 ;-------------------------------------------------------------------- … … 223 148 ;-------------------------------------------------------------------- 224 149 .PrintKnownFloppyType: 225 mov si, g_szFddSize 226 227 mov ax, g_szFddThreeHalf 150 mov cl, (g_szFddSize - $$) & 0xff 151 push cx 152 153 mov cl, (g_szFddThreeHalf - $$) & 0xff 228 154 cmp bl, FLOPPY_TYPE_525_HD 229 155 ja .ThreeHalf 230 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 231 %if g_szFddThreeFive_Displacement = 2 232 inc ax ; compressed string case 233 inc ax 234 %else 235 add ax, g_szFddThreeFive_Displacement 236 %endif 237 %endif 156 mov cl, (g_szFddFiveQuarter - $$) & 0xff 238 157 .ThreeHalf: 239 push ax; "5 1/4" or "3 1/2"158 push cx ; "5 1/4" or "3 1/2" 240 159 241 160 mov al,FloppyTypes.rgbCapacityMultiplier … … 243 162 push ax 244 163 164 jmp short BootMenuPrint_HardDiskRefreshInformation.output 165 166 167 ;-------------------------------------------------------------------- 168 ; Prints Hard Disk Menuitem information strings. 169 ; 170 ; BootMenuPrint_HardDiskMenuitemInformation 171 ; Parameters: 172 ; DL: Untranslated Hard Disk number 173 ; DS: RAMVARS segment 174 ; Returns: 175 ; CF: Set since menu event was handled successfully 176 ; Corrupts registers: 177 ; BX, CX, DX, SI, DI, ES 178 ;-------------------------------------------------------------------- 179 ALIGN JUMP_ALIGN 180 BootMenuPrint_HardDiskRefreshInformation: 181 call RamVars_IsDriveHandledByThisBIOS 182 jnc SHORT .HardDiskMenuitemInfoForForeignDrive 183 call FindDPT_ForDriveNumber ; DS:DI to point DPT 184 ; Fall to .HardDiskMenuitemInfoForOurDrive 185 186 ;-------------------------------------------------------------------- 187 ; .HardDiskMenuitemInfoForOurDrive 188 ; Parameters: 189 ; DL: Untranslated Hard Disk number 190 ; DS:DI: Ptr to DPT 191 ; Returns: 192 ; Nothing 193 ; Corrupts registers: 194 ; AX, BX, CX, DX, SI, DI, ES 195 ;-------------------------------------------------------------------- 196 .HardDiskMenuitemInfoForOurDrive: 197 ePUSH_T ax, g_szSizeDual 198 199 ; Get and push L-CHS size 200 call AH15h_GetSectorCountToDXAX 201 call ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 202 203 ; Get and push total LBA size 204 call BootInfo_GetTotalSectorCount 205 call ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 206 jmp BootMenuPrintCfg_ForOurDrive 207 208 ;-------------------------------------------------------------------- 209 ; .HardDiskMenuitemInfoForForeignDrive 210 ; Parameters: 211 ; DL: Untranslated Hard Disk number 212 ; DS: RAMVARS segment 213 ; Returns: 214 ; CF: Set since menu event was handled successfully 215 ; Corrupts registers: 216 ; AX, BX, CX, DX, SI, DI 217 ;-------------------------------------------------------------------- 218 ALIGN JUMP_ALIGN 219 .HardDiskMenuitemInfoForForeignDrive: 220 call DriveXlate_ToOrBack 221 call AH15h_GetSectorCountFromForeignDriveToDXAX 222 call ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 223 245 224 ALIGN JUMP_ALIGN 246 225 .output: 226 mov si, g_szCapacity 247 227 ;;; fall-through 248 228 … … 263 243 stc ; Successfull return from menu event 264 244 pop bp 265 ret266 267 268 ;--------------------------------------------------------------------269 ; Prints Hard Disk Menuitem information strings.270 ;271 ; BootMenuPrint_HardDiskMenuitemInformation272 ; Parameters:273 ; DL: Untranslated Hard Disk number274 ; DS: RAMVARS segment275 ; Returns:276 ; CF: Set since menu event was handled successfully277 ; Corrupts registers:278 ; BX, CX, DX, SI, DI, ES279 ;--------------------------------------------------------------------280 ALIGN JUMP_ALIGN281 BootMenuPrint_HardDiskMenuitemInformation:282 call RamVars_IsDriveHandledByThisBIOS283 jnc SHORT .HardDiskMenuitemInfoForForeignDrive284 call FindDPT_ForDriveNumber ; DS:DI to point DPT285 ; Fall to .HardDiskMenuitemInfoForOurDrive286 287 ;--------------------------------------------------------------------288 ; .HardDiskMenuitemInfoForOurDrive289 ; Parameters:290 ; DL: Untranslated Hard Disk number291 ; DS:DI: Ptr to DPT292 ; Returns:293 ; Nothing294 ; Corrupts registers:295 ; AX, BX, CX, DX, SI, DI, ES296 ;--------------------------------------------------------------------297 .HardDiskMenuitemInfoForOurDrive:298 push di299 ePUSH_T ax, BootMenuPrintCfg_ForOurDrive ; Return from BootMenuPrint_FormatCSSIfromParamsInSSBP300 push bp301 mov bp, sp302 ePUSH_T ax, g_szCapacity303 304 ; Get and push L-CHS size305 mov [RAMVARS.bTimeoutTicksLeft], dl ; Store drive number306 call AH15h_GetSectorCountToDXAX307 call ConvertSectorCountInBXDXAXtoSizeAndPushForFormat308 309 ; Get and push total LBA size310 mov dl, [RAMVARS.bTimeoutTicksLeft] ; Restore drive number311 call BootInfo_GetTotalSectorCount312 call ConvertSectorCountInBXDXAXtoSizeAndPushForFormat313 314 mov si, g_szSizeDual315 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP316 317 318 ;--------------------------------------------------------------------319 ; .HardDiskMenuitemInfoForForeignDrive320 ; Parameters:321 ; DL: Untranslated Hard Disk number322 ; DS: RAMVARS segment323 ; Returns:324 ; CF: Set since menu event was handled successfully325 ; Corrupts registers:326 ; AX, BX, CX, DX, SI, DI327 ;--------------------------------------------------------------------328 ALIGN JUMP_ALIGN329 .HardDiskMenuitemInfoForForeignDrive:330 push bp331 mov bp, sp332 ePUSH_T ax, g_szCapacity333 334 call DriveXlate_ToOrBack335 call AH15h_GetSectorCountFromForeignDriveToDXAX336 call ConvertSectorCountInBXDXAXtoSizeAndPushForFormat337 338 mov si, g_szSizeSingle339 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP340 341 342 ;--------------------------------------------------------------------343 ; BootMenuPrint_ClearInformationArea344 ; Parameters:345 ; Nothing346 ; Returns:347 ; CF: Set348 ; Corrupts registers:349 ; AX, DI350 ;--------------------------------------------------------------------351 ALIGN JUMP_ALIGN352 BootMenuPrint_ClearInformationArea:353 CALL_MENU_LIBRARY ClearInformationArea354 stc355 245 ret 356 246 357 247 358 248 ;-------------------------------------------------------------------- … … 373 263 CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH 374 264 ret 375 376 377 ;--------------------------------------------------------------------378 ; PrintDriveNumberAfterTranslationFromDL379 ; Parameters:380 ; DL: Untranslated Floppy Drive number381 ; DS: RAMVARS segment382 ; Returns:383 ; Nothing384 ; Corrupts registers:385 ; AX, DI386 ;--------------------------------------------------------------------387 ALIGN JUMP_ALIGN388 PrintDriveNumberAfterTranslationFromDL:389 mov ax, dx390 call DriveXlate_ToOrBack391 xchg dx, ax ; Restore DX, WORD to print in AL392 xor ah, ah393 push bp394 mov bp, sp395 mov si, g_szDriveNum396 push ax397 398 BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:399 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP400 265 401 266 … … 510 375 push cx ; Key attribute for last space 511 376 mov si, g_szHotkey 512 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 377 378 BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay: 379 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP 513 380 514 381 … … 528 395 529 396 530 531 532 533 397 ;-------------------------------------------------------------------- 398 ; ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 399 ; Parameters: 400 ; BX:DX:AX: Sector count 401 ; Returns: 402 ; Size in stack 403 ; Corrupts registers: 404 ; AX, BX, CX, DX, SI 405 ;-------------------------------------------------------------------- 406 ALIGN JUMP_ALIGN 407 ConvertSectorCountInBXDXAXtoSizeAndPushForFormat: 408 pop si ; Pop return address 409 ePUSH_T cx, g_szCapacityNum ; Push format substring 410 call Size_ConvertSectorCountInBXDXAXtoKiB 411 mov cx, BYTE_MULTIPLES.kiB 412 call Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX 413 push ax ; Size in magnitude 414 push cx ; Tenths 415 push dx ; Magnitude character 416 jmp si 417 418 419 FloppyTypes: 420 .rgbCapacityMultiplier equ 20 ; Multiplier to reduce word sized values to byte size 421 .rgbCapacity: 422 db 360 / FloppyTypes.rgbCapacityMultiplier ; type 1 423 db 1200 / FloppyTypes.rgbCapacityMultiplier ; type 2 424 db 720 / FloppyTypes.rgbCapacityMultiplier ; type 3 425 db 1440 / FloppyTypes.rgbCapacityMultiplier ; type 4 426 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 5 427 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 6 428 429 430 431 432 433 434 435 -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm
r200 r241 12 12 ; BootMenuPrintCfg_ForOurDrive 13 13 ; Parameters: 14 ; DS: Segment to DPT 15 ; Stack: Offset to DPT 14 ; DS:DI: Pointer to DPT 16 15 ; Returns: 17 16 ; Nothing … … 21 20 ALIGN JUMP_ALIGN 22 21 BootMenuPrintCfg_ForOurDrive: 23 mov si, g_szCfgHeader24 call BootMenuPrint_NullTerminatedStringFromCSSIandSetCF25 pop di26 22 eMOVZX ax, BYTE [di+DPT.bIdevarsOffset] 27 23 xchg si, ax ; CS:SI now points to IDEVARS 28 24 ; Fall to .PushAndFormatCfgString 29 30 ;--------------------------------------------------------------------31 ; PushAndFormatCfgString32 ; Parameters:33 ; DS:DI: Ptr to DPT34 ; CS:SI: Ptr to IDEVARS35 ; Returns:36 ; Nothing37 ; Corrupts registers:38 ; AX, DX, SI, DI39 ;--------------------------------------------------------------------40 .PushAndFormatCfgString:41 push bp42 mov bp, sp43 ; Fall to first push below44 25 45 26 ;-------------------------------------------------------------------- … … 114 95 ;-------------------------------------------------------------------- 115 96 .PushIRQ: 116 eMOVZX ax, BYTE [cs:si+IDEVARS.bIRQ] 97 mov al, BYTE [cs:si+IDEVARS.bIRQ] 98 cbw 117 99 push ax 118 100 … … 129 111 .PushResetStatus: 130 112 mov al, [di+DPT.bFlagsHigh] 131 and a x, MASKH_DPT_RESET113 and al, MASKH_DPT_RESET ; ah already zero from last push 132 114 push ax 133 115 … … 142 124 ;-------------------------------------------------------------------- 143 125 .PrintValuesFromStack: 144 mov si, g_szCfgFormat 145 jmp BootPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 126 jmp BootMenuPrint_HardDiskRefreshInformation.output 146 127 -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootPrint.asm
r192 r241 22 22 mov si, g_szReadError 23 23 24 BootPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay:25 24 jmp short BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 26 25 … … 54 53 55 54 mov si, g_szTryToBoot 56 jmp short Boot Print_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay55 jmp short BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 57 56 58 57
Note:
See TracChangeset
for help on using the changeset viewer.