source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm@ 244

Last change on this file since 244 was 241, checked in by gregli@…, 13 years ago

Space optimizations in the Boot Menu and BootInfo routines, taking advantage of nested %s. Optimization in the init of RamVars to avoid writing the signature twice. Preparing for addition of serial floppy support, starting to break the assumption that our drives are always 80h or higher.

File size: 3.7 KB
RevLine 
[88]1; Project name : XTIDE Universal BIOS
[3]2; Description : Functions for printing drive configuration
3; information on Boot Menu.
4
5; Section containing code
6SECTION .text
7
8;--------------------------------------------------------------------
9; Prints Hard Disk configuration for drive handled by our BIOS.
10; Cursor is set to configuration header string position.
11;
12; BootMenuPrintCfg_ForOurDrive
13; Parameters:
[241]14; DS:DI: Pointer to DPT
[3]15; Returns:
16; Nothing
17; Corrupts registers:
[150]18; AX, BX, CX, DX, SI, DI
[3]19;--------------------------------------------------------------------
20ALIGN JUMP_ALIGN
21BootMenuPrintCfg_ForOurDrive:
[150]22 eMOVZX ax, BYTE [di+DPT.bIdevarsOffset]
23 xchg si, ax ; CS:SI now points to IDEVARS
[194]24 ; Fall to .PushAndFormatCfgString
[3]25
26;--------------------------------------------------------------------
[88]27; PushAddressingMode
[3]28; Parameters:
29; DS:DI: Ptr to DPT
30; CS:SI: Ptr to IDEVARS
31; Returns:
[88]32; Nothing (jumps to next push below)
[3]33; Corrupts registers:
[191]34; AX, BX
[3]35;--------------------------------------------------------------------
[194]36.PushAddressingMode:
[200]37 AccessDPT_GetUnshiftedAddressModeToALZF
[193]38 ;;
39 ;; This multiply both shifts the addressing mode bits down to low order bits, and
40 ;; at the same time multiplies by the size of the string displacement. The result is in AH,
41 ;; with AL clear, and so we exchange AL and AH after the multiply for the final result.
42 ;;
43 mov bl,(1<<(8-ADDRESSING_MODE_FIELD_POSITION)) * g_szAddressingModes_Displacement
[182]44 mul bl
[193]45 xchg al,ah
[182]46 add ax,g_szAddressingModes
47 push ax
48
[3]49;--------------------------------------------------------------------
[88]50; PushBlockMode
[3]51; Parameters:
52; DS:DI: Ptr to DPT
53; CS:SI: Ptr to IDEVARS
54; Returns:
55; Nothing (falls to next push below)
56; Corrupts registers:
[88]57; AX
[3]58;--------------------------------------------------------------------
[194]59.PushBlockMode:
[150]60 mov ax, 1
[158]61 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
[150]62 jz SHORT .PushBlockSizeFromAX
63 mov al, [di+DPT_ATA.bSetBlock]
64.PushBlockSizeFromAX:
[3]65 push ax
66
67;--------------------------------------------------------------------
[88]68; PushBusType
[3]69; Parameters:
70; DS:DI: Ptr to DPT
71; CS:SI: Ptr to IDEVARS
72; Returns:
73; Nothing (jumps to next push below)
74; Corrupts registers:
75; AX, DX
76;--------------------------------------------------------------------
[194]77.PushBusType:
[182]78 mov al,g_szBusTypeValues_Displacement
79 mul BYTE [cs:si+IDEVARS.bDevice]
[186]80
81 shr ax,1 ; divide by 2 since IDEVARS.bDevice is multiplied by 2
82
[182]83 add ax,g_szBusTypeValues
84 push ax
85
[3]86;--------------------------------------------------------------------
[88]87; PushIRQ
[3]88; Parameters:
89; DS:DI: Ptr to DPT
90; CS:SI: Ptr to IDEVARS
91; Returns:
92; Nothing (falls to next push below)
93; Corrupts registers:
[88]94; AX, DX
[3]95;--------------------------------------------------------------------
[194]96.PushIRQ:
[241]97 mov al, BYTE [cs:si+IDEVARS.bIRQ]
98 cbw
[3]99 push ax
100
101;--------------------------------------------------------------------
[88]102; PushResetStatus
[3]103; Parameters:
104; DS:DI: Ptr to DPT
105; CS:SI: Ptr to IDEVARS
106; Returns:
[88]107; Nothing (falls to next push below)
[3]108; Corrupts registers:
[88]109; AX
[3]110;--------------------------------------------------------------------
[194]111.PushResetStatus:
[158]112 mov al, [di+DPT.bFlagsHigh]
[241]113 and al, MASKH_DPT_RESET ; ah already zero from last push
[88]114 push ax
[3]115
116;--------------------------------------------------------------------
[96]117; PrintValuesFromStack
[3]118; Parameters:
119; Stack: All formatting parameters
120; Returns:
121; Nothing
122; Corrupts registers:
[88]123; AX, SI, DI
[3]124;--------------------------------------------------------------------
[194]125.PrintValuesFromStack:
[241]126 jmp BootMenuPrint_HardDiskRefreshInformation.output
[96]127
Note: See TracBrowser for help on using the repository browser.