Changeset 90 in xtideuniversalbios for trunk


Ignore:
Timestamp:
Jan 27, 2011, 11:31:31 AM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Removed INT 13h format and diagnostics functions.
  • Removed INT 18h callback handler.
  • Removed configuration for early/late initialization. Now XT builds always use late and AT build early initialization.
  • Reduced number of supported IDE controllers from 5 to 4.
  • Removed reserved configuration bytes.
  • Removed simple and system boot loaders.
Location:
trunk/XTIDE_Universal_BIOS
Files:
1 added
3 deleted
10 edited

Legend:

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

    r88 r90  
    2020struc BOOTVARS
    2121                    resb    800h
    22     .dwSys18h       resb    4       ;  800h, System INT 18h handler (Diskless boot, Boot failure)
    2322    .dwPostStack    resb    4       ;  804h, POST stack when entering INT 19h
    24                     resb    4
     23                    resb    8
    2524    .rgBootNfo      resb    73F4h   ;  80Ch, Array containing BOOTNFO structs
    2625    .rgbMnuStack:                   ; 7C00h and below, Boot Menu stack
  • trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc

    r88 r90  
    1 ; File name     :   RomVars.inc
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   23.3.2010
    4 ; Last update   :   1.5.2010
    5 ; Author        :   Tomi Tilli
     1; Project name  :   XTIDE Universal BIOS
    62; Description   :   Defines for ROMVARS struct containing variables stored
    73;                   in BIOS ROM.
     
    139    .wRomSign       resb    2   ; ROM Signature (AA55h)
    1410    .bRomSize       resb    1   ; ROM size in 512 byte blocks
    15     .rgbJump        resb    5   ; First instruction to ROM init (jmp)
    16     ; Offset 8 (8h) starts here
    17     .rgbDate        resb    8   ; BIOS build date string (mm/dd/yy)
    18     ; Offset 16 (10h) starts here
     11    .rgbJump        resb    3   ; First instruction to ROM init (jmp)
     12
    1913    .rgbSign        resb    8   ; Signature for XTIDE Configurator Program
    2014    .szTitle        resb    31  ; BIOS title string
    21     .szVersion      resb    25  ; BIOS version string
    22     ; Offset 80 (50h) starts here
     15    .szVersion      resb    23  ; BIOS version string
     16
    2317    .wFlags         resb    2   ; Word for ROM flags
    24     .bIdeCnt        resb    1   ; Number of supported IDE controllers
     18    .bIdeCnt        resb    1   ; Number of available IDE controllers
    2519    .bBootDrv       resb    1   ; Boot Menu default drive
    26                     resb    1   ; (Was boot menu maximum height)
    2720    .bBootDelay     resb    1   ; Boot Menu selection delay in seconds
    28     .bBootLdrType   resb    1   ; Boot Loader type
    2921    .bMinFddCnt     resb    1   ; Minimum number of Floppy Drives
    3022    .bStealSize     resb    1   ; Number of 1kB blocks stolen from 640kB base RAM
    31                     resb    7
    32     ; Offset 96 (60h) starts here
    33     ; Last IDEVARS must not start after offset FFh.
     23
    3424    .ideVars0       resb    IDEVARS_size
    3525    .ideVars1       resb    IDEVARS_size
    3626    .ideVars2       resb    IDEVARS_size
    3727    .ideVars3       resb    IDEVARS_size
    38     .ideVars4       resb    IDEVARS_size
    3928endstruc
    4029
    4130; Bit defines for ROMVARS.wFlags
    4231FLG_ROMVARS_FULLMODE    EQU (1<<0)  ; Full operating mode (steals base RAM, supports EBIOS etc.)
    43 FLG_ROMVARS_LATE        EQU (1<<1)  ; Late initialization
    4432FLG_ROMVARS_DRVXLAT     EQU (1<<2)  ; Enable drive number translation
    4533FLG_ROMVARS_ROMBOOT     EQU (1<<3)  ; Include ROMBOOT to boot menu
    46 FLG_ROMVARS_DRVNFO      EQU (1<<4)  ; Display drive info on boot menu
    4734FLG_ROMVARS_MAXSIZE     EQU (1<<5)  ; Maximize size by sacrificing compatibility with some old BIOSes
    48 
    49 ; Bootloader types for ROMVARS.bBootLdrType
    50 BOOTLOADER_TYPE_MENU    EQU (0<<1)  ; Display boot menu on boot loader
    51 BOOTLOADER_TYPE_SIMPLE  EQU (1<<1)  ; Simple bootloader without menu
    52 BOOTLOADER_TYPE_NONE    EQU (3<<1)  ; Do not install boot loader
    5335
    5436
     
    5941    .bBusType           resb    1   ; Bus type
    6042    .bIRQ               resb    1   ; Interrupt Request Number
    61                         resb    4   ; Reserved
    6243    .drvParamsMaster    resb    DRVPARAMS_size
    6344    .drvParamsSlave     resb    DRVPARAMS_size
     
    7455struc DRVPARAMS
    7556    .wFlags         resb    2   ; Drive flags
    76                     resb    2   ; Reserved
    7757    .wCylinders     resb    2   ; User specified cylinders (1...16383)
    7858    .wSectAndHeads:
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootVars.asm

    r84 r90  
    1 ; File name     :   BootVars.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   1.4.2010
    4 ; Last update   :   14.1.2011
    5 ; Author        :   Tomi Tilli,
    6 ;               :   Krister Nordvall (optimizations)
     1; Project name  :   XTIDE Universal BIOS
    72; Description   :   Functions to access BOOTVARS struct.
    83
     
    7772    sti                                 ; Enable interrupts
    7873    jmp     ax
    79 
    80 
    81 ;--------------------------------------------------------------------
    82 ; Backups system INT 18h ROM Boot / Boot Failure handler and
    83 ; installs our own for boot menu INT 18h callbacks.
    84 ;
    85 ; BootVars_StoreSystemInt18hAndInstallOurs
    86 ;   Parameters:
    87 ;       DS:     BDA and Interrupt Vector segment (zero)
    88 ;   Returns:
    89 ;       Nothing
    90 ;   Corrupts registers:
    91 ;       AX, BX, ES
    92 ;--------------------------------------------------------------------
    93 ALIGN JUMP_ALIGN
    94 BootVars_StoreSystemInt18hAndInstallOurs:
    95     mov     bx, INTV_BOOT_FAILURE*4     ; Offset to INT 18h vector
    96     les     ax, [bx]                    ; Load system INT 18h
    97     mov     [BOOTVARS.dwSys18h], ax
    98     mov     [BOOTVARS.dwSys18h+2], es
    99     mov     WORD [bx], Int18h_BootError ; Install our INT 18h
    100     mov     WORD [bx+2], cs
    101     ret
    102 
    103 
    104 ;--------------------------------------------------------------------
    105 ; Restores system INT 18h ROM Boot or Boot Error handler.
    106 ;
    107 ; BootVars_RestoreSystemInt18h
    108 ;   Parameters:
    109 ;       Nothing
    110 ;   Returns:
    111 ;       Nothing
    112 ;   Corrupts registers:
    113 ;       AX, DS, ES
    114 ;--------------------------------------------------------------------
    115 ALIGN JUMP_ALIGN
    116 BootVars_RestoreSystemInt18h:
    117     LOAD_BDA_SEGMENT_TO ds, ax
    118     les     ax, [BOOTVARS.dwSys18h]
    119     mov     [INTV_BOOT_FAILURE*4], ax
    120     mov     [INTV_BOOT_FAILURE*4+2], es
    121     ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm

    r84 r90  
    1 ; File name     :   Int13h_Jump.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   21.9.2007
    4 ; Last update   :   14.1.2011
    5 ; Author        :   Tomi Tilli,
    6 ;               :   Krister Nordvall (optimizations)
     1; Project name  :   XTIDE Universal BIOS
    72; Description   :   Int 13h BIOS functions (Floppy and Hard disk).
    83
     
    227222    dw  AH3h_HandlerForWriteDiskSectors                 ; 03h, Write Disk Sectors (All)
    228223    dw  AH4h_HandlerForVerifyDiskSectors                ; 04h, Verify Disk Sectors (All)
    229     dw  AH5h_HandlerForFormatDiskTrack                  ; 05h, Format Disk Track (XT, AT, EISA)
     224    dw  Int13h_UnsupportedFunction                      ; 05h, Format Disk Track (XT, AT, EISA)
    230225    dw  Int13h_UnsupportedFunction                      ; 06h, Format Disk Track with Bad Sectors (XT)
    231226    dw  Int13h_UnsupportedFunction                      ; 07h, Format Multiple Cylinders (XT)
     
    242237    dw  Int13h_UnsupportedFunction                      ; 12h, Controller RAM Diagnostic (XT)
    243238    dw  Int13h_UnsupportedFunction                      ; 13h, Drive Diagnostic (XT)
    244     dw  AH14h_HandlerForControllerInternalDiagnostic    ; 14h, Controller Internal Diagnostic (All)
     239    dw  Int13h_UnsupportedFunction                      ; 14h, Controller Internal Diagnostic (All)
    245240    dw  AH15h_HandlerForReadDiskDriveSize               ; 15h, Read Disk Drive Size (AT+)
    246241    dw  Int13h_UnsupportedFunction                      ; 16h,
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r84 r90  
    1 ; File name     :   Int19h.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   3.8.2007
    4 ; Last update   :   14.1.2011
    5 ; Author        :   Tomi Tilli,
    6 ;               :   Krister Nordvall (optimizations)
     1; Project name  :   XTIDE Universal BIOS
    72; Description   :   Int 19h BIOS functions (Boot Strap Loader).
    83
     
    127B_READ_RETRY_TIMES  EQU 3   ; Number of times to retry
    138
    14 
    15 ;--------------------------------------------------------------------
    16 ; Int 19h software interrupt handler for late initialization.
    17 ; Calls actual Int 19h after initialization is complete.
    18 ;
    19 ; Int19h_LateInitialization
    20 ;   Parameters:
    21 ;       Nothing
    22 ;   Returns:
    23 ;       Never returns
    24 ;--------------------------------------------------------------------
    25 ALIGN JUMP_ALIGN
    26 Int19h_LateInitialization:
    27     call    Initialize_ShouldSkip           ; Skip initialization?
    28     jc      SHORT .SkipInitialization
    29     call    Initialize_AndDetectDrives
    30     int     INTV_BOOTSTRAP                  ; Call actual boot loader
    31 .SkipInitialization:
    32     call    RamVars_Initialize              ; RAMVARS must be initialized even for simple boot loader
    33     ; Fall to Int19h_SimpleBootLoader
    34 
    35 ;--------------------------------------------------------------------
    36 ; Simple boot loader.
    37 ; Boot sequence is fixed to 00h, 80h and INT 18h.
    38 ;
    39 ; Int19h_SimpleBootLoader
    40 ;   Parameters:
    41 ;       Nothing
    42 ;   Returns:
    43 ;       Never returns
    44 ;--------------------------------------------------------------------
    45 ALIGN JUMP_ALIGN
    46 Int19h_SimpleBootLoader:
    47     sti                                     ; Enable interrupts
    48     call    RamVars_GetSegmentToDS
    49     xor     dx, dx
    50     call    Int19h_TryToLoadBootSectorFromDL
    51     jc      SHORT Int19h_JumpToBootSector
    52     mov     dl, 80h
    53     call    Int19h_TryToLoadBootSectorFromDL
    54     jc      SHORT Int19h_JumpToBootSector
    55     call    Int19h_BootFailure              ; Should never return       
    56     jmp     SHORT Int19h_SimpleBootLoader
    579
    5810;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hMenu.asm

    r3 r90  
    1 ; File name     :   Int19hMenu.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   25.3.2010
    4 ; Last update   :   12.4.2010
    5 ; Author        :   Tomi Tilli
     1; Project name  :   XTIDE Universal BIOS
    62; Description   :   Int 19h BIOS functions for Boot Menu.
    73
     
    2420    LOAD_BDA_SEGMENT_TO ds, ax
    2521    call    BootVars_StorePostStackPointer
    26     call    BootVars_StoreSystemInt18hAndInstallOurs
    2722
    2823    ; Install new INT 19h handler now that BOOTVARS has been initialized
     
    111106ALIGN JUMP_ALIGN
    112107.Int18hRomBoot:
    113     call    BootVars_RestoreSystemInt18h
    114108    call    BootVars_SwitchBackToPostStack
    115     call    Int19h_BootFailure          ; Should never return
    116     jmp     SHORT Int19hMenu_BootLoader ; Status unknown so reinitialize boot loader
     109    jmp     Int19h_BootFailure          ; Never returns
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r33 r90  
    1 ; File name     :   Initialize.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   23.3.2010
    4 ; Last update   :   23.8.2010
    5 ; Author        :   Tomi Tilli
     1; Project name  :   XTIDE Universal BIOS
    62; Description   :   Functions for initializing the BIOS.
    73
     
    2824    ePUSHA
    2925
     26    LOAD_BDA_SEGMENT_TO es, ax
    3027    call    Initialize_ShouldSkip
    31     jc      SHORT .ReturnFromRomInit
     28    jnz     SHORT .SkipRomInitialization
    3229
    33     ePUSH_T ax, .ReturnFromRomInit      ; Push return address
    34     test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_LATE
    35     jnz     SHORT Initialize_PrepareLateInitialization
    36     jmp     SHORT Initialize_AndDetectDrives
    37 
    38 ALIGN JUMP_ALIGN
    39 .ReturnFromRomInit:
     30%ifdef USE_AT   ; Early initialization on AT build
     31    call    Initialize_AndDetectDrives
     32%else           ; Late initialization on XT builds
     33    call    Int19hLate_InitializeInt19h
     34%endif
     35.SkipRomInitialization:
    4036    ePOPA
    4137    pop     ds
     
    5046; Initialize_ShouldSkip
    5147;   Parameters:
     48;       ES:     BDA segment
     49;   Returns:
     50;       ZF:     Cleared if ROM initialization is to be skipped
     51;               Set to continue ROM initialization
     52;   Corrupts registers:
    5253;       Nothing
    53 ;   Returns:
    54 ;       CF:     Set if ROM initialization is to be skipped
    55 ;               Cleared to continue ROM initialization
    56 ;   Corrupts registers:
    57 ;       AX, DS
    5854;--------------------------------------------------------------------
    5955ALIGN JUMP_ALIGN
    6056Initialize_ShouldSkip:
    61     sti                         ; Enable interrupts
    62     LOAD_BDA_SEGMENT_TO ds, ax
    63     mov     al, [BDA.bKBFlgs1]  ; Load shift flags
    64     eSHR_IM al, 3               ; Set CF if CTRL is held down
     57    sti                                     ; Enable interrupts
     58    test    BYTE [es:BDA.bKBFlgs1], (1<<2)  ; Clear ZF if CTRL is held down
    6559    ret
    66 
    67 
    68 ;--------------------------------------------------------------------
    69 ; Installs INT 19h boot loader handler for late initialization.
    70 ;
    71 ; Initialize_PrepareLateInitialization
    72 ;   Parameters:
    73 ;       Nothing
    74 ;   Returns:
    75 ;       Nothing
    76 ;   Corrupts registers:
    77 ;       BX, SI, ES
    78 ;--------------------------------------------------------------------
    79 ALIGN JUMP_ALIGN
    80 Initialize_PrepareLateInitialization:
    81     LOAD_BDA_SEGMENT_TO es, bx
    82     mov     bl, INTV_BOOTSTRAP
    83     mov     si, Int19h_LateInitialization
    84     jmp     Interrupts_InstallHandlerToVectorInBXFromCSSI
    8560
    8661
     
    9065; Initialize_AndDetectDrives
    9166;   Parameters:
    92 ;       Nothing
     67;       ES:     BDA Segment
    9368;   Returns:
    9469;       Nothing
     
    10176    call    RamVars_Initialize
    10277    call    RamVars_GetSegmentToDS
    103     LOAD_BDA_SEGMENT_TO es, ax
    10478    call    Interrupts_InitializeInterruptVectors
    10579    call    DetectDrives_FromAllIDEControllers
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm

    r86 r90  
    1 ; Project name  :   IDE BIOS
     1; Project name  :   XTIDE Universal BIOS
    22; Description   :   Functions for initializing the BIOS.
    33
     
    6666ALIGN JUMP_ALIGN
    6767Interrupts_InitializeInt19h:
    68     eMOVZX  bx, [cs:ROMVARS.bBootLdrType]   ; Load boot loader type
    69     mov     si, INTV_BOOTSTRAP              ; 19h
    70     xchg    bx, si                          ; SI=Loader type, BX=19h
    71     jmp     [cs:si+.rgwSetupBootLoader]     ; Jump to install selected loader
    72 ALIGN WORD_ALIGN
    73 .rgwSetupBootLoader:
    74     dw      .SetupBootMenuLoader        ; BOOTLOADER_TYPE_MENU
    75     dw      .SetupSimpleLoader          ; BOOTLOADER_TYPE_SIMPLE
    76     dw      .SetupBootMenuLoader        ; reserved
    77     dw      .NoBootLoader               ; BOOTLOADER_TYPE_NONE
    78 
    79 ALIGN JUMP_ALIGN
    80 .NoBootLoader:
    81     test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_LATE
    82     jnz     SHORT .SetupSimpleLoader    ; Boot loader required for late initialization
    83     ret
    84 ALIGN JUMP_ALIGN
    85 .SetupSimpleLoader:
    86     mov     si, Int19h_SimpleBootLoader
    87     jmp     Interrupts_InstallHandlerToVectorInBXFromCSSI
    88 ALIGN JUMP_ALIGN
    89 .SetupBootMenuLoader:
     68    mov     bx, INTV_BOOTSTRAP
    9069    mov     si, Int19hMenu_BootLoader
    9170    jmp     Interrupts_InstallHandlerToVectorInBXFromCSSI
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r88 r90  
    3838    at  ROMVARS.bRomSize,   db  CNT_ROM_BLOCKS  ; ROM size in 512B blocks
    3939    at  ROMVARS.rgbJump,    jmp Initialize_FromMainBiosRomSearch
    40     at  ROMVARS.rgbDate,    db  "01/27/11"      ; Build data (mm/dd/yy)
    4140    at  ROMVARS.rgbSign,    db  "XTIDE120"      ; Signature for flash program
    4241    at  ROMVARS.szTitle
     
    4948        db  " (XT)=-",NULL
    5049%endif
    51     at  ROMVARS.szVersion,  db  "v1.2.0_wip (01/27/11)",NULL
     50    at  ROMVARS.szVersion,  db  "v1.2.0_wip (01/27/11)",NULL    ; mm/dd/yy
    5251
    5352;---------------------------;
     
    5554;---------------------------;
    5655%ifdef USE_AT
    57     at  ROMVARS.wFlags,         dw  FLG_ROMVARS_FULLMODE | FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_DRVNFO | FLG_ROMVARS_MAXSIZE
     56    at  ROMVARS.wFlags,         dw  FLG_ROMVARS_FULLMODE | FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_MAXSIZE
    5857    at  ROMVARS.bIdeCnt,        db  3                       ; Number of supported controllers
    5958    at  ROMVARS.bBootDrv,       db  80h                     ; Boot Menu default drive
    6059    at  ROMVARS.bBootDelay,     db  30                      ; Boot Menu selection delay (secs)
    61     at  ROMVARS.bBootLdrType,   db  BOOTLOADER_TYPE_MENU    ; Boot loader type
    6260    at  ROMVARS.bMinFddCnt,     db  0                       ; Do not force minimum number of floppy drives
    6361    at  ROMVARS.bStealSize,     db  1                       ; Steal 1kB from base memory
     
    8785; XT and XT+ Build default settings ;
    8886;-----------------------------------;
    89     at  ROMVARS.wFlags,         dw  FLG_ROMVARS_LATE | FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_ROMBOOT | FLG_ROMVARS_DRVNFO | FLG_ROMVARS_MAXSIZE
     87    at  ROMVARS.wFlags,         dw  FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_ROMBOOT | FLG_ROMVARS_MAXSIZE
    9088    at  ROMVARS.bIdeCnt,        db  1                       ; Number of supported controllers
    9189    at  ROMVARS.bBootDrv,       db  80h                     ; Boot Menu default drive
    9290    at  ROMVARS.bBootDelay,     db  30                      ; Boot Menu selection delay (secs)
    93     at  ROMVARS.bBootLdrType,   db  BOOTLOADER_TYPE_MENU    ; Boot loader type
    9491    at  ROMVARS.bMinFddCnt,     db  1                       ; Assume at least 1 floppy drive present if autodetect fails
    9592    at  ROMVARS.bStealSize,     db  1                       ; Steal 1kB from base memory in full mode
     
    143140; Include .asm files (Interrupt handlers)
    144141%include "Int13h.asm"           ; For Int 13h, Disk functions
    145 %include "Int18h.asm"           ; For Int 18h, ROM Boot and Boot error
    146142%include "Int19h.asm"           ; For Int 19h, Boot Loader
     143%ifndef USE_AT
     144    %include "Int19hLate.asm"   ; For late initialization
     145%endif
    147146%include "Int19hMenu.asm"       ; For Int 19h, Boot Loader for Boot Menu
    148147%include "BootPrint.asm"        ; For printing boot information
     
    154153%include "AH3h_HWrite.asm"      ; Required by Int13h_Jump.asm
    155154%include "AH4h_HVerify.asm"     ; Required by Int13h_Jump.asm
    156 %include "AH5h_HFormat.asm"     ; Required by Int13h_Jump.asm
    157155%include "AH8h_HParams.asm"     ; Required by Int13h_Jump.asm
    158156%include "AH9h_HInit.asm"       ; Required by Int13h_Jump.asm
     
    161159%include "AH10h_HReady.asm"     ; Required by Int13h_Jump.asm
    162160%include "AH11h_HRecal.asm"     ; Required by Int13h_Jump.asm
    163 %include "AH14h_HDiag.asm"      ; Required by Int13h_Jump.asm
    164161%include "AH15h_HSize.asm"      ; Required by Int13h_Jump.asm
    165162%include "AH23h_HFeatures.asm"  ; Required by Int13h_Jump.asm
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm

    r33 r90  
    1 ; File name     :   RamVars.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   14.3.2010
    4 ; Last update   :   23.8.2010
    5 ; Author        :   Tomi Tilli
     1; Project name  :   XTIDE Universal BIOS
    62; Description   :   Functions for accessings RAMVARS.
    73
     
    1915;       Nothing
    2016;   Corrupts registers:
    21 ;       AX, CX, DI, DS, ES
     17;       AX, CX, DI, DS
    2218;--------------------------------------------------------------------
    2319ALIGN JUMP_ALIGN
    2420RamVars_Initialize:
     21    push    es
    2522    call    .StealMemoryForRAMVARS  ; Get RAMVARS segment to DS even if no stealing
    2623    call    .ClearRamvarsFromDS
     24    pop     es
    2725    jmp     DriveXlate_Reset
    2826
Note: See TracChangeset for help on using the changeset viewer.