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

Last change on this file since 376 was 376, checked in by gregli@…, 12 years ago

WIDE checkin... Added copyright and license information to sorce files, as per the GPL instructions for usage.

File size: 4.3 KB
RevLine 
[88]1; Project name  :   XTIDE Universal BIOS
[3]2; Description   :   Functions for printing drive configuration
3;                   information on Boot Menu.
[376]4; 
[258]5; Included by BootMenuPrint.asm, this routine is to be inserted into
6; BootMenuPrint_HardDiskRefreshInformation.
7;
[376]8
9;
10; XTIDE Universal BIOS and Associated Tools 
11; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
12;
13; This program is free software; you can redistribute it and/or modify
14; it under the terms of the GNU General Public License as published by
15; the Free Software Foundation; either version 2 of the License, or
16; (at your option) any later version.
17; 
18; This program is distributed in the hope that it will be useful,
19; but WITHOUT ANY WARRANTY; without even the implied warranty of
20; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21; GNU General Public License for more details.
22; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html               
23;
24               
[3]25; Section containing code
26SECTION .text
27
[258]28;;; fall-into from BootMenuPrint_HardDiskRefreshInformation.
29
[3]30;--------------------------------------------------------------------
31; Prints Hard Disk configuration for drive handled by our BIOS.
32; Cursor is set to configuration header string position.
33;
34; BootMenuPrintCfg_ForOurDrive
35;   Parameters:
[241]36;       DS:DI:      Pointer to DPT
[3]37;   Returns:
38;       Nothing
39;   Corrupts registers:
[258]40;       AX, BX, CX, DX
[3]41;--------------------------------------------------------------------
[258]42.BootMenuPrintCfg_ForOurDrive:
[294]43    eMOVZX  ax, [di+DPT.bIdevarsOffset]
[258]44    xchg    bx, ax                      ; CS:BX now points to IDEVARS
[194]45    ; Fall to .PushAndFormatCfgString
[3]46
47;--------------------------------------------------------------------
[88]48; PushAddressingMode
[3]49;   Parameters:
50;       DS:DI:  Ptr to DPT
[258]51;       CS:BX:  Ptr to IDEVARS
[3]52;   Returns:
[88]53;       Nothing (jumps to next push below)
[3]54;   Corrupts registers:
[258]55;       AX, CX
[3]56;--------------------------------------------------------------------
[194]57.PushAddressingMode:
[200]58    AccessDPT_GetUnshiftedAddressModeToALZF
[294]59    ;;
60    ;; This multiply both shifts the addressing mode bits down to low order bits, and
[193]61    ;; at the same time multiplies by the size of the string displacement.  The result is in AH,
62    ;; with AL clear, and so we exchange AL and AH after the multiply for the final result.
[294]63    ;;
[258]64    mov     cl,(1<<(8-ADDRESSING_MODE_FIELD_POSITION)) * g_szAddressingModes_Displacement
65    mul     cl
[193]66    xchg    al,ah
[182]67    add     ax,g_szAddressingModes
68    push    ax
[294]69
[3]70;--------------------------------------------------------------------
[88]71; PushBlockMode
[3]72;   Parameters:
73;       DS:DI:  Ptr to DPT
[258]74;       CS:BX:  Ptr to IDEVARS
[3]75;   Returns:
76;       Nothing (falls to next push below)
77;   Corrupts registers:
[88]78;       AX
[3]79;--------------------------------------------------------------------
[194]80.PushBlockMode:
[150]81    mov     ax, 1
[158]82    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
[150]83    jz      SHORT .PushBlockSizeFromAX
[365]84    mov     al, [di+DPT_ATA.bBlockSize]
[150]85.PushBlockSizeFromAX:
[3]86    push    ax
87
88;--------------------------------------------------------------------
[88]89; PushBusType
[3]90;   Parameters:
91;       DS:DI:  Ptr to DPT
[258]92;       CS:BX:  Ptr to IDEVARS
[3]93;   Returns:
94;       Nothing (jumps to next push below)
95;   Corrupts registers:
96;       AX, DX
97;--------------------------------------------------------------------
[194]98.PushBusType:
[182]99    mov     al,g_szBusTypeValues_Displacement
[258]100    mul     BYTE [cs:bx+IDEVARS.bDevice]
[294]101
[186]102    shr     ax,1            ; divide by 2 since IDEVARS.bDevice is multiplied by 2
[294]103
[182]104    add     ax,g_szBusTypeValues
[294]105    push    ax
106
[3]107;--------------------------------------------------------------------
[88]108; PushIRQ
[3]109;   Parameters:
110;       DS:DI:  Ptr to DPT
[258]111;       CS:BX:  Ptr to IDEVARS
[3]112;   Returns:
113;       Nothing (falls to next push below)
114;   Corrupts registers:
[88]115;       AX, DX
[3]116;--------------------------------------------------------------------
[194]117.PushIRQ:
[294]118    mov     al, [cs:bx+IDEVARS.bIRQ]
[241]119    cbw
[3]120    push    ax
121
122;--------------------------------------------------------------------
[88]123; PushResetStatus
[3]124;   Parameters:
125;       DS:DI:  Ptr to DPT
[258]126;       CS:BX:  Ptr to IDEVARS
[3]127;   Returns:
[88]128;       Nothing (falls to next push below)
[3]129;   Corrupts registers:
[363]130;       AX, BX, DX, ES
[3]131;--------------------------------------------------------------------
[194]132.PushResetStatus:
[365]133    xor     ax, ax
134%ifdef MODULE_SERIAL
135    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
136    jnz     SHORT .AlwaysSuccess
137    mov     al, [di+DPT_ATA.bInitError]
138.AlwaysSuccess:
139%endif
140    push    ax
[3]141
[258]142;;; fall-out to BootMenuPrint_HardDiskRefreshInformation.
Note: See TracBrowser for help on using the repository browser.