Changeset 397 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src


Ignore:
Timestamp:
Apr 19, 2012, 11:11:41 AM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Cleaned some code concerning recent module changes.
  • Removed drive number translation flag from ROMVARS.
  • BOOTMENUINFO is now DRVDETECTINFO.
  • Makefile now builds tiny binary (XT build with minimal features).
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r395 r397  
    107107
    108108    ; Check if ROM boot (INT 18h) wanted
     109%ifdef MODULE_HOTKEYS
    109110    cmp     BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], ROM_BOOT_HOTKEY_SCANCODE
    110111    je      SHORT JumpToBootSector_or_RomBoot   ; CF clear so ROM boot
     112%endif
    111113
    112114    ; Try to boot from Primary boot drive (00h by default)
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r395 r397  
    211211;       ES:SI   Ptr to ATA information for the drive
    212212;       DS:     RAMVARS segment
    213 ;       ES:     BDA/Bootnfo segment
     213;       ES:     BDA segment
    214214;   Returns:
    215215;       Nothing
     
    220220    call    CreateDPT_FromAtaInformation
    221221    jc      SHORT DetectDrives_DriveNotFound
    222     call    BootMenuInfo_CreateForHardDisk
    223     jmp     SHORT DetectPrint_DriveNameFromBootnfoInESBX
     222    call    DriveDetectInfo_CreateForHardDisk
     223    jmp     SHORT DetectPrint_DriveNameFromDrvDetectInfoInESBX
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r395 r397  
    153153
    154154;--------------------------------------------------------------------
    155 ; DetectPrint_DriveNameFromBootnfoInESBX
    156 ;   Parameters:
    157 ;       ES:BX:  Ptr to BOOTMENUINFO (if drive found)
     155; DetectPrint_DriveNameFromDrvDetectInfoInESBX
     156;   Parameters:
     157;       ES:BX:  Ptr to DRVDETECTINFO (if drive found)
    158158;   Returns:
    159159;       Nothing
     
    161161;       AX, SI
    162162;--------------------------------------------------------------------
    163 DetectPrint_DriveNameFromBootnfoInESBX:
     163DetectPrint_DriveNameFromDrvDetectInfoInESBX:
    164164    push    di
    165165    push    bx
    166166
    167     lea     si, [bx+BOOTMENUINFO.szDrvName]
     167    lea     si, [bx+DRVDETECTINFO.szDrvName]
    168168    mov     bx, es
    169169    CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromBXSI
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r395 r397  
    5252    %include "IdeRegisters.inc"     ; For ATA Registers, flags and commands
    5353    %include "Int13h.inc"           ; Equates for INT 13h functions
    54 %ifdef MODULE_EBIOS
    55     %include "EBIOS.inc"            ; Equates for EBIOS functions
    56 %endif
    5754    %include "CustomDPT.inc"        ; For Disk Parameter Table
    5855    %include "RomVars.inc"          ; For ROMVARS and IDEVARS structs
    5956    %include "RamVars.inc"          ; For RAMVARS struct
    6057    %include "BootVars.inc"         ; For BOOTVARS struct
    61     %include "HotkeyBar.inc"        ; For Hotkeys
    62     %include "BootMenu.inc"         ; For Boot Menu
    6358    %include "IDE_8bit.inc"         ; For IDE 8-bit data port macros
    6459    %include "DeviceIDE.inc"        ; For IDE device equates
    65     %include "Vision.inc"           ; For QDI Vision QD65xx VLB IDE Controllers
     60
    6661
    6762
     
    7974    at  ROMVARS.szVersion,  db  ROM_VERSION_STRING
    8075
    81 ;;; For OR'ing into wFlags below
    82 ;;;
    83 %ifdef MODULE_SERIAL
    84     MAIN_FLG_MODULE_SERIAL  equ FLG_ROMVARS_MODULE_SERIAL
    85 %else
    86     MAIN_FLG_MODULE_SERIAL  equ 0
    87 %endif
    88 
    89 %ifdef MODULE_EBIOS
    90     MAIN_FLG_MODULE_EBIOS   equ FLG_ROMVARS_MODULE_EBIOS
    91 %else
    92     MAIN_FLG_MODULE_EBIOS   equ 0
    93 %endif
    94 
    95 %ifdef MODULE_JRIDE
    96     MAIN_FLG_MODULE_JRIDE   equ FLG_ROMVARS_MODULE_JRIDE
    97 %else
    98     MAIN_FLG_MODULE_JRIDE   equ 0
    99 %endif
    100 
    101 %ifdef MODULE_ADVANCED_ATA
    102     MAIN_FLG_MODULE_ADVATA  equ FLG_ROMVARS_MODULE_ADVATA
    103 %else
    104     MAIN_FLG_MODULE_ADVATA  equ 0
    105 %endif
    106 
    107 
    10876;---------------------------;
    10977; AT Build default settings ;
    11078;---------------------------;
    11179%ifdef USE_AT
    112     at  ROMVARS.wFlags,         dw  FLG_ROMVARS_FULLMODE | FLG_ROMVARS_DRVXLAT | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_JRIDE | MAIN_FLG_MODULE_ADVATA
     80    at  ROMVARS.wFlags,         dw  FLG_ROMVARS_FULLMODE | MASK_ROMVARS_INCLUDED_MODULES
    11381    at  ROMVARS.wDisplayMode,   dw  DEFAULT_TEXT_MODE
    114     at  ROMVARS.wBootTimeout,   dw  BOOT_MENU_DEFAULT_TIMEOUT
     82%ifdef MODULE_BOOT_MENU
     83        at  ROMVARS.wBootTimeout,   dw  BOOT_MENU_DEFAULT_TIMEOUT
     84%endif
    11585    at  ROMVARS.bIdeCnt,        db  4                       ; Number of supported controllers
    11686    at  ROMVARS.bBootDrv,       db  80h                     ; Boot Menu default drive
     
    154124; XT and XT+ Build default settings ;
    155125;-----------------------------------;
    156     at  ROMVARS.wFlags,         dw  FLG_ROMVARS_DRVXLAT | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_JRIDE | MAIN_FLG_MODULE_ADVATA
     126    at  ROMVARS.wFlags,         dw  MASK_ROMVARS_INCLUDED_MODULES
    157127    at  ROMVARS.wDisplayMode,   dw  DEFAULT_TEXT_MODE
    158     at  ROMVARS.wBootTimeout,   dw  BOOT_MENU_DEFAULT_TIMEOUT
     128%ifdef MODULE_BOOT_MENU
     129        at  ROMVARS.wBootTimeout,   dw  BOOT_MENU_DEFAULT_TIMEOUT
     130%endif
    159131    at  ROMVARS.bIdeCnt,        db  1                       ; Number of supported controllers
    160132    at  ROMVARS.bBootDrv,       db  80h                     ; Boot Menu default drive
     
    165137    at  ROMVARS.ideVars0+IDEVARS.wPort,         dw  DEVICE_XTIDE_DEFAULT_PORT           ; Controller Command Block base port
    166138    at  ROMVARS.ideVars0+IDEVARS.wPortCtrl,     dw  DEVICE_XTIDE_DEFAULT_PORTCTRL       ; Controller Control Block base port
    167 %ifdef MODULE_JRIDE
    168     at  ROMVARS.ideVars0+IDEVARS.bDevice,       db  DEVICE_JRIDE_ISA
    169 %else
    170139    at  ROMVARS.ideVars0+IDEVARS.bDevice,       db  DEVICE_XTIDE_REV1
    171 %endif
    172     at  ROMVARS.ideVars0+IDEVARS.bIRQ,          db  0               ; IRQ
    173140    at  ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags,  db  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE
    174141    at  ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags,   db  DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE
     
    221188    %include "AccessDPT.asm"        ; For accessing DPTs
    222189    %include "LbaAssist.asm"        ; For generating L-CHS parameters to LBA drives
    223     %include "BootMenuInfo.asm"     ; For creating BOOTMENUINFO structs
     190    %include "DrvDetectInfo.asm"    ; For creating DRVDETECTINFO structs
    224191    %include "AtaID.asm"            ; For ATA Identify Device information
    225192    %include "DetectDrives.asm"     ; For detecting IDE drives
  • trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm

    r392 r397  
    4242    jc      .notOurs
    4343
    44     call    BootMenuInfo_ConvertDPTtoBX
     44    call    DriveDetectInfo_ConvertDPTtoBX
    4545    mov     si, g_szDriveNumBOOTNFO                 ; special g_szDriveNum that prints from BDA
    4646    jmp     .go
     
    186186.HardDiskMenuitemInfoForOurDrive:
    187187    ePUSH_T ax, g_szInformation                         ; Add substring for our hard disk information
    188     call    BootMenuInfo_GetTotalSectorCount            ; Get Total LBA Size
     188    call    GetTotalSectorCount
    189189    jmp     .ConvertSectorCountInBXDXAXtoSizeAndPushForFormat
    190190
     
    218218    db      2880  / FloppyTypes.rgbCapacityMultiplier    ;  type 5
    219219    db      2880  / FloppyTypes.rgbCapacityMultiplier    ;  type 6
     220
     221
     222;--------------------------------------------------------------------
     223; GetTotalSectorCount
     224;   Parameters:
     225;       DS:DI:      DPT Pointer
     226;   Returns:
     227;       BX:DX:AX:   48-bit sector count
     228;   Corrupts registers:
     229;       CX
     230;--------------------------------------------------------------------
     231GetTotalSectorCount:
     232    test    BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
     233    jnz     SHORT .ReturnFullCapacity
     234    jmp     AH15h_GetSectorCountToBXDXAX
     235.ReturnFullCapacity:
     236    jmp     AccessDPT_GetLbaSectorCountToBXDXAX
  • trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm

    r395 r397  
    3333ALIGN JUMP_ALIGN
    3434DriveXlate_ToOrBack:
    35     test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_DRVXLAT
    36     jz      SHORT .Return           ; Return if translation disabled
    3735    xchg    di, ax                  ; Backup AX
    3836
     
    5755.RestoreAXandReturn:
    5856    xchg    ax, di                  ; Restore AX
    59 ALIGN JUMP_ALIGN, ret
    60 .Return:
    6157    ret
    6258
     
    7369;       Nothing
    7470;--------------------------------------------------------------------
    75 ALIGN JUMP_ALIGN
    7671DriveXlate_Reset:
    7772    mov     WORD [RAMVARS.xlateVars+XLATEVARS.wFDandHDswap], 8000h
     
    9186;       Nothing
    9287;--------------------------------------------------------------------
    93 ALIGN JUMP_ALIGN
    9488DriveXlate_SetDriveToSwap:
    9589    test    dl, dl              ; Floppy drive?
    96     js      SHORT .SetHardDiskToSwap
    97 .SetFloppyDriveToSwap:
     90    js      SHORT .SetHardDriveToSwap
     91
     92    ; Set Floppy Drive to swap
    9893    mov     [RAMVARS.xlateVars+XLATEVARS.bFDSwap], dl
    9994    ret
    100 ALIGN JUMP_ALIGN
    101 .SetHardDiskToSwap:
     95
     96.SetHardDriveToSwap:
    10297    mov     [RAMVARS.xlateVars+XLATEVARS.bHDSwap], dl
    10398    ret
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm

    r395 r397  
    3333BootVars_Initialize:
    3434    ; Clear to zero
    35     mov     al, BOOTMENUINFO_size
     35    mov     al, DRVDETECTINFO_size
    3636    mul     BYTE [cs:ROMVARS.bIdeCnt]
    37     mov     di, BOOTVARS.hotkeyVars ; We must not initialize anything before this!
     37    mov     di, BOOTVARS.clearToZeroFromThisPoint   ; We must not initialize anything before this!
    3838    add     ax, BOOTVARS_size
    3939    sub     ax, di
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/DrvDetectInfo.asm

    r395 r397  
    2323
    2424;--------------------------------------------------------------------
    25 ; Creates new BOOTMENUINFO struct for detected hard disk.
     25; Creates new DRVDETECTINFO struct for detected hard disk.
    2626;
    27 ; BootMenuInfo_CreateForHardDisk
     27; DriveDetectInfo_CreateForHardDisk
    2828;   Parameters:
    2929;       DL:     Drive number
     
    3131;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    3232;   Returns:
    33 ;       ES:BX:  Ptr to BOOTMENUINFO (if successful)
     33;       ES:BX:  Ptr to DRVDETECTINFO (if successful)
    3434;   Corrupts registers:
    3535;       AX, BX, CX, DX, DI
    3636;--------------------------------------------------------------------
    37 BootMenuInfo_CreateForHardDisk:
    38     call    BootMenuInfo_ConvertDPTtoBX         ; ES:BX now points to new BOOTMENUINFO
     37DriveDetectInfo_CreateForHardDisk:
     38    call    DriveDetectInfo_ConvertDPTtoBX      ; ES:BX now points to new DRVDETECTINFO
    3939
    4040    ; Store Drive Name
     
    4646
    4747    add     si, BYTE ATA1.strModel              ; DS:SI now points drive name
    48     lea     di, [bx+BOOTMENUINFO.szDrvName]     ; ES:DI now points to name destination
     48    lea     di, [bx+DRVDETECTINFO.szDrvName]        ; ES:DI now points to name destination
    4949    mov     cx, MAX_HARD_DISK_NAME_LENGTH / 2   ; Max number of WORDs allowed
    5050.CopyNextWord:
     
    6363
    6464;--------------------------------------------------------------------
    65 ; BootMenuInfo_GetTotalSectorCount
    66 ;   Parameters:
    67 ;       DS:DI:      DPT Pointer
    68 ;   Returns:
    69 ;       BX:DX:AX:   48-bit sector count
    70 ;   Corrupts registers:
    71 ;       CX
    72 ;--------------------------------------------------------------------
    73 %ifdef MODULE_BOOT_MENU
    74 BootMenuInfo_GetTotalSectorCount:
    75     test    BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA
    76     jnz     SHORT .ReturnFullCapacity
    77     jmp     AH15h_GetSectorCountToBXDXAX
    78 .ReturnFullCapacity:
    79     jmp     AccessDPT_GetLbaSectorCountToBXDXAX
    80 %endif
    81 
    82 
    83 ;--------------------------------------------------------------------
    84 ; Returns offset to BOOTMENUINFO based on DPT pointer.
     65; Returns offset to DRVDETECTINFO based on DPT pointer.
    8566;
    86 ; BootMenuInfo_ConvertDPTtoBX
     67; DriveDetectInfo_ConvertDPTtoBX
    8768;   Parameters:
    8869;       DS:DI:  DPT Pointer
    8970;   Returns:
    90 ;       BX:     Offset to BOOTMENUINFO struct
     71;       BX:     Offset to DRVDETECTINFO struct
    9172;   Corrupts registers:
    9273;       AX
    9374;--------------------------------------------------------------------
    94 BootMenuInfo_ConvertDPTtoBX:
     75DriveDetectInfo_ConvertDPTtoBX:
    9576    mov     ax, di
    9677    sub     ax, BYTE RAMVARS_size                   ; subtract off base of DPTs
    97     mov     bl, DPT_BOOTMENUINFO_SIZE_MULTIPLIER    ; BOOTMENUINFO's are a whole number multiple of DPT size
     78    mov     bl, DPT_DRVDETECTINFO_SIZE_MULTIPLIER   ; DRVDETECTINFO are a whole number multiple of DPT size
    9879    mul     bl                             
    99     add     ax, BOOTVARS.rgBootNfo                  ; add base of BOOTMENUINFO
     80    add     ax, BOOTVARS.rgDrvDetectInfo            ; add base of DRVDETECTINFO
    10081    xchg    ax, bx
    10182    ret
Note: See TracChangeset for help on using the changeset viewer.