Changeset 397 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS


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
Files:
13 edited
1 moved

Legend:

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

    r392 r397  
    3232
    3333
    34 ; Boot Menu Information Table. These are generated for all XTIDE Universal
    35 ; BIOS drives. Available only until boot is successful.
    36 MAX_HARD_DISK_NAME_LENGTH               EQU     30      ; Bytes reserved for drive name
    37 
    38 struc BOOTMENUINFO
    39     .szDrvName              resb    MAX_HARD_DISK_NAME_LENGTH
    40                             resb    2   ; Zero word (ensures string terminates)
    41     .wInitErrorFlags        resb    2   ; Errors during initialization
    42    
    43 %ifdef MODULE_ADVANCED_ATA
    44                             resb    6   ; padding to make BOOTMENUINFO size an even multiple of DPT size
    45 %else
    46                             resb    2   ; padding to make BOOTMENUINFO size an even multiple of DPT size
    47 %endif             
    48 endstruc
    49 
    50 
    51 DPT_BOOTMENUINFO_SIZE_MULTIPLIER  equ   BOOTMENUINFO_size / LARGEST_DPT_SIZE
    52 
    53 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    54 
    55 %if MAX_HARD_DISK_NAME_LENGTH % 2 <> 0
    56     %error "MAX_HARD_DISK_NAME_LENGTH needs to be a multiple of 2, memory is moved with word operations."
    57 %endif
    58 
    59 %if BOOTMENUINFO_size % LARGEST_DPT_SIZE <> 0
    60     %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."
    61 %endif
    62 
    63 %if BOOTMENUINFO.szDrvName <> 0
    64     %error "BOOTMENUINFO.szDrvName is assumed to be the first member of struc BOOTMENUINFO, in BootMenuPrint_RefreshItem"
    65 %endif
    66 
    67 %endif
    68 
    69 
    7034%endif ; BOOTMENU_INC
  • trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc

    r392 r397  
    2222%define BOOTVARS_INC
    2323
    24 
     24; Number of times to retry booting before accepting error
    2525BOOT_READ_RETRY_TIMES       EQU     3
    2626
     
    3636    .rgbMnuStack:
    3737    .dwPostStack        resb    4       ; POST stack pointer when entering INT 19h
     38
     39    .clearToZeroFromThisPoint:
     40%ifdef MODULE_HOTKEYS
    3841    .hotkeyVars         resb    HOTKEYVARS_size
    39     .rgBootNfo:                         ; Array containing BOOTNFO structs
     42%endif
     43   
     44    .rgDrvDetectInfo:                   ; Array containing DRVDETECTINFO structs
    4045endstruc
    4146
     47%ifdef MODULE_HOTKEYS
    4248struc HOTKEYVARS
    4349    .bScancode          resb    1       ; Function hotkey scancode
     
    5157FLG_HOTKEY_HD_FIRST     EQU     (1<<0)  ; First try to boot from HDD, then FDD
    5258
     59%endif ; MODULE_HOTKEY
     60
     61
     62
     63struc DRVDETECTINFO
     64    .szDrvName              resb    MAX_HARD_DISK_NAME_LENGTH
     65                            resb    2   ; Zero word (ensures string terminates)
     66    .wInitErrorFlags        resb    2   ; Errors during initialization
     67   
     68%ifdef MODULE_ADVANCED_ATA
     69                            resb    6   ; padding to make DRVDETECTINFO size an even multiple of DPT size
     70%else
     71                            resb    2   ; padding to make DRVDETECTINFO size an even multiple of DPT size
     72%endif             
     73endstruc
     74
     75; Boot Menu Information Table. These are generated for all XTIDE Universal
     76; BIOS drives. Available only until boot is successful.
     77MAX_HARD_DISK_NAME_LENGTH           EQU     30      ; Bytes reserved for drive name
     78DPT_DRVDETECTINFO_SIZE_MULTIPLIER   EQU     DRVDETECTINFO_size / LARGEST_DPT_SIZE
     79
     80
     81%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
     82
     83%if MAX_HARD_DISK_NAME_LENGTH % 2 <> 0
     84    %error "MAX_HARD_DISK_NAME_LENGTH needs to be a multiple of 2, memory is moved with word operations."
     85%endif
     86
     87%if DRVDETECTINFO_size % LARGEST_DPT_SIZE <> 0
     88    %error "DRVDETECTINFO's size must be an even multiple of DPT's size.  Add or remove padding at the bottom of DRVDETECTINFO to bring the two sizes into alignment.  As DRVDETECTINFO is only used at boot time, with plenty of memory to consume, it is OK to waste some space here."
     89%endif
     90
     91%if DRVDETECTINFO.szDrvName <> 0
     92    %error "DRVDETECTINFO.szDrvName is assumed to be the first member of struc DRVDETECTINFO, in BootMenuPrint_RefreshItem"
     93%endif
     94
     95%endif
    5396
    5497
  • trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc

    r376 r397  
    8181endstruc
    8282
    83 ; Flags for BOOTMENUINFO.wInitErrorFlags
     83; Flags for DPT_ATA.bInitError
    8484FLG_INITERROR_FAILED_TO_SELECT_DRIVE                EQU     (1<<0)
    8585FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS   EQU     (1<<1)
  • trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc

    r395 r397  
    2525    %endif
    2626%endif
     27
     28
     29
     30; Include module specific .INC files
     31%ifdef MODULE_EBIOS
     32    %include "EBIOS.inc"            ; Equates for EBIOS functions
     33%endif
     34
     35%ifdef MODULE_HOTKEYS
     36    %include "HotkeyBar.inc"        ; For Hotkeys
     37    %ifdef MODULE_BOOT_MENU
     38        %include "BootMenu.inc"         ; For Boot Menu
     39    %endif
     40%endif
     41
     42%ifdef MODULE_ADVANCED_ATA
     43    %include "Vision.inc"           ; For QDI Vision QD65xx VLB IDE Controllers
     44%endif
     45
     46
     47; Included modules for ROMVARS.wFlags
     48%ifdef MODULE_ADVANCED_ATA
     49    MAIN_FLG_MODULE_ADVANCED_ATA    EQU FLG_ROMVARS_MODULE_ADVANCED_ATA
     50%else
     51    MAIN_FLG_MODULE_ADVANCED_ATA    EQU 0
     52%endif
     53
     54%ifdef MODULE_BOOT_MENU
     55    MAIN_FLG_MODULE_BOOT_MENU   EQU FLG_ROMVARS_MODULE_BOOT_MENU
     56%else
     57    MAIN_FLG_MODULE_BOOT_MENU   EQU 0
     58%endif
     59
     60%ifdef MODULE_EBIOS
     61    MAIN_FLG_MODULE_EBIOS   EQU FLG_ROMVARS_MODULE_EBIOS
     62%else
     63    MAIN_FLG_MODULE_EBIOS   EQU 0
     64%endif
     65
     66%ifdef MODULE_HOTKEYS
     67    MAIN_FLG_MODULE_HOTKEYS EQU FLG_ROMVARS_MODULE_HOTKEYS
     68%else
     69    MAIN_FLG_MODULE_HOTKEYS EQU 0
     70%endif
     71
     72%ifdef MODULE_JRIDE
     73    MAIN_FLG_MODULE_JRIDE   EQU FLG_ROMVARS_MODULE_JRIDE
     74%else
     75    MAIN_FLG_MODULE_JRIDE   EQU 0
     76%endif
     77
     78%ifdef MODULE_SERIAL
     79    MAIN_FLG_MODULE_SERIAL  EQU FLG_ROMVARS_MODULE_SERIAL
     80%else
     81    MAIN_FLG_MODULE_SERIAL  EQU 0
     82%endif
     83
     84%ifdef MODULE_SERIAL_FLOPPY
     85    MAIN_FLG_MODULE_SERIAL_FLOPPY   EQU FLG_ROMVARS_MODULE_SERIAL_FLOPPY
     86%else
     87    MAIN_FLG_MODULE_SERIAL_FLOPPY   EQU 0
     88%endif
     89
     90%ifdef MODULE_STRINGS_COMPRESSED
     91    MAIN_FLG_MODULE_STRINGS_COMPRESSED  EQU FLG_ROMVARS_MODULE_STRINGS_COMPRESSED
     92%else
     93    MAIN_FLG_MODULE_STRINGS_COMPRESSED  EQU 0
     94%endif
     95
     96MASK_ROMVARS_INCLUDED_MODULES   EQU MAIN_FLG_MODULE_ADVANCED_ATA | MAIN_FLG_MODULE_BOOT_MENU | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_HOTKEYS | MAIN_FLG_MODULE_JRIDE | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_SERIAL_FLOPPY | MAIN_FLG_MODULE_STRINGS_COMPRESSED
  • trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc

    r392 r397  
    6666; Bit defines for ROMVARS.wFlags
    6767FLG_ROMVARS_FULLMODE                EQU (1<<0)  ; Full operating mode (steals base RAM, supports EBIOS etc.)
    68 FLG_ROMVARS_DRVXLAT                 EQU (1<<2)  ; Enable drive number translation
    6968FLG_ROMVARS_SERIAL_SCANDETECT       EQU (1<<3)  ; Scan COM ports at the end of drive detection.  Can also be invoked
    7069                                                ; by holding down the ALT key at the end of drive detection.
    7170                                                ; (Conveniently, this is 8, a fact we exploit when testing the bit)
    72 FLG_ROMVARS_MODULE_ADVATA           EQU (1<<4)  ; Here in case the configuration needs to know functionality is present
    73 FLG_ROMVARS_MODULE_JRIDE            EQU (1<<5)  ; Here in case the configuration needs to know functionality is present
    74 FLG_ROMVARS_MODULE_SERIAL           EQU (1<<6)  ; Here in case the configuration needs to know functionality is present
    75 FLG_ROMVARS_MODULE_EBIOS            EQU (1<<7)  ; Here in case the configuration needs to know functionality is present
     71
     72FLG_ROMVARS_MODULE_ADVANCED_ATA         EQU (1<<8)  ; Here in case the configuration needs to know functionality is present
     73FLG_ROMVARS_MODULE_BOOT_MENU            EQU (1<<9)  ; Here in case the configuration needs to know functionality is present
     74FLG_ROMVARS_MODULE_EBIOS                EQU (1<<10) ; Here in case the configuration needs to know functionality is present
     75FLG_ROMVARS_MODULE_HOTKEYS              EQU (1<<11) ; Here in case the configuration needs to know functionality is present
     76FLG_ROMVARS_MODULE_JRIDE                EQU (1<<12) ; Here in case the configuration needs to know functionality is present
     77FLG_ROMVARS_MODULE_SERIAL               EQU (1<<13) ; Here in case the configuration needs to know functionality is present
     78FLG_ROMVARS_MODULE_SERIAL_FLOPPY        EQU (1<<14) ; Here in case the configuration needs to know functionality is present
     79FLG_ROMVARS_MODULE_STRINGS_COMPRESSED   EQU (1<<15) ; Here in case the configuration needs to know functionality is present
     80
    7681
    7782; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes)
  • 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
  • trunk/XTIDE_Universal_BIOS/makefile

    r395 r397  
    9191#################################################################
    9292DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_EBIOS
    93 
    94 DEFINES_XT = ELIMINATE_CGA_SNOW MODULE_SERIAL MODULE_SERIAL_FLOPPY
    95 DEFINES_XTPLUS = USE_186 ELIMINATE_CGA_SNOW MODULE_SERIAL MODULE_SERIAL_FLOPPY
    96 DEFINES_AT = USE_AT USE_286 MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_ADVANCED_ATA
    97 
    98 DEFINES_XT_LARGE = $(DEFINES_XT) MODULE_BOOT_MENU MODULE_JRIDE MODULE_ADVANCED_ATA
    99 DEFINES_XTPLUS_LARGE = $(DEFINES_XTPLUS) MODULE_BOOT_MENU MODULE_JRIDE MODULE_ADVANCED_ATA
    100 DEFINES_AT_LARGE = $(DEFINES_AT) MODULE_BOOT_MENU MODULE_JRIDE MODULE_ADVANCED_ATA
    101 
    102 DEFINES_JRIDE_8K = ELIMINATE_CGA_SNOW MODULE_JRIDE
    103 DEFINES_386_8K = USE_AT USE_386 MODULE_ADVANCED_ATA
     93DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_JRIDE MODULE_SERIAL MODULE_SERIAL_FLOPPY
     94
     95DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_JRIDE MODULE_SERIAL MODULE_SERIAL_FLOPPY
     96DEFINES_XTPLUS = $(DEFINES_COMMON) $(DEFINES_XT) USE_186
     97DEFINES_AT = $(DEFINES_COMMON) USE_AT USE_286 MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_ADVANCED_ATA
     98
     99DEFINES_XT_LARGE = $(DEFINES_XT) $(DEFINES_COMMON_LARGE)
     100DEFINES_XTPLUS_LARGE = $(DEFINES_XTPLUS) $(DEFINES_COMMON_LARGE)
     101DEFINES_AT_LARGE = $(DEFINES_AT) $(DEFINES_COMMON_LARGE)
     102
     103DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED
     104DEFINES_386_8K = $(DEFINES_AT) USE_386
    104105
    105106
     
    113114
    114115# Add -D in front of every preprocessor define declaration
    115 DEFS = $(DEFINES_COMMON:%=-D%)
    116116DEFS_XT = $(DEFINES_XT:%=-D%) -DROMSIZE=$(ROMSIZE)
    117117DEFS_XTPLUS = $(DEFINES_XTPLUS:%=-D%) -DROMSIZE=$(ROMSIZE)
     
    120120DEFS_XTPLUS_LARGE = $(DEFINES_XTPLUS_LARGE:%=-D%) -DROMSIZE=$(ROMSIZE_LARGE)
    121121DEFS_AT_LARGE = $(DEFINES_AT_LARGE:%=-D%) -DROMSIZE=$(ROMSIZE_LARGE)
    122 DEFS_JRIDE_8K = $(DEFINES_JRIDE_8K:%=-D%) -DROMSIZE=$(ROMSIZE)
     122DEFS_XT_TINY = $(DEFINES_XT_TINY:%=-D%) -DROMSIZE=$(ROMSIZE)
    123123DEFS_386_8K = $(DEFINES_386_8K:%=-D%) -DROMSIZE=$(ROMSIZE)
    124124
     
    149149# Assembly compiler flags
    150150ASFLAGS = -f bin                # Produce binary object files
    151 ASFLAGS += $(DEFS)              # Preprocessor defines
    152151ASFLAGS += $(IHEADERS)          # Set header file directory paths
    153152ASFLAGS += -Worphan-labels      # Warn about labels without colon
     
    162161    @echo All done!
    163162
    164 small: at xtplus xt jride_8k 386_8k
     163small: xt_tiny xt xtplus at 386_8k
    165164    @echo All 8 kiB binaries built!
    166165
    167 large: at_large xtplus_large xt_large
     166large: xt_large xtplus_large at_large
    168167    @echo All 15 kiB binaries built!
    169168
     
    192191    @echo *15k XT version "$(TARGET)_xtl.bin" built.
    193192
    194 jride_8k:
    195     @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_JRIDE_8K) -l"$(TARGET)_jr8k.lst" -o"$(TARGET)_jr8k.bin"
    196     @echo * 8k JR-IDE/ISA version "$(TARGET)_jr8k.bin" built.
     193xt_tiny:
     194    @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT_TINY) -l"$(TARGET)_tiny.lst" -o"$(TARGET)_tiny.bin"
     195    @echo * Tiny XT version "$(TARGET)_tiny.bin" built.
    197196
    198197386_8k:
     
    210209
    211210checksum: all
     211    @perl ..\tools\checksum.pl $(TARGET)_tiny.bin $(ROMSIZE)
     212    @perl ..\tools\checksum.pl $(TARGET)_xt.bin $(ROMSIZE)
     213    @perl ..\tools\checksum.pl $(TARGET)_xtp.bin $(ROMSIZE)
     214    @perl ..\tools\checksum.pl $(TARGET)_at.bin $(ROMSIZE)
     215    @perl ..\tools\checksum.pl $(TARGET)_xtl.bin $(ROMSIZE_LARGE)
     216    @perl ..\tools\checksum.pl $(TARGET)_xtpl.bin $(ROMSIZE_LARGE)
    212217    @perl ..\tools\checksum.pl $(TARGET)_atl.bin $(ROMSIZE_LARGE)
    213     @perl ..\tools\checksum.pl $(TARGET)_xtpl.bin $(ROMSIZE_LARGE)
    214     @perl ..\tools\checksum.pl $(TARGET)_xtl.bin $(ROMSIZE_LARGE)
    215     @perl ..\tools\checksum.pl $(TARGET)_at.bin $(ROMSIZE)
    216     @perl ..\tools\checksum.pl $(TARGET)_xtp.bin $(ROMSIZE)
    217     @perl ..\tools\checksum.pl $(TARGET)_xt.bin $(ROMSIZE)
    218     @perl ..\tools\checksum.pl $(TARGET)_jr8k.bin $(ROMSIZE)
    219218    @perl ..\tools\checksum.pl $(TARGET)_386.bin $(ROMSIZE)
    220219
Note: See TracChangeset for help on using the changeset viewer.