Changeset 254 in xtideuniversalbios


Ignore:
Timestamp:
Feb 18, 2012, 2:51:54 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Changed BOOTNFO to BOOTMENUINFO and moved it to BootMenu.inc.
Location:
trunk/XTIDE_Universal_BIOS
Files:
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/BootMenu.inc

    r127 r254  
    11; Project name  :   XTIDE Universal BIOS
    2 ; Description   :   Equates used in Boot Menu.
     2; Description   :   Equates and structs used in Boot Menu.
    33%ifndef BOOTMENU_INC
    44%define BOOTMENU_INC
     
    1717
    1818
     19; Boot Menu Information Table. These are generated for all XTIDE Universal
     20; BIOS drives. Available only until boot is successfull.
     21MAX_HARD_DISK_NAME_LENGTH               EQU     26      ; Bytes reserved for drive name
     22
     23struc BOOTMENUINFO
     24    .szDrvName      resb    MAX_HARD_DISK_NAME_LENGTH
     25                    resb    2       ; Zero word (ensures string terminates)
     26                    resb    8       ; padding to make BOOTMENUINFO size an even multiple of DPT size
     27endstruc
     28
     29DPT_BOOTMENUINFO_SIZE_MULTIPLIER  equ   BOOTMENUINFO_size / LARGEST_DPT_SIZE
     30
     31%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS               
     32
     33%if BOOTMENUINFO_size % LARGEST_DPT_SIZE <> 0
     34%error "BOOTMENUINFO's size must be an even multiple of DPT's size.  Add or remove padding at the bottom of BOOTMENUINFO to bring the two sizes into alignment.  As BOOTMENUINFO is only used at boot time, with plenty of memory to consume, it is OK to waste some space here."
     35%endif
     36
     37%if BOOTMENUINFO.szDrvName <> 0
     38%error "BOOTMENUINFO.szDrvName is assumed to be the first member of struc BOOTMENUINFO, in BootMenuPrint_RefreshItem"
     39%endif
     40
     41%endif
     42
     43
    1944%endif ; BOOTMENU_INC
  • trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc

    r252 r254  
    88BOOT_READ_RETRY_TIMES       EQU     3
    99
    10 
    11 ; Boot Menu Information Table. These are generated for all XTIDE Universal
    12 ; BIOS drives. Available only until boot is successfull.
    13 LEN_BOOTNFO_DRV     EQU     26      ; Bytes reserved for drive name
    14 struc BOOTNFO
    15     .szDrvName      resb    LEN_BOOTNFO_DRV     ; Drive name
    16                     resb    2       ; Zero word (ensures string terminates)
    17                     resb    8       ; padding to make BOOTNFO size an even multiple of DPT size
    18 endstruc
    19 
    20 DPT_BOOTNFO_SIZE_MULTIPLIER  equ    BOOTNFO_size / LARGEST_DPT_SIZE
    21 
    22 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS               
    23 
    24 %if BOOTNFO_size % LARGEST_DPT_SIZE <> 0
    25 %error "BOOTNFO's size must be an even multiple of DPT's size.  Add or remove padding at the bottom of BOOTNFO to bring the two sizes into alignment.  As BOOTNFO is only used at boot time, with plenty of memory to consume, it is OK to waste some space here."
    26 %endif
    27 
    28 %if BOOTNFO.szDrvName <> 0
    29 %error "BOOTNFO.szDrvName is assumed to be the first member of struc BOOTNFO, in BootMenuPrint_RefreshItem"
    30 %endif
    31 
    32 %endif
    3310
    3411
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuInfo.asm

    r253 r254  
    77
    88;--------------------------------------------------------------------
    9 ; Creates new BOOTNFO struct for detected hard disk.
     9; Creates new BOOTMENUINFO struct for detected hard disk.
    1010;
    11 ; BootInfo_CreateForHardDisk
     11; BootMenuInfo_CreateForHardDisk
    1212;   Parameters:
    1313;       DL:     Drive number
     
    1515;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    1616;   Returns:
    17 ;       ES:BX:  Ptr to BOOTNFO (if successful)
     17;       ES:BX:  Ptr to BOOTMENUINFO (if successful)
    1818;   Corrupts registers:
    19 ;       AX, BX, CX, DX, DI, SI
     19;       AX, BX, CX, DX, DI
    2020;--------------------------------------------------------------------
    21 BootInfo_CreateForHardDisk:
    22     call    BootInfo_ConvertDPTtoBX     ; ES:BX now points to new BOOTNFO
    23     push    bx                          ; Preserve for return
     21BootMenuInfo_CreateForHardDisk:
     22    call    BootMenuInfo_ConvertDPTtoBX         ; ES:BX now points to new BOOTMENUINFO
     23    push    bx                                  ; Preserve for return
    2424
    25     mov     di, bx                      ; Starting pointer at beginning of structure
     25    mov     di, bx                              ; Starting pointer at beginning of structure
    2626
    27 ;
    28 ; Store Drive Name
    29 ;       
    30     push    ds                          ; Preserve RAMVARS
    31     push    si                          ; Preserve SI for call to GetTotalSectorCount...
     27    ; Store Drive Name
     28    push    ds                                  ; Preserve RAMVARS
     29    push    si
    3230
    33     push    es                          ; ES copied to DS
     31    push    es                                  ; ES copied to DS
    3432    pop     ds
    3533
    36     add     si, BYTE ATA1.strModel      ; DS:SI now points drive name
    37     lea     di, [bx+BOOTNFO.szDrvName]  ; ES:DI now points to name destination
    38     mov     cx, LEN_BOOTNFO_DRV / 2     ; Max number of WORDs allowed
     34    add     si, BYTE ATA1.strModel              ; DS:SI now points drive name
     35    lea     di, [bx+BOOTMENUINFO.szDrvName]     ; ES:DI now points to name destination
     36    mov     cx, MAX_HARD_DISK_NAME_LENGTH / 2   ; Max number of WORDs allowed
    3937.CopyNextWord:
    4038    lodsw
    41     xchg    al, ah                      ; Change endianness
     39    xchg    al, ah                              ; Change endianness
    4240    stosw
    4341    loop    .CopyNextWord
    44     xor     ax, ax                      ; Zero AX and clear CF
    45     stosw                               ; Terminate with NULL
     42    xor     ax, ax                              ; Zero AX and clear CF
     43    stosw                                       ; Terminate with NULL
    4644
    4745    pop     si
     
    5351
    5452;--------------------------------------------------------------------
    55 ; BootInfo_GetTotalSectorCount
     53; BootMenuInfo_GetTotalSectorCount
    5654;   Parameters:
    5755;       DS:DI:      DPT Pointer
     
    6260;--------------------------------------------------------------------
    6361ALIGN JUMP_ALIGN
    64 BootInfo_GetTotalSectorCount:
     62BootMenuInfo_GetTotalSectorCount:
    6563    test    BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
    6664    jnz     SHORT .ReturnFullCapacity
     
    7169
    7270;--------------------------------------------------------------------
    73 ; Returns offset to BOOTNFO based on DPT pointer.
     71; Returns offset to BOOTMENUINFO based on DPT pointer.
    7472;
    75 ; BootInfo_ConvertDPTtoBX
     73; BootMenuInfo_ConvertDPTtoBX
    7674;   Parameters:
    7775;       DS:DI:  DPT Pointer
    7876;   Returns:
    79 ;       BX:     Offset to BOOTNFO struct
     77;       BX:     Offset to BOOTMENUINFO struct
    8078;   Corrupts registers:
    8179;       AX
    8280;--------------------------------------------------------------------
    8381ALIGN JUMP_ALIGN
    84 BootInfo_ConvertDPTtoBX:
     82BootMenuInfo_ConvertDPTtoBX:
    8583    mov     ax, di
    86     sub     ax, RAMVARS_size                ; subtract off base of DPTs
    87     mov     bl, DPT_BOOTNFO_SIZE_MULTIPLIER ; BOOTNFO's are a whole number multiple of DPT size
     84    sub     ax, RAMVARS_size                        ; subtract off base of DPTs
     85    mov     bl, DPT_BOOTMENUINFO_SIZE_MULTIPLIER    ; BOOTMENUINFO's are a whole number multiple of DPT size
    8886    mul     bl                             
    89     add     ax, BOOTVARS.rgBootNfo          ; add base of BOOTNFO
     87    add     ax, BOOTVARS.rgBootNfo                  ; add base of BOOTMENUINFO
    9088    xchg    ax, bx
    9189    ret         
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm

    r252 r254  
    2727
    2828    call    FindDPT_ForDriveNumber                  ; if it is one of ours, print the string in bootnfo
    29     call    BootInfo_ConvertDPTtoBX
     29    call    BootMenuInfo_ConvertDPTtoBX
    3030    mov     si, g_szDriveNumBOOTNFO                 ; special g_szDriveNum that prints from BDA
    3131    jmp     .go
     
    197197
    198198    ; Get and push total LBA size
    199     call    BootInfo_GetTotalSectorCount
     199    call    BootMenuInfo_GetTotalSectorCount
    200200    call    ConvertSectorCountInBXDXAXtoSizeAndPushForFormat       
    201201    jmp     BootMenuPrintCfg_ForOurDrive
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r242 r254  
    143143    call    CreateDPT_FromAtaInformation
    144144    jc      SHORT DetectDrives_DriveNotFound
    145     call    BootInfo_CreateForHardDisk
     145    call    BootMenuInfo_CreateForHardDisk
    146146    jmp     short DetectPrint_DriveNameFromBootnfoInESBX
    147147
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r244 r254  
    105105; DetectPrint_DriveNameFromBootnfoInESBX
    106106;   Parameters:
    107 ;       ES:BX:  Ptr to BOOTNFO (if drive found)
     107;       ES:BX:  Ptr to BOOTMENUINFO (if drive found)
    108108;   Returns:
    109109;       Nothing
     
    115115    push    bx
    116116
    117     lea     si, [bx+BOOTNFO.szDrvName]
     117    lea     si, [bx+BOOTMENUINFO.szDrvName]
    118118    mov     bx, es
    119119    CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromBXSI
     
    123123    pop     di
    124124    ret
    125 
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r248 r254  
    2929    %include "RomVars.inc"          ; For ROMVARS and IDEVARS structs
    3030    %include "RamVars.inc"          ; For RAMVARS struct
    31     %include "BootVars.inc"         ; For BOOTVARS and BOOTNFO structs
     31    %include "BootVars.inc"         ; For BOOTVARS struct
    3232    %include "BootMenu.inc"         ; For Boot Menu
    3333    %include "IDE_8bit.inc"         ; For IDE 8-bit data port macros
     
    167167    %include "FindDPT.asm"          ; For finding DPTs
    168168    %include "AccessDPT.asm"        ; For accessing DPTs
    169     %include "BootInfo.asm"         ; For creating BOOTNFO structs
     169    %include "BootMenuInfo.asm"     ; For creating BOOTMENUINFO structs
    170170    %include "AtaID.asm"            ; For ATA Identify Device information
    171171    %include "DetectDrives.asm"     ; For detecting IDE drives
Note: See TracChangeset for help on using the changeset viewer.