source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm @ 526

Last change on this file since 526 was 526, checked in by krille_n_@…, 11 years ago

Changes:

  • Update of the copyright notices to include the year 2013.
File size: 5.0 KB
RevLine 
[392]1; Project name  :   XTIDE Universal BIOS
2; Description   :   Functions for printing drive configuration
3;                   information on Boot Menu.
[399]4;
[392]5; Included by BootMenuPrint.asm, this routine is to be inserted into
6; BootMenuPrint_HardDiskRefreshInformation.
7;
8
9;
[399]10; XTIDE Universal BIOS and Associated Tools
[526]11; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
[392]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.
[399]17;
[392]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.
[399]22; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
[392]23;
[399]24
[392]25; Section containing code
26SECTION .text
27
28;;; fall-into from BootMenuPrint_HardDiskRefreshInformation.
29
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:
36;       DS:DI:      Pointer to DPT
37;   Returns:
38;       Nothing
39;   Corrupts registers:
40;       AX, BX, CX, DX
41;--------------------------------------------------------------------
42.BootMenuPrintCfg_ForOurDrive:
43    eMOVZX  ax, [di+DPT.bIdevarsOffset]
44    xchg    bx, ax                      ; CS:BX now points to IDEVARS
[421]45    ; Fall to .PushAddressingMode
[392]46
47;--------------------------------------------------------------------
[421]48; .PushAddressingMode
[392]49;   Parameters:
50;       DS:DI:  Ptr to DPT
51;       CS:BX:  Ptr to IDEVARS
52;   Returns:
[491]53;       Nothing (falls to next push below)
[392]54;   Corrupts registers:
[421]55;       AX, CX, DX
[392]56;--------------------------------------------------------------------
57.PushAddressingMode:
[422]58    ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF
[392]59    ;;
60    ;; This multiply both shifts the addressing mode bits down to low order bits, and
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.
63    ;;
[422]64    mov     cx, g_szAddressingModes_Displacement << (8-TRANSLATEMODE_FIELD_POSITION)
[421]65    mul     cx
66    xchg    al, ah      ; AL = always zero after above multiplication
67    add     ax, g_szAddressingModes
[392]68    push    ax
[421]69    ; Fall to .PushBlockMode
[392]70
71;--------------------------------------------------------------------
[421]72; .PushBlockMode
[392]73;   Parameters:
74;       DS:DI:  Ptr to DPT
75;       CS:BX:  Ptr to IDEVARS
76;   Returns:
77;       Nothing (falls to next push below)
78;   Corrupts registers:
79;       AX
80;--------------------------------------------------------------------
81.PushBlockMode:
82    mov     ax, 1
83    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
84    jz      SHORT .PushBlockSizeFromAX
85    mov     al, [di+DPT_ATA.bBlockSize]
86.PushBlockSizeFromAX:
87    push    ax
[491]88    ; Fall to .PushDeviceType
[392]89
90;--------------------------------------------------------------------
[491]91; .PushDeviceType
[392]92;   Parameters:
93;       DS:DI:  Ptr to DPT
94;       CS:BX:  Ptr to IDEVARS
95;   Returns:
[491]96;       Nothing (falls to next push below)
[392]97;   Corrupts registers:
[491]98;       AX
[392]99;--------------------------------------------------------------------
[473]100.PushDeviceType:
[491]101%ifndef MODULE_SERIAL
102    mov     al, g_szDeviceTypeValues_Displacement
103    mul     BYTE [di+DPT_ATA.bDevice]
104%else
[473]105    mov     ah, [cs:bx+IDEVARS.bDevice]
[491]106    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE    ; Clears CF
[473]107    eCMOVZ  ah, [di+DPT_ATA.bDevice]    ; DPT_ATA contains up to date device information for IDE drives
[491]108%ifdef USE_UNDOC_INTEL
109    eSALC   ; Clear AL using CF (from TEST above)
110    eAAD    g_szDeviceTypeValues_Displacement
111%else
112    mov     al, g_szDeviceTypeValues_Displacement
[473]113    mul     ah
[491]114%endif ; USE_UNDOC_INTEL
115%endif ; MODULE_SERIAL
116
117%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
118    %if (COUNT_OF_ALL_IDE_DEVICES * 2 * g_szDeviceTypeValues_Displacement) > 255
119        %error "The USE_UNDOC_INTEL block in .PushDeviceType needs to be removed (would cause an overflow)!"
120    %endif
[473]121%endif
[392]122
[491]123    shr     ax, 1   ; Divide by 2 since IDEVARS.bDevice is multiplied by 2
[473]124    add     ax, g_szDeviceTypeValues
[392]125    push    ax
[491]126    ; Fall to .PushIRQ
[392]127
128;--------------------------------------------------------------------
[491]129; .PushIRQ
[392]130;   Parameters:
131;       DS:DI:  Ptr to DPT
132;       CS:BX:  Ptr to IDEVARS
133;   Returns:
134;       Nothing (falls to next push below)
135;   Corrupts registers:
[491]136;       AX
[392]137;--------------------------------------------------------------------
138.PushIRQ:
139    mov     al, [cs:bx+IDEVARS.bIRQ]
140    cbw
141    push    ax
[491]142    ; Fall to .PushResetStatus
[392]143
144;--------------------------------------------------------------------
[491]145; .PushResetStatus
[392]146;   Parameters:
147;       DS:DI:  Ptr to DPT
148;       CS:BX:  Ptr to IDEVARS
149;   Returns:
150;       Nothing (falls to next push below)
151;   Corrupts registers:
152;       AX, BX, DX, ES
153;--------------------------------------------------------------------
154.PushResetStatus:
[422]155    mov     al, [di+DPT.bInitError]
[392]156    push    ax
157
158;;; fall-out to BootMenuPrint_HardDiskRefreshInformation.
Note: See TracBrowser for help on using the repository browser.