- Timestamp:
- Nov 16, 2011, 11:35:45 AM (13 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
r190 r192 22 22 ALIGN JUMP_ALIGN 23 23 BootMenuPrint_FloppyMenuitem: 24 js BootMenuPrint_FloppyMenuitemInformation24 js short BootMenuPrint_FloppyMenuitemInformation 25 25 call PrintDriveNumberAfterTranslationFromDL 26 26 push bp … … 30 30 add dl, 'A' 31 31 push dx ; Drive letter 32 jmp BootMenuPrint_FormatCSSIfromParamsInSSBP32 jmp short BootMenuPrint_FormatCSSIfromParamsInSSBP 33 33 34 34 %if BootMenuPrint_FloppyMenuitem <> BootMenuEvent_FallThroughToFloppyMenuitem 35 35 %error "BootMenuPrint.asm must follow BootMenuEvent.asm, and BootMenuPrint_FloppyMenuitem must be the first routine in BootMenuPrint.asm" 36 36 %endif 37 38 ;-------------------------------------------------------------------- 39 ; BootMenuPrint_ClearScreen 40 ; Parameters: 41 ; Nothing 42 ; Returns: 43 ; Nothing 44 ; Corrupts registers: 45 ; AX, DI 46 ;-------------------------------------------------------------------- 47 ALIGN JUMP_ALIGN 48 BootMenuPrint_ClearScreen: 49 call BootMenuPrint_InitializeDisplayContext 50 xor ax, ax 51 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 52 mov ax, ' ' | (MONO_NORMAL<<8) 53 CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH 54 ret 55 56 57 ;-------------------------------------------------------------------- 58 ; BootMenuPrint_InitializeDisplayContext 59 ; Parameters: 60 ; Nothing 61 ; Returns: 62 ; Nothing 63 ; Corrupts registers: 64 ; AX, DI 65 ;-------------------------------------------------------------------- 66 ALIGN JUMP_ALIGN 67 BootMenuPrint_InitializeDisplayContext: 68 CALL_DISPLAY_LIBRARY InitializeDisplayContext 69 ret 37 38 39 ;-------------------------------------------------------------------- 40 ; ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 41 ; Parameters: 42 ; BX:DX:AX: Sector count 43 ; Returns: 44 ; Size in stack 45 ; Corrupts registers: 46 ; AX, BX, CX, DX, SI 47 ;-------------------------------------------------------------------- 48 ALIGN JUMP_ALIGN 49 ConvertSectorCountInBXDXAXtoSizeAndPushForFormat: 50 pop si ; Pop return address 51 call Size_ConvertSectorCountInBXDXAXtoKiB 52 mov cx, BYTE_MULTIPLES.kiB 53 call Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX 54 push ax ; Size in magnitude 55 push cx ; Tenths 56 push dx ; Magnitude character 57 jmp si 70 58 71 59 … … 109 97 push bp 110 98 mov bp,sp 111 jmp BootMenuPrint_FormatCSSIfromParamsInSSBP 112 99 jmp short BootMenuPrint_FormatCSSIfromParamsInSSBP 100 101 113 102 ;-------------------------------------------------------------------- 114 103 ; BootMenuPrint_HardDiskMenuitem … … 124 113 ALIGN JUMP_ALIGN 125 114 BootMenuPrint_HardDiskMenuitem: 126 js BootMenuPrint_HardDiskMenuitemInformation115 js short BootMenuPrint_HardDiskMenuitemInformation 127 116 call PrintDriveNumberAfterTranslationFromDL 128 117 call RamVars_IsDriveHandledByThisBIOS … … 165 154 166 155 ;-------------------------------------------------------------------- 167 ; PrintDriveNumberAfterTranslationFromDL156 ; BootMenuPrint_FloppyMenuitemInformation 168 157 ; Parameters: 169 158 ; DL: Untranslated Floppy Drive number 170 159 ; DS: RAMVARS segment 171 160 ; Returns: 172 ; Nothing173 ; Corrupts registers:174 ; AX, DI175 ;--------------------------------------------------------------------176 ALIGN JUMP_ALIGN177 PrintDriveNumberAfterTranslationFromDL:178 mov ax, dx179 call DriveXlate_ToOrBack180 xchg dx, ax ; Restore DX, WORD to print in AL181 xor ah, ah182 push bp183 mov bp, sp184 mov si, g_szDriveNum185 push ax186 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP187 188 189 ;--------------------------------------------------------------------190 ; BootMenuPrint_FloppyMenuitemInformation191 ; Parameters:192 ; DL: Untranslated Floppy Drive number193 ; DS: RAMVARS segment194 ; Returns:195 161 ; CF: Set since menu event was handled successfully 196 162 ; Corrupts registers: 197 163 ; AX, BX, CX, DX, SI, DI, ES 198 164 ;-------------------------------------------------------------------- 165 166 FloppyTypes: 167 .rgbCapacityMultiplier equ 20 ; Multiplier to reduce word sized values to byte size 168 .rgbCapacity: 169 db 360 / FloppyTypes.rgbCapacityMultiplier ; type 1 170 db 1200 / FloppyTypes.rgbCapacityMultiplier ; type 2 171 db 720 / FloppyTypes.rgbCapacityMultiplier ; type 3 172 db 1440 / FloppyTypes.rgbCapacityMultiplier ; type 4 173 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 5 174 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 6 175 176 %if g_szFddFiveQuarter <> g_szFddThreeHalf+g_szFddThreeFive_Displacement 177 %error "FddThreeFive_Displacement incorrect" 178 %endif 179 199 180 ALIGN JUMP_ALIGN 200 181 BootMenuPrint_FloppyMenuitemInformation: … … 258 239 259 240 ALIGN JUMP_ALIGN 260 .output: 261 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP 262 263 FloppyTypes: 264 .rgbCapacityMultiplier equ 20 ; Multiplier to reduce word sized values to byte size 265 .rgbCapacity: 266 db 360 / FloppyTypes.rgbCapacityMultiplier ; type 1 267 db 1200 / FloppyTypes.rgbCapacityMultiplier ; type 2 268 db 720 / FloppyTypes.rgbCapacityMultiplier ; type 3 269 db 1440 / FloppyTypes.rgbCapacityMultiplier ; type 4 270 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 5 271 db 2880 / FloppyTypes.rgbCapacityMultiplier ; type 6 272 273 %if g_szFddFiveQuarter <> g_szFddThreeHalf+g_szFddThreeFive_Displacement 274 %error "FddThreeFive_Displacement incorrect" 275 %endif 276 241 .output: 242 ;;; fall-through 243 244 ;-------------------------------------------------------------------- 245 ; BootMenuPrint_FormatCSSIfromParamsInSSBP 246 ; Parameters: 247 ; CS:SI: Ptr to string to format 248 ; BP: SP before pushing parameters 249 ; Returns: 250 ; BP: Popped from stack 251 ; Corrupts registers: 252 ; AX, DI 253 ;-------------------------------------------------------------------- 254 ALIGN JUMP_ALIGN 255 BootMenuPrint_FormatCSSIfromParamsInSSBP: 256 CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI 257 stc ; Successfull return from menu event 258 pop bp 259 ret 260 261 277 262 ;-------------------------------------------------------------------- 278 263 ; Prints Hard Disk Menuitem information strings. … … 346 331 347 332 mov si, g_szSizeSingle 348 ; Fall to BootMenuPrint_FormatCSSIfromParamsInSSBP 349 350 351 ;-------------------------------------------------------------------- 352 ; BootMenuPrint_FormatCSSIfromParamsInSSBP 353 ; Parameters: 354 ; CS:SI: Ptr to string to format 355 ; BP: SP before pushing parameters 356 ; Returns: 357 ; BP: Popped from stack 358 ; Corrupts registers: 359 ; AX, DI 360 ;-------------------------------------------------------------------- 361 ALIGN JUMP_ALIGN 362 BootMenuPrint_FormatCSSIfromParamsInSSBP: 363 CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI 364 stc ; Successfull return from menu event 365 pop bp 366 ret 367 368 369 ;-------------------------------------------------------------------- 370 ; ConvertSectorCountInBXDXAXtoSizeAndPushForFormat 371 ; Parameters: 372 ; BX:DX:AX: Sector count 373 ; Returns: 374 ; Size in stack 375 ; Corrupts registers: 376 ; AX, BX, CX, DX, SI 377 ;-------------------------------------------------------------------- 378 ALIGN JUMP_ALIGN 379 ConvertSectorCountInBXDXAXtoSizeAndPushForFormat: 380 pop si ; Pop return address 381 call Size_ConvertSectorCountInBXDXAXtoKiB 382 mov cx, BYTE_MULTIPLES.kiB 383 call Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX 384 push ax ; Size in magnitude 385 push cx ; Tenths 386 push dx ; Magnitude character 387 jmp si 388 389 333 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP 334 335 390 336 ;-------------------------------------------------------------------- 391 337 ; BootMenuPrint_ClearInformationArea … … 402 348 stc 403 349 ret 350 351 352 ;-------------------------------------------------------------------- 353 ; BootMenuPrint_ClearScreen 354 ; Parameters: 355 ; Nothing 356 ; Returns: 357 ; Nothing 358 ; Corrupts registers: 359 ; AX, DI 360 ;-------------------------------------------------------------------- 361 ALIGN JUMP_ALIGN 362 BootMenuPrint_ClearScreen: 363 call BootMenuPrint_InitializeDisplayContext 364 xor ax, ax 365 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 366 mov ax, ' ' | (MONO_NORMAL<<8) 367 CALL_DISPLAY_LIBRARY ClearScreenWithCharInALandAttrInAH 368 ret 369 370 371 ;-------------------------------------------------------------------- 372 ; PrintDriveNumberAfterTranslationFromDL 373 ; Parameters: 374 ; DL: Untranslated Floppy Drive number 375 ; DS: RAMVARS segment 376 ; Returns: 377 ; Nothing 378 ; Corrupts registers: 379 ; AX, DI 380 ;-------------------------------------------------------------------- 381 ALIGN JUMP_ALIGN 382 PrintDriveNumberAfterTranslationFromDL: 383 mov ax, dx 384 call DriveXlate_ToOrBack 385 xchg dx, ax ; Restore DX, WORD to print in AL 386 xor ah, ah 387 push bp 388 mov bp, sp 389 mov si, g_szDriveNum 390 push ax 391 392 BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay: 393 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP 404 394 405 395 … … 514 504 push cx ; Key attribute for last space 515 505 mov si, g_szHotkey 516 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP 517 518 506 jmp SHORT BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 507 508 509 ;-------------------------------------------------------------------- 510 ; BootMenuPrint_InitializeDisplayContext 511 ; Parameters: 512 ; Nothing 513 ; Returns: 514 ; Nothing 515 ; Corrupts registers: 516 ; AX, DI 517 ;-------------------------------------------------------------------- 518 ALIGN JUMP_ALIGN 519 BootMenuPrint_InitializeDisplayContext: 520 CALL_DISPLAY_LIBRARY InitializeDisplayContext 521 ret 522 523 524 525 526 527 -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm
r191 r192 137 137 PrintValuesFromStack: 138 138 mov si, g_szCfgFormat 139 jmp Boot MenuPrint_FormatCSSIfromParamsInSSBP139 jmp BootPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 140 140 -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootPrint.asm
r143 r192 4 4 ; Section containing code 5 5 SECTION .text 6 7 ;-------------------------------------------------------------------- 8 ; BootPrint_FailedToLoadFirstSector 9 ; Parameters: 10 ; AH: INT 13h error code 11 ; Returns: 12 ; Nothing 13 ; Corrupts registers: 14 ; AX, CX, SI, DI 15 ;-------------------------------------------------------------------- 16 ALIGN JUMP_ALIGN 17 BootPrint_FailedToLoadFirstSector: 18 push bp 19 mov bp, sp 20 eMOVZX cx, ah 21 push cx ; Push INT 13h error code 22 mov si, g_szReadError 23 24 BootPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay: 25 jmp short BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 26 6 27 7 28 ;-------------------------------------------------------------------- … … 33 54 34 55 mov si, g_szTryToBoot 35 jmp BootMenuPrint_FormatCSSIfromParamsInSSBP56 jmp short BootPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 36 57 37 58 38 ;-------------------------------------------------------------------- 39 ; BootPrint_FailedToLoadFirstSector 40 ; Parameters: 41 ; AH: INT 13h error code 42 ; Returns: 43 ; Nothing 44 ; Corrupts registers: 45 ; AX, CX, SI, DI 46 ;-------------------------------------------------------------------- 47 ALIGN JUMP_ALIGN 48 BootPrint_FailedToLoadFirstSector: 49 push bp 50 mov bp, sp 51 eMOVZX cx, ah 52 push cx ; Push INT 13h error code 53 mov si, g_szReadError 54 jmp BootMenuPrint_FormatCSSIfromParamsInSSBP 59 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r189 r192 22 22 ePUSH_T ax, ROMVARS.szTitle ; Bios title string 23 23 push cs ; BIOS segment 24 25 DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay: 24 26 jmp BootMenuPrint_FormatCSSIfromParamsInSSBP 25 27 … … 42 44 push ax ; Push "Master" or "Slave" 43 45 push di ; Push port number 44 jmp BootMenuPrint_FormatCSSIfromParamsInSSBP46 jmp DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay 45 47 46 48 -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r186 r192 170 170 %include "DetectDrives.asm" ; For detecting IDE drives 171 171 %include "DetectPrint.asm" ; For printing drive detection strings 172 172 173 173 ; Boot menu 174 174 %include "BootMenu.asm" ; For Boot Menu operations 175 175 %include "BootMenuEvent.asm" ; For menu library event handling 176 %include "BootMenuPrint.asm" ; For printing Boot Menu strings (needs to come after BootMenuEvent.asm) 176 ; NOTE: BootMenuPrint needs to come immediately after BootMenuEvent 177 %include "BootMenuPrint.asm" ; For printing Boot Menu strings 178 %include "BootPrint.asm" ; For printing boot information 179 %include "BootMenuPrintCfg.asm" ; For printing hard disk configuration 177 180 %include "FloppyDrive.asm" ; Floppy Drive related functions 178 181 %include "BootSector.asm" ; For loading boot sector 179 %include "BootPrint.asm" ; For printing boot information180 %include "BootMenuPrintCfg.asm" ; For printing hard disk configuration181 182 182 183 ; Boot loader … … 187 188 188 189 ; For all device types 190 %include "Idepack.asm" 189 191 %include "Device.asm" 190 %include "Idepack.asm"191 192 %include "Timer.asm" ; For timeout and delay 192 193 … … 194 195 %include "IdeCommand.asm" 195 196 %include "IdeTransfer.asm" ; Must be included after IdeCommand.asm 197 %include "IdeWait.asm" 198 %include "IdeError.asm" ; Must be included after IdeWait.asm 196 199 %include "IdeDPT.asm" 197 200 %include "IdeIO.asm" 198 201 %include "IdeIrq.asm" 199 %include "IdeWait.asm"200 %include "IdeError.asm" ; Must be included after IdeWait.asm201 202 202 203 %ifdef MODULE_SERIAL ; Serial Port Device support
Note:
See TracChangeset
for help on using the changeset viewer.