Changeset 593 in xtideuniversalbios for trunk


Ignore:
Timestamp:
Jun 30, 2018, 8:27:04 AM (6 years ago)
Author:
Tomi Tilli
Message:

Flashing now works again.
Hack to get Windows 95 to work properly (MODULE_WIN95_CMOS_HACK included for 386 builds by default).
Edited makefile to produce large 386 build.
Fixed recovery time for QDI Vision VLB-IDE controllers.
No more warnings with Nasm 2.13.xx and later.
File dialog now properly restores default drive when file selection is cancelled.

Location:
trunk
Files:
4 added
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/AssemblyLibrary.inc

    r256 r593  
    99%include "BiosData.inc"
    1010%include "BiosFunctions.inc"
     11%include "CMOS.inc"
    1112%include "CgaSnow.inc"
    1213%include "Debug.inc"
    1314%include "Delay.inc"
    1415%include "DosFunctions.inc"
     16%include "CMOS.inc"
    1517%include "File.inc"
    1618%include "Math.inc"
     
    2022
    2123; Library dependencies
    22 %ifdef INCLUDE_MENU_DIALOGS
    23     %include "Dialog.inc"
    24     %define INCLUDE_MENU_LIBRARY
    25     %define INCLUDE_FILE_LIBRARY
    26 %endif
    27 
    28 %ifdef INCLUDE_MENU_LIBRARY
     24%ifdef INCLUDE_MENU_LIBRARY or INCLUDE_MENU_DIALOGS ; To prevent warnings with Nasm 2.13.xx
    2925    %include "Menu.inc"
    3026    %include "MenuEvents.inc"
    3127    %define INCLUDE_KEYBOARD_LIBRARY
    3228    %define INCLUDE_TIME_LIBRARY
     29   
     30    %ifdef INCLUDE_MENU_DIALOGS
     31        %include "Dialog.inc"
     32        %define INCLUDE_MENU_LIBRARY
     33        %define INCLUDE_FILE_LIBRARY
     34    %endif
    3335%endif
    3436
  • trunk/Assembly_Library/Inc/BiosFunctions.inc

    r592 r593  
    1212BIOS_BOOT_FAILURE_INTERRUPT_18h EQU     18h
    1313BIOS_BOOT_LOADER_INTERRUPT_19h  EQU     19h
     14BIOS_TIME_PCI_PNP_1Ah           EQU     1Ah
    1415BIOS_DISKETTE_INTERRUPT_40h     EQU     40h
    1516HD0_DPT_POINTER_41h             EQU     41h
     
    6465EVENT_WAIT                      EQU     86h
    6566
     67; BIOS PCI 2.0+ functions
     68PCI_INSTALLATION_CHECK              EQU     0B101h
     69
    6670
    6771%endif ; BIOS_FUNCTIONS_INC
  • trunk/Assembly_Library/Inc/Dialog.inc

    r54 r593  
    4646endstruc
    4747
     48
     49; Progress bar dialog
     50PROGRESS_COMPLETE_CHARACTER         EQU     BLOCK_FULL_FOREGROUND
     51PROGRESS_INCOMPLETE_CHARACTER       EQU     BLOCK_MOSTLY_BACKGROUND
     52
    4853struc PROGRESS_DIALOG_IO
    4954    .dialogInput                    resb    DIALOG_INPUT_size
     
    6772endstruc
    6873
     74
     75; File dialog
     76FILENAME_BUFFER_SIZE                EQU     14  ; 8+1+3+NULL+alignment
     77MAX_FILE_DIALOG_INFO_LINES          EQU     3
     78FLG_FILEDIALOG_DRIVES               EQU     (1<<0)  ; Allow changing drive
     79FLG_FILEDIALOG_DIRECTORY            EQU     (1<<1)  ; Select directory instead of file
     80FLG_FILEDIALOG_NEW                  EQU     (1<<2)  ; Allow creating new file or directory
     81
     82KEY_FILEDIALOG_CHANGE_DRIVE         EQU     3Ch     ; F2
     83KEY_FILEDIALOG_SELECT_DIRECTORY     EQU     3Dh     ; F3
     84KEY_FILEDIALOG_NEW_FILE_OR_DIR      EQU     3Eh     ; F4
     85
    6986struc FILE_DIALOG_IO
    7087    ; DIALOG_INPUT adjusted for File Dialog
     
    83100
    84101
    85 ; Progress bar dialog
    86 PROGRESS_COMPLETE_CHARACTER         EQU     BLOCK_FULL_FOREGROUND
    87 PROGRESS_INCOMPLETE_CHARACTER       EQU     BLOCK_MOSTLY_BACKGROUND
    88 
    89 ; File dialog
    90 FILENAME_BUFFER_SIZE                EQU     14  ; 8+1+3+NULL+alignment
    91 MAX_FILE_DIALOG_INFO_LINES          EQU     3
    92 FLG_FILEDIALOG_DRIVES               EQU     (1<<0)  ; Allow changing drive
    93 FLG_FILEDIALOG_DIRECTORY            EQU     (1<<1)  ; Select directory instead of file
    94 FLG_FILEDIALOG_NEW                  EQU     (1<<2)  ; Allow creating new file or directory
    95 
    96 KEY_FILEDIALOG_CHANGE_DRIVE         EQU     3Ch     ; F2
    97 KEY_FILEDIALOG_SELECT_DIRECTORY     EQU     3Dh     ; F3
    98 KEY_FILEDIALOG_NEW_FILE_OR_DIR      EQU     3Eh     ; F4
    99 
    100 
    101102%endif ; DIALOG_INC
  • trunk/Assembly_Library/Inc/Macros.inc

    r592 r593  
    124124
    125125
     126;--------------------------------------------------------------------
     127; Small delay between I/O port accessess if needed.
     128;
     129; IO_DELAY
     130;   Parameters:
     131;       Nothing
     132;   Returns:
     133;       Nothing
     134;   Corrupts registers:
     135;       Nothing
     136;--------------------------------------------------------------------
     137%macro IO_DELAY 0
     138    jmp     SHORT %%ClearPrefetchQueue
     139%%ClearPrefetchQueue:
     140%endmacro
     141
     142
    126143%endif ; MACROS_INC
  • trunk/Assembly_Library/Src/AssemblyLibrary.asm

    r592 r593  
    55;
    66; XTIDE Universal BIOS and Associated Tools
    7 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
     7; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2018 by XTIDE Universal BIOS Team.
    88;
    99; This program is free software; you can redistribute it and/or modify
     
    4545    %include "Drive.asm"
    4646    %include "FileIO.asm"
     47    %include "InterruptHandlers.asm"
    4748%endif
    4849
     
    134135        %include "Sort.asm"
    135136    %endif
     137
     138%ifdef INCLUDE_CMOS_LIBRARY
     139    %include "CMOS.asm"
     140%endif
    136141%endif
    137142
  • trunk/Assembly_Library/Src/Display/CgaSnow.asm

    r592 r593  
    3737
    3838    ; All standard CGA modes use 25 rows but only EGA and later store it to BDA.
    39     cmp     BYTE [BDA.bVidRows], 25     ; *FIXME* Shouldn't this be 24 (rows - 1)?
     39    cmp     BYTE [BDA.bVidRows], 24     ; BDA contains rows - 1
    4040    jae     SHORT .CgaNotFound
    4141    ret
  • trunk/Assembly_Library/Src/File/DosCritical.asm

    r592 r593  
    4545    push    ds
    4646
    47     push    cs
    48     pop     ds
    49     mov     ax, (SET_INTERRUPT_VECTOR<<8) | DOS_CRITICAL_ERROR_HANDLER_24h
    50     int     DOS_INTERRUPT_21h
     47    mov     al, DOS_CRITICAL_ERROR_HANDLER_24h
     48    call    HookInterruptVectorInALwithHandlerInCSDX
    5149
    5250    pop     ds
  • trunk/Assembly_Library/Src/File/Drive.asm

    r592 r593  
    131131.IsValidDriveNumberInDL:
    132132    push    ds
     133    push    ax
     134    cmp     dl, 1
     135    jbe     SHORT .FloppyDrive
     136
     137.MessageSuppressedByInt2FhHandler:
     138.MoreThanOneFloppyDrive:
     139.NoFloppyDrive:
    133140    push    bx
    134     push    ax
    135141
    136142    inc     dx          ; Default drive is 00h and first drive is 01h
     
    152158    test    al, al
    153159
     160    pop     bx
     161.ReturnFromFloppyDriveFiltering:
    154162    pop     ax
    155     pop     bx
    156163    pop     ds
    157164    ret
     165
     166.FloppyDrive:
     167; On single-floppy-drive systems, both A: and B: will point to the same physical drive. The problem is that DOS will print a message telling the user
     168; to "insert a disk and press any key to continue" when swapping from one logical drive to the other. To avoid this mess we hook interrupt 2Fh/AX=4A00h
     169; to signal to DOS that we will handle this ourselves. However, this only works on DOS 5+ so on older DOS versions we instead try to filter out
     170; the "other" logical drive (the one that isn't the current drive) during drive enumeration so the user can't select the "phantom" drive to begin with.
     171; This will have the somewhat strange effect of having a drive B: but no drive A: if B: happens to be the current logical floppy drive.
     172
     173    cmp     BYTE [bDosVersionMajor], 5      ; bDosVersionMajor must be provided by the application as it's not part of the library
     174    jae     SHORT .MessageSuppressedByInt2FhHandler
     175    LOAD_BDA_SEGMENT_TO ds, ax
     176    mov     al, [BDA.wEquipment]
     177    test    al, 0C0h
     178    jnz     SHORT .MoreThanOneFloppyDrive   ; No phantom drive so no need for any filtering
     179    test    al, 1                           ; Any floppy drive at all?
     180    jz      SHORT .NoFloppyDrive            ; A pre-DOS 5 machine with no FDD is indeed a strange beast. However, don't trust the BIOS - let DOS decide
     181    cmp     dl, [504h]                      ; MS-DOS - LOGICAL DRIVE FOR SINGLE-FLOPPY SYSTEM (A: / B:)
     182    jmp     SHORT .ReturnFromFloppyDriveFiltering
    158183
    159184;--------------------------------------------------------------------
  • trunk/Assembly_Library/Src/Menu/Dialog/Dialog.asm

    r583 r593  
    3232;       AX:     Selected item
    3333;   Corrupts registers:
    34 ;       BX, CX, DX, SI, DI
     34;       BX, CX, DX, DI
    3535;--------------------------------------------------------------------
    3636ALIGN JUMP_ALIGN
     
    3838    push    es
    3939    push    ds
    40     mov     di, bp                              ; Backup parent MENU
     40    mov     di, bp                          ; Backup parent MENU
    4141    mov     cx, DIALOG_size
    4242    eENTER_STRUCT cx
     
    5252
    5353    mov     ax, [bp+MENUINIT.wHighlightedItem]
     54    mov     si, [bp+DIALOG.fpDialogIO]      ; Restore SI
    5455    eLEAVE_STRUCT DIALOG_size
    5556    pop     ds
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm

    r592 r593  
    3232;       Nothing
    3333;   Corrupts registers:
    34 ;       AX, BX, CX, DX, SI, DI
     34;       AX, BX, CX, DX, DI
    3535;--------------------------------------------------------------------
    3636ALIGN JUMP_ALIGN
    3737DialogFile_GetFileNameWithIoInDSSI:
     38    ; We need to store default drive because user might change drive but
     39    ; then cancel the file selection. In that case the original default directory
     40    ; must be restored.
     41    call    Drive_GetDefaultToAL
     42    push    ax
     43
    3844    mov     bx, FileEventHandler
    3945    mov     BYTE [si+FILE_DIALOG_IO.bUserCancellation], TRUE
    40     jmp     Dialog_DisplayWithDialogInputInDSSIandHandlerInBX
     46    call    Dialog_DisplayWithDialogInputInDSSIandHandlerInBX
     47
     48    ; Now restore the default drive if user cancellation
     49    pop     dx
     50    cmp     BYTE [si+FILE_DIALOG_IO.bUserCancellation], TRUE
     51    je      Drive_SetDefaultFromDL
     52    ret
    4153
    4254
  • trunk/Assembly_Library/Src/Util/Bit.asm

    r592 r593  
    8686    jb      SHORT Bit_SetToAXfromIndexInCL
    8787
     88%ifdef USE_NEC_V
     89    eSET1   dx, cl              ; SET1 ignores bits 7...4 in CL
     90%else
    8891    sub     cl, 16
    8992    xchg    ax, dx
     
    9194    xchg    dx, ax
    9295    add     cl, 16
     96%endif
    9397    ret
    9498
     
    106110ALIGN JUMP_ALIGN
    107111Bit_SetToAXfromIndexInCL:
     112%ifdef USE_NEC_V
     113    eSET1   ax, cl
     114%else
    108115    push    dx
    109116
     
    113120
    114121    pop     dx
     122%endif
    115123    ret
    116124
  • trunk/XTIDE_Universal_BIOS/Inc/ATA_ID.inc

    r567 r593  
    5656PIO_6_MIN_ACTIVE_TIME_NS    EQU     55
    5757
    58 ; PIO Minimum Recovery Times or Inactive Times (t2i) can be calculated
    59 ; from Minimum Cycle Time (t0) - Minimum Active Time (t2) - Address Valid Time (t1).
    60 ; I'm not sure about this calculation so correct me if I'm wrong!
    61 ; Recovery time should be calculated at run time since Cycle Time t0 can be
    62 ; read from ATA information (ATA2+) but most drives just report the
    63 ; Min Cycle Times listed above.
    64 
     58; PIO 0...2 Maximum Addr valid to IOCS16- released (t8)
     59PIO_0_MAX_ADDR_VALID_TO_IOCS16_RELEASED     EQU     60
     60PIO_1_MAX_ADDR_VALID_TO_IOCS16_RELEASED     EQU     45
     61PIO_2_MAX_ADDR_VALID_TO_IOCS16_RELEASED     EQU     30
     62
     63; PIO DIOR-/DIOW- to address valid hold (t9)
     64PIO_0_DIORW_TO_ADDR_VALID_HOLD              EQU     20
     65PIO_1_DIORW_TO_ADDR_VALID_HOLD              EQU     15
     66PIO_2_DIORW_TO_ADDR_VALID_HOLD              EQU     10
    6567
    6668
  • trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc

    r592 r593  
    2929BOOT_READ_RETRY_TIMES       EQU     3
    3030
    31 ; Pre-boot variables. These do not exist after successful boot to OS.
    32 ; Segment is always 0000h, same as BDA segment
    33 struc BOOTVARS
    34                         resb    7C00h
    35     .rgbAtaInfo:                        ; 7C00h, ATA Information for drive detection
    36     .rgbBootSect        resb    512     ; 7C00h, Boot sector
    37                         resb    256     ; Boot Menu stack
    38     .rgbMnuStack:
    39     .dwPostStack        resb    4       ; POST stack pointer when entering INT 19h
    40 %ifdef MODULE_HOTKEYS
    41     .hotkeyVars         resb    HOTKEYVARS_size
    42 %endif
    43     .rgDrvDetectInfo:                   ; Array containing DRVDETECTINFO structs
    44 endstruc
    45 
    4631
    4732%ifdef MODULE_HOTKEYS
     
    6651
    6752%endif ; MODULE_HOTKEYS
     53
     54
     55; Pre-boot variables. These do not exist after successful boot to OS.
     56; Segment is always 0000h, same as BDA segment
     57struc BOOTVARS
     58                        resb    7C00h
     59    .rgbAtaInfo:                        ; 7C00h, ATA Information for drive detection
     60    .rgbBootSect        resb    512     ; 7C00h, Boot sector
     61                        resb    256     ; Boot Menu stack
     62    .rgbMnuStack:
     63    .dwPostStack        resb    4       ; POST stack pointer when entering INT 19h
     64%ifdef MODULE_HOTKEYS
     65    .hotkeyVars         resb    HOTKEYVARS_size ; Must be located just before DRVDETECTINFO structs
     66%endif
     67    .rgDrvDetectInfo:                   ; Array containing DRVDETECTINFO structs
     68endstruc
     69
    6870
    6971; MAX_HARD_DISK_NAME_LENGTH must be defined ahead of the DRVDETECTINFO structure to avoid problems with NASM
  • trunk/XTIDE_Universal_BIOS/Inc/HotkeyBar.inc

    r528 r593  
    2323MIN_TIME_TO_DISPLAY_HOTKEY_BAR          EQU (4000/55)   ; 4000 ms
    2424
     25FIRST_FUNCTION_KEY_SCANCODE             EQU 3Bh ; F1 key
     26
    2527ROM_BOOT_HOTKEY_SCANCODE                EQU 42h ; F8
    2628
  • trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc

    r589 r593  
    2929%ifdef MODULE_SERIAL_FLOPPY OR MODULE_DRIVEXLATE
    3030    %define NEED_XLATEVARS
     31%endif
     32
     33
     34%ifdef NEED_XLATEVARS
     35; Variables for translating drive numbers.
     36    struc XLATEVARS
     37    %ifdef MODULE_SERIAL_FLOPPY
     38        .bFlopCreateCnt:
     39        .bFlopCntAndFirst   resb    1   ; Normally, packed starting floppy drive number (high order 7 bits)
     40                                        ; and number of drives (low order bit, max 2 drives supported).
     41                                        ; During initialization, until the end of DetectDrives_FromAllIDEControllers,
     42                                        ; this byte contains the raw number of floppy drives seen
     43                                        ; (using .bFlopCreateCnt)
     44    %else
     45                            resb    1   ; alignment
     46    %endif
     47
     48    %ifdef MODULE_DRIVEXLATE
     49        .bXlatedDrv         resb    1   ; Drive number after translation
     50        .wFDandHDswap:
     51        .bFDSwap            resb    1   ; Floppy Drive to swap to 00h and vice versa
     52        .bHDSwap            resb    1   ; Hard Drive to swap to 80h and vice versa
     53    %else
     54                            resb    1   ; alignment
     55    %endif
     56    endstruc
    3157%endif
    3258
     
    6692RAMVARS_DRV_DETECT_SIGNATURE    EQU 5A5Ah   ; Signature when BIOS is in drive detection mode
    6793
    68 
    69 %ifdef NEED_XLATEVARS
    70 ; Variables for translating drive numbers.
    71     struc XLATEVARS
    72     %ifdef MODULE_SERIAL_FLOPPY
    73         .bFlopCreateCnt:
    74         .bFlopCntAndFirst   resb    1   ; Normally, packed starting floppy drive number (high order 7 bits)
    75                                         ; and number of drives (low order bit, max 2 drives supported).
    76                                         ; During initialization, until the end of DetectDrives_FromAllIDEControllers,
    77                                         ; this byte contains the raw number of floppy drives seen
    78                                         ; (using .bFlopCreateCnt)
    79     %else
    80                             resb    1   ; alignment
    81     %endif
    82 
    83     %ifdef MODULE_DRIVEXLATE
    84         .bXlatedDrv         resb    1   ; Drive number after translation
    85         .wFDandHDswap:
    86         .bFDSwap            resb    1   ; Floppy Drive to swap to 00h and vice versa
    87         .bHDSwap            resb    1   ; Hard Drive to swap to 80h and vice versa
    88     %else
    89                             resb    1   ; alignment
    90     %endif
    91     endstruc
    92 %endif
    9394
    9495%ifdef MODULE_SERIAL_FLOPPY
  • trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc

    r592 r593  
    2222%define ROMVARS_INC
    2323
    24 ; ROM Variables. Written to the ROM image before flashing.
    25 struc ROMVARS
    26     .wRomSign           resb    2   ; ROM Signature (AA55h)
    27     .bRomSize           resb    1   ; ROM size in 512 byte blocks
    28     .rgbJump            resb    3   ; First instruction to ROM init (jmp)
    29 
    30     .rgbSign            resb    8   ; Signature for XTIDE Configurator Program
    31     .szTitle            resb    31  ; BIOS title string
    32     .szVersion          resb    25  ; BIOS version string
    33 
    34     .wFlags             resb    2   ; Word for ROM flags
    35     .wDisplayMode       resb    2   ; Display mode for boot menu
    36     .wBootTimeout       resb    2   ; Boot Menu selection timeout in system timer ticks
    37     .pColorTheme        resb    2   ; Ptr to the color attribute struc used by the boot menu and hotkey bar
    38     .bIdeCnt            resb    1   ; Number of available IDE controllers
    39     .bBootDrv           resb    1   ; Default drive to boot from
    40     .bMinFddCnt         resb    1   ; Minimum number of Floppy Drives
    41     .bStealSize         resb    1   ; Number of 1kB blocks stolen from 640kB base RAM
    42     .bIdleTimeout       resb    1   ; Standby timer value
    43 
    44     .ideVarsBegin:
    45     .ideVars0           resb    IDEVARS_size
    46     .ideVars1           resb    IDEVARS_size
    47     .ideVars2           resb    IDEVARS_size
    48     .ideVars3           resb    IDEVARS_size
    49 
    50 %ifdef MODULE_SERIAL
    51     .ideVarsSerialAuto  resb    IDEVARS_size
    52 %endif
    53 
    54     .ideVarsEnd:
     24
     25; Master/Slave drive specific parameters
     26struc DRVPARAMS
     27    .wFlags         resb    2   ; Drive flags
     28    .dwMaximumLBA:              ; User specified maximum number of sectors
     29    .wCylinders     resb    2   ; User specified cylinders (1...16383)
     30    .wHeadsAndSectors:
     31    .bHeads         resb    1   ; User specified Heads (1...16)
     32    .bSect          resb    1   ; User specified Sectors per track (1...63)
    5533endstruc
    5634
    57 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    58     %if ROMVARS.ideVarsEnd & 0xff00 <> 0
    59         %error ".ideVars structures must fit within the first 256 bytes of the ROM image"
    60     %endif
    61     %if (ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) = 0
    62         %error "there must be at least one .ideVars structure, it would be bizarre if this were not true, but it is assumed in the ah0h reset code."
    63     %endif
    64 %endif
    65 
    66 NUMBER_OF_IDEVARS                   EQU ((ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) / IDEVARS_size)
    67 
    68 ; Bit defines for ROMVARS.wFlags
    69 FLG_ROMVARS_FULLMODE                EQU (1<<0)  ; Full operating mode (steals base RAM, supports EBIOS etc.)
    70 FLG_ROMVARS_SERIAL_SCANDETECT       EQU (1<<3)  ; Scan COM ports at the end of drive detection.  Can also be invoked
    71                                                 ; by holding down the ALT key at the end of drive detection.
    72                                                 ; (Conveniently, this is 8, a fact we exploit when testing the bit)
    73 
    74 ; Here in case the configuration needs to know functionality is present. Note! Changing the order/location of these flags
    75 ; also requires changes elsewhere as they are usually tested using byte-accesses for efficiency.
    76 FLG_ROMVARS_MODULE_POWER_MANAGEMENT     EQU (1<<5)
    77 FLG_ROMVARS_MODULE_8BIT_IDE             EQU (1<<6)
    78 FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED    EQU (1<<7)
    79 FLG_ROMVARS_MODULE_ADVANCED_ATA         EQU (1<<8)
    80 FLG_ROMVARS_MODULE_BOOT_MENU            EQU (1<<9)
    81 FLG_ROMVARS_MODULE_EBIOS                EQU (1<<10)
    82 FLG_ROMVARS_MODULE_HOTKEYS              EQU (1<<11)
    83 FLG_ROMVARS_MODULE_IRQ                  EQU (1<<12)
    84 FLG_ROMVARS_MODULE_SERIAL               EQU (1<<13)
    85 FLG_ROMVARS_MODULE_SERIAL_FLOPPY        EQU (1<<14)
    86 FLG_ROMVARS_MODULE_STRINGS_COMPRESSED   EQU (1<<15)
    87 
    88 
    89 ; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes)
    90 DEFAULT_TEXT_MODE       EQU 4
     35; Bit defines for DRVPARAMS.wFlags - these flags are accessed as bytes so changes here might require changes elsewhere
     36MASK_DRVPARAMS_WRITECACHE       EQU (3<<0)  ; Bits 0...1, Drive internal write cache settings (must start at bit 0)
     37    DEFAULT_WRITE_CACHE             EQU 0   ; Must be 0
     38    DISABLE_WRITE_CACHE             EQU 1
     39    ENABLE_WRITE_CACHE              EQU 2
     40MASK_DRVPARAMS_TRANSLATEMODE    EQU (3<<TRANSLATEMODE_FIELD_POSITION)   ; Bits 2...3, Position shared with DPT
     41    TRANSLATEMODE_FIELD_POSITION    EQU 2
     42    TRANSLATEMODE_NORMAL            EQU 0   ; Must be zero
     43    TRANSLATEMODE_LARGE             EQU 1
     44    TRANSLATEMODE_ASSISTED_LBA      EQU 2   ; 28-bit or 48-bit LBA
     45    TRANSLATEMODE_AUTO              EQU 3   ; Only available in ROMVARS, not in DPTs
     46FLG_DRVPARAMS_BLOCKMODE         EQU (1<<4)  ; Enable Block mode transfers
     47FLG_DRVPARAMS_USERCHS           EQU (1<<5)  ; User specified P-CHS values
     48    MAX_PCHS_CYLINDERS              EQU 16383
     49    MAX_PCHS_HEADS                  EQU 16
     50    MAX_PCHS_SECTORS_PER_TRACK      EQU 63
     51    MAX_PCHS_TOTAL_SECTOR_COUNT     EQU (MAX_PCHS_CYLINDERS * MAX_PCHS_HEADS * MAX_PCHS_SECTORS_PER_TRACK)  ; 16,514,064
     52FLG_DRVPARAMS_USERLBA           EQU (1<<6)  ; User specified LBA value
    9153
    9254
     
    173135XTCF_DEVICE_OFFSET                      EQU FIRST_XTCF_DEVICE                       ; Used for XT-CF device <--> mode conversion
    174136
    175 ; Master/Slave drive specific parameters
    176 struc DRVPARAMS
    177     .wFlags         resb    2   ; Drive flags
    178     .dwMaximumLBA:              ; User specified maximum number of sectors
    179     .wCylinders     resb    2   ; User specified cylinders (1...16383)
    180     .wHeadsAndSectors:
    181     .bHeads         resb    1   ; User specified Heads (1...16)
    182     .bSect          resb    1   ; User specified Sectors per track (1...63)
     137
     138; ROM Variables. Written to the ROM image before flashing.
     139struc ROMVARS
     140    .wRomSign           resb    2   ; ROM Signature (AA55h)
     141    .bRomSize           resb    1   ; ROM size in 512 byte blocks
     142    .rgbJump            resb    3   ; First instruction to ROM init (jmp)
     143
     144    .rgbSign            resb    8   ; Signature for XTIDE Configurator Program
     145    .szTitle            resb    31  ; BIOS title string
     146    .szVersion          resb    25  ; BIOS version string
     147
     148    .wFlags             resb    2   ; Word for ROM flags
     149    .wDisplayMode       resb    2   ; Display mode for boot menu
     150    .wBootTimeout       resb    2   ; Boot Menu selection timeout in system timer ticks
     151    .pColorTheme        resb    2   ; Ptr to the color attribute struc used by the boot menu and hotkey bar
     152    .bIdeCnt            resb    1   ; Number of available IDE controllers
     153    .bBootDrv           resb    1   ; Default drive to boot from
     154    .bMinFddCnt         resb    1   ; Minimum number of Floppy Drives
     155    .bStealSize         resb    1   ; Number of 1kB blocks stolen from 640kB base RAM
     156    .bIdleTimeout       resb    1   ; Standby timer value
     157
     158    .ideVarsBegin:
     159    .ideVars0           resb    IDEVARS_size
     160    .ideVars1           resb    IDEVARS_size
     161    .ideVars2           resb    IDEVARS_size
     162    .ideVars3           resb    IDEVARS_size
     163
     164%ifdef MODULE_SERIAL
     165    .ideVarsSerialAuto  resb    IDEVARS_size
     166%endif
     167
     168    .ideVarsEnd:
    183169endstruc
    184170
    185 ; Bit defines for DRVPARAMS.wFlags - these flags are accessed as bytes so changes here might require changes elsewhere
    186 MASK_DRVPARAMS_WRITECACHE       EQU (3<<0)  ; Bits 0...1, Drive internal write cache settings (must start at bit 0)
    187     DEFAULT_WRITE_CACHE             EQU 0   ; Must be 0
    188     DISABLE_WRITE_CACHE             EQU 1
    189     ENABLE_WRITE_CACHE              EQU 2
    190 MASK_DRVPARAMS_TRANSLATEMODE    EQU (3<<TRANSLATEMODE_FIELD_POSITION)   ; Bits 2...3, Position shared with DPT
    191     TRANSLATEMODE_FIELD_POSITION    EQU 2
    192     TRANSLATEMODE_NORMAL            EQU 0   ; Must be zero
    193     TRANSLATEMODE_LARGE             EQU 1
    194     TRANSLATEMODE_ASSISTED_LBA      EQU 2   ; 28-bit or 48-bit LBA
    195     TRANSLATEMODE_AUTO              EQU 3   ; Only available in ROMVARS, not in DPTs
    196 FLG_DRVPARAMS_BLOCKMODE         EQU (1<<4)  ; Enable Block mode transfers
    197 FLG_DRVPARAMS_USERCHS           EQU (1<<5)  ; User specified P-CHS values
    198     MAX_PCHS_CYLINDERS              EQU 16383
    199     MAX_PCHS_HEADS                  EQU 16
    200     MAX_PCHS_SECTORS_PER_TRACK      EQU 63
    201     MAX_PCHS_TOTAL_SECTOR_COUNT     EQU (MAX_PCHS_CYLINDERS * MAX_PCHS_HEADS * MAX_PCHS_SECTORS_PER_TRACK)  ; 16,514,064
    202 FLG_DRVPARAMS_USERLBA           EQU (1<<6)  ; User specified LBA value
     171%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
     172    %if ROMVARS.ideVarsEnd & 0xff00 <> 0
     173        %error ".ideVars structures must fit within the first 256 bytes of the ROM image"
     174    %endif
     175    %if (ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) = 0
     176        %error "there must be at least one .ideVars structure, it would be bizarre if this were not true, but it is assumed in the ah0h reset code."
     177    %endif
     178%endif
     179
     180NUMBER_OF_IDEVARS                   EQU ((ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) / IDEVARS_size)
     181
     182; Bit defines for ROMVARS.wFlags
     183FLG_ROMVARS_FULLMODE                    EQU (1<<0)  ; Full operating mode (steals base RAM, supports EBIOS etc.)
     184FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES   EQU (1<<1)  ; Ignores drives configured in motherboard BIOS setup.
     185                                                    ; For now it is a hack to get Windows 95 IDE drivers working
     186                                                    ; but it will be needed later when XTUB supports dynamic drive overlay.
     187                                                    ; Because of that this must be included into AT builds and cannot be a
     188                                                    ; module (any AT or 386 must be installable to the hard drive so
     189                                                    ; there won't be need for even more different builds).
     190FLG_ROMVARS_SERIAL_SCANDETECT           EQU (1<<3)  ; Scan COM ports at the end of drive detection.  Can also be invoked
     191                                                    ; by holding down the ALT key at the end of drive detection.
     192                                                    ; (Conveniently, this is 8, a fact we exploit when testing the bit)
     193
     194; Here in case the configuration needs to know functionality is present. Note! Changing the order/location of these flags
     195; also requires changes elsewhere as they are usually tested using byte-accesses for efficiency.
     196FLG_ROMVARS_MODULE_POWER_MANAGEMENT     EQU (1<<5)
     197FLG_ROMVARS_MODULE_8BIT_IDE             EQU (1<<6)
     198FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED    EQU (1<<7)
     199FLG_ROMVARS_MODULE_ADVANCED_ATA         EQU (1<<8)
     200FLG_ROMVARS_MODULE_BOOT_MENU            EQU (1<<9)
     201FLG_ROMVARS_MODULE_EBIOS                EQU (1<<10)
     202FLG_ROMVARS_MODULE_HOTKEYS              EQU (1<<11)
     203FLG_ROMVARS_MODULE_IRQ                  EQU (1<<12)
     204FLG_ROMVARS_MODULE_SERIAL               EQU (1<<13)
     205FLG_ROMVARS_MODULE_SERIAL_FLOPPY        EQU (1<<14)
     206FLG_ROMVARS_MODULE_STRINGS_COMPRESSED   EQU (1<<15)
     207
     208
     209; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes)
     210DEFAULT_TEXT_MODE       EQU 4
     211
    203212
    204213%endif ; ROMVARS_INC
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm

    r592 r593  
    9090;--------------------------------------------------------------------
    9191.InitializeBiosAndDetectDrives:
    92 %ifdef MODULE_HOTKEYS
    93     call    TimerTicks_ReadFromBdaToAX
    94     mov     [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wTimeWhenDisplayed], ax
    95 %endif
    96 
    9792    call    Initialize_AndDetectDrives
    9893
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm

    r592 r593  
    3333;               Cleared if no controller
    3434;   Corrupts registers:
    35 ;       BX
     35;       BX, CX
    3636;--------------------------------------------------------------------
    3737AdvAtaInit_DetectControllerForIdeBaseInBX:
     38    ; Detect if system has PCI bus. If it does, we can skip VLB detection. This is
     39    ; good thing since detecting Vision QD6850 is dangerous since Intel PIIX4 south bridge
     40    ; mirrors Interrupt Controller registers from Axh to Bxh. This can lead to faulty
     41    ; detection of QD6850 that will eventually crash the system when ports are written.
     42
     43    ; We should save the 32-bit registers but we don't since system BIOS has stored
     44    ; them already and we don't use the 32-bit registers ourselves anywhere at the moment.
     45    push    bx
     46    push    di
     47    xor     edi, edi        ; Some BIOSes require this to be set to zero
     48    mov     ax, PCI_INSTALLATION_CHECK
     49    int     BIOS_TIME_PCI_PNP_1Ah
     50    pop     di
     51    pop     bx
     52    test    ah, ah
     53    jz      SHORT .ThisSystemHasPCIbus
     54
     55    ; Detect VLB controllers
    3856    call    Vision_DetectAndReturnIDinAXandPortInDXifControllerPresent
    3957    jnz     SHORT .NoVisionControllerFound
     
    5169
    5270.NoAdvancedControllerForPortBX:
     71.ThisSystemHasPCIbus:
    5372    xor     ax, ax      ; Clear ID in AX and CF
    5473    ret
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/Vision.asm

    r592 r593  
    4141    in      al, QD65XX_BASE_PORT + QD65XX_CONFIG_REGISTER_in
    4242
    43 %ifdef DANGEROUS_DETECTION
    44     ; Checking alternative base port is currently commented away
    45     ; since Intel PIIX4 south bridge mirrors Interrupt Controller registers
    46     ; from Axh to Bxh.
    4743    call    IsConfigRegisterWithIDinAL
    4844    je      SHORT VisionControllerDetected.Return
     
    5147    mov     dl, QD65XX_ALTERNATIVE_BASE_PORT
    5248    in      al, QD65XX_ALTERNATIVE_BASE_PORT + QD65XX_CONFIG_REGISTER_in
    53 %endif ; DANGEROUS_DETECTION
    5449    ; Fall to IsConfigRegisterWithIDinAL
    5550
     
    198193
    199194    ; Calculate Recovery Time value for QD65xx IDE Timing Register
    200     call    AtaID_GetRecoveryTimeToAXfromPioModeInBXandCycleTimeInCX
     195    xchg    ax, cx
     196    eMOVZX  cx, BYTE [cs:bx+.rgbToSubtractFromCycleTimeBasedOnPIOmode]
     197    sub     ax, cx
    201198    mov     bx, bp                      ; Active Time value now in BL
    202199    mov     bp, QD65xx_MAX_RECOVERY_TIME_CLOCKS | (QD65xx_MIN_RECOVERY_TIME_CLOCKS << 8)
     
    209206    ret                                 ; Return with CF cleared
    210207
     208.rgbToSubtractFromCycleTimeBasedOnPIOmode:
     209    ; For PIO 0 to 2 this method (t0 - (t1+t8+t9)) seems to give closest (little less) values to the fixed preset
     210    ; values used by QDI6580 DOS driver v3.7
     211    db      (PIO_0_MIN_ADDRESS_VALID_NS + PIO_0_MAX_ADDR_VALID_TO_IOCS16_RELEASED + PIO_0_DIORW_TO_ADDR_VALID_HOLD)
     212    db      (PIO_1_MIN_ADDRESS_VALID_NS + PIO_1_MAX_ADDR_VALID_TO_IOCS16_RELEASED + PIO_1_DIORW_TO_ADDR_VALID_HOLD)
     213    db      (PIO_2_MIN_ADDRESS_VALID_NS + PIO_2_MAX_ADDR_VALID_TO_IOCS16_RELEASED + PIO_2_DIORW_TO_ADDR_VALID_HOLD)
     214    db      102     ; QDI6580 DOS driver v3.7 uses fixed values for PIO 3...
     215    db      61      ; ...and PIO 4. No idea where these values come from.
     216    db      (PIO_5_MIN_CYCLE_TIME_NS / 2) ; PIO 5 and 6 were not available when QD6850 was released. Use values...
     217    db      (PIO_6_MIN_CYCLE_TIME_NS / 2) ; ...that resembles those used for PIO 4
     218
    211219
    212220;--------------------------------------------------------------------
     
    226234
    227235    ; Get VLB Cycle Time in nanosecs
    228     mov     cl, VLB_33MHZ_CYCLE_TIME    ; Assume 33 MHz or slower VLB bus
     236    mov     cl, VLB_33MHZ_CYCLE_TIME    ; Assume 33 MHz or slower VLB bus (30 ns)
    229237    test    BYTE [di+DPT_ADVANCED_ATA.wControllerID], FLG_QDCONFIG_ID3
    230     eCMOVZ  cl, VLB_40MHZ_CYCLE_TIME
     238    eCMOVZ  cl, VLB_40MHZ_CYCLE_TIME    ; (25 ns)
    231239
    232240    ; Convert value in AX to VLB ticks
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r592 r593  
    211211
    212212;--------------------------------------------------------------------
    213 ; AtaID_GetRecoveryTimeToAXfromPioModeInBXandCycleTimeInCX
    214 ;   Parameters:
    215 ;       BX:     PIO Mode
    216 ;       CX:     PIO Cycle Time in nanosecs
    217 ;   Returns:
    218 ;       AX:     Active Time in nanosecs
    219 ;   Corrupts registers:
    220 ;       BX, CX
    221 ;--------------------------------------------------------------------
    222 AtaID_GetRecoveryTimeToAXfromPioModeInBXandCycleTimeInCX:
    223     call    AtaID_GetActiveTimeToAXfromPioModeInBX
    224     mov     bl, [cs:bx+.rgbPioModeToAddressValidTimeNs]
    225     sub     cx, bx  ; Cycle Time (t0) - Address Valid Time (t1)
    226     sub     cx, ax  ; - Active Time (t2)
    227     xchg    ax, cx  ; AX = Recovery Time (t2i)
    228     ret
    229 
    230 .rgbPioModeToAddressValidTimeNs:
    231     db      PIO_0_MIN_ADDRESS_VALID_NS
    232     db      PIO_1_MIN_ADDRESS_VALID_NS
    233     db      PIO_2_MIN_ADDRESS_VALID_NS
    234     db      PIO_3_MIN_ADDRESS_VALID_NS
    235     db      PIO_4_MIN_ADDRESS_VALID_NS
    236     db      PIO_5_MIN_ADDRESS_VALID_NS
    237     db      PIO_6_MIN_ADDRESS_VALID_NS
    238 
    239 
    240 ;--------------------------------------------------------------------
    241213; AtaID_GetActiveTimeToAXfromPioModeInBX
    242214;   Parameters:
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r589 r593  
    9595; FindDPT_ForDriveNumber will not find any drives that are ours.
    9696;
     97
     98; Here we might want to replace BIOS configured drives with the ones we detected.
     99; Primary reason is to support dynamic overlay feature in the future. Second reason
     100; is a hack to get Windows 95 load proper IDE drivers.
     101;
     102; The Windows hack has two parts. First part is to try to alter CMOS address 12h as that
     103; is what Windows 95 driver reads to detect IDE drives. Altering is not possible on all
     104; systems since CMOS has a checksum but it's location is not standardized. We will first
     105; try to detect valid checksum. If it succeeds, then it is safe to assume this system
     106; has compatible CMOS and we can alter it.
     107; If verify fails, we do the more dirty hack to zero BDA drive count. Then Windows 95 works
     108; as long as user has configured at least one drive in the BIOS setup.
     109
     110%ifdef USE_AT   ; FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES is for AT builds only
     111
     112    %ifdef MODULE_WIN95_CMOS_HACK
     113        mov     dl, HARD_DISK_TYPES
     114        call    CMOS_ReadFromIndexInDLtoAL
     115        test    al, al
     116        jnz     SHORT .ContinueInitialization   ; CMOS byte 12h is ready for Windows 95
     117        call    CMOS_Verify10hTo2Dh
     118        jnz     SHORT .ClearBdaDriveCount       ; Unsupported BIOS, use plan B
     119   
     120        ; Now we can alter CMOS location 12h
     121        mov     dl, HARD_DISK_TYPES
     122        mov     al, 0F0h    ; Drive 0 type 16...47 but Windows doesn't care as long as this is not zero
     123        call    CMOS_WriteALtoIndexInDL
     124        call    CMOS_StoreNewChecksumFor10hto2Dh
     125    %endif
     126
     127    test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES
     128    jz      SHORT .ContinueInitialization
     129.ClearBdaDriveCount:
     130    mov     BYTE [es:BDA.bHDCount], 0   ; Set hard disk count to zero
     131.ContinueInitialization:
     132%endif
     133
    97134    mov     cx, [RAMVARS.wDrvCntAndFlopCnt]     ; Our count of hard disks
    98135    mov     al, [es:BDA.bHDCount]
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r592 r593  
    7777;---------------------------;
    7878%ifdef USE_AT
     79%ifdef USE_386
     80    at  ROMVARS.wFlags,         dw  FLG_ROMVARS_FULLMODE | FLG_ROMVARS_IGNORE_MOTHERBOARD_DRIVES | MASK_ROMVARS_INCLUDED_MODULES
     81%else
    7982    at  ROMVARS.wFlags,         dw  FLG_ROMVARS_FULLMODE | MASK_ROMVARS_INCLUDED_MODULES
     83%endif
    8084    at  ROMVARS.wDisplayMode,   dw  DEFAULT_TEXT_MODE
    8185%ifdef MODULE_BOOT_MENU
     
    188192
    189193    %include "AssemblyLibrary.asm"
     194%ifdef MODULE_WIN95_CMOS_HACK
     195    %include "CMOS.asm"             ; This belongs in the Assembly Library
     196%endif
    190197
    191198    ; String compression tables need to come after the AssemblyLibrary (since they depend on addresses
  • trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm

    r592 r593  
    7575    mov     cl, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFddLetter]
    7676    mov     di, g_szFDD
     77
     78    ; Clear CH if floppy drive is selected for boot
     79    mov     ch, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bFlags]
     80    ;and        ch, FLG_HOTKEY_HD_FIRST     ; Needed if more flags are added
    7781    call    FormatDriveHotkeyString
    7882
     
    9296    call    BootVars_GetLetterForFirstHardDriveToAX
    9397    mov     ah, ANGLE_QUOTE_RIGHT
    94     mov     cl, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bHddLetter]
     98    mov     cx, [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bHddLetter]  ; Letter to CL, flags to CH
     99    ;and        ch, FLG_HOTKEY_HD_FIRST     ; Needed if more flags are added
     100    xor     ch, FLG_HOTKEY_HD_FIRST     ; Clear CH if HD is selected for boot, set otherwise
    95101    mov     di, g_szHDD
    96102    call    FormatDriveHotkeyString
     
    182188; FormatDriveHotkeyString
    183189;   Parameters:
     190;       CH:         Zero if letter in CL is selected for boot
    184191;       CL:         Drive letter hotkey from BOOTVARS
    185192;       AL:         First character for drive key string
     
    192199;       AX, CX, DX, SI, DI
    193200;--------------------------------------------------------------------
    194 ;; No work to do before going into FormatFunctionHotkeyString
    195 FormatDriveHotkeyString  equ  GetNonSelectedHotkeyDescriptionAttributeToDX
     201FormatDriveHotkeyString:
     202    ; Invalid scancodes are filtered on HotkeyBar_StoreHotkeyToBootvarsIfValidKeystrokeInAX
     203    ; so here we have either drive letter or function key pressed. If latter, draw
     204    ; drive letters as unselected
     205    cmp     BYTE [es:BOOTVARS.hotkeyVars+HOTKEYVARS.bScancode], FIRST_FUNCTION_KEY_SCANCODE
     206    jae     SHORT GetNonSelectedHotkeyDescriptionAttributeToDX
     207
     208    ; Drive selected to boot from?
     209    test    ch, ch
     210    jnz     SHORT GetNonSelectedHotkeyDescriptionAttributeToDX
     211    jmp     SHORT GetSelectedHotkeyDescriptionAttributeToDX
     212
    196213
    197214;--------------------------------------------------------------------
     
    216233%ifdef MODULE_BOOT_MENU
    217234
     235GetSelectedHotkeyDescriptionAttributeToDX:
    218236    mov     si, ATTRIBUTE_CHARS.cHurryTimeout       ; Selected hotkey
    219     je      SHORT GetDescriptionAttributeToDX       ; From compare with bScancode above
     237    je      SHORT GetDescriptionAttributeToDX       ; From compare with bScancode above and from FormatDriveHotkeyString
    220238
    221239GetNonSelectedHotkeyDescriptionAttributeToDX:
     
    232250%else ; if no MODULE_BOOT_MENU - No boot menu so use simpler attributes
    233251
     252GetSelectedHotkeyDescriptionAttributeToDX:
    234253    mov     dx, (COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_CYAN) << 8) | MONO_REVERSE_BLINK
    235     je      SHORT SelectAttributeFromDHorDLbasedOnVideoMode     ; From compare with bScancode above
     254    je      SHORT SelectAttributeFromDHorDLbasedOnVideoMode     ; From compare with bScancode above and from FormatDriveHotkeyString
    236255
    237256GetNonSelectedHotkeyDescriptionAttributeToDX:
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r589 r593  
    6464    mov     al, FLG_DEVCONTROL_nIEN ; Disable IRQ
    6565.EnableDeviceIrq:
    66 %else
     66%else   ; ifndef MODULE_IRQ
    6767    mov     al, FLG_DEVCONTROL_nIEN ; Disable IRQ
    6868%endif ; MODULE_IRQ
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/BootVars.asm

    r547 r593  
    3535    mov     al, DRVDETECTINFO_size
    3636    mul     BYTE [cs:ROMVARS.bIdeCnt]
    37     mov     di, BOOTVARS.rgDrvDetectInfo    ; We must not initialize anything before this!
    3837    xchg    cx, ax
    3938%ifndef MODULE_HOTKEYS
     39    mov     di, BOOTVARS.rgDrvDetectInfo    ; We must not initialize anything before this!
    4040    jmp     Memory_ZeroESDIwithSizeInCX
    4141
    4242%else ; if MODULE_HOTKEYS
     43    ; Also zero HOTKEYVARS located above DRVDETECTINFO structs
     44    mov     di, BOOTVARS.hotkeyVars
     45    add     cx, BYTE HOTKEYVARS_size
    4346    call    Memory_ZeroESDIwithSizeInCX
     47
     48    ; Store time when hotkeybar is displayed
     49    ; (it will be displayed after initialization is complete)
     50    call    TimerTicks_ReadFromBdaToAX
     51    mov     [es:BOOTVARS.hotkeyVars+HOTKEYVARS.wTimeWhenDisplayed], ax
    4452
    4553    ; Initialize HOTKEYVARS by storing default drives to boot from
  • trunk/XTIDE_Universal_BIOS/makefile

    r592 r593  
    2929# MODULE_VERY_LATE_INIT       Initialize on INT 13h if our INT 19h handler is not called           #
    3030# MODULE_POWER_MANAGEMENT     Power Management support                                             #
     31# MODULE_WIN95_CMOS_HACK      Hack for Windows 95 compatibility                                    #
    3132#                                                                                                  #
    3233# Not modules but these affect the assembly:                                                       #
     
    3435# RELOCATE_INT13H_STACK **    Relocates INT 13h stack to beginning of stolen conventional memory   #
    3536# RESERVE_DIAGNOSTIC_CYLINDER Reserve one L-CHS cylinder for compatibility with old BIOSes         #
    36 # DANGEROUS_DETECTION         Scans Advanced Controllers from dangerous ports like mirrored PIC    #
    3737# NO_ATAID_VALIDATION ***     Excludes code that tries to ensure proper communication with drives  #
    3838# USE_186                     Use instructions supported by 80188/80186 and V20/V30 and later      #
     
    4141# USE_AT                      Use features supported on AT and later systems (not available on XT) #
    4242# USE_UNDOC_INTEL             Optimizations for Intel CPU:s - do NOT use on NEC V20/V30/Sony CPU:s #
     43# USE_NEC_V                   Optimizations for use with NEC V20/V30 processors only               #
    4344# CLD_NEEDED                  Only needed for compatibility with buggy software/BIOSes             #
    4445#                                                                                                  #
     
    116117
    117118DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE NO_ATAID_VALIDATION CLD_NEEDED
    118 DEFINES_386_8K = $(DEFINES_AT) USE_386 MODULE_ADVANCED_ATA
     119DEFINES_386 = $(DEFINES_AT) USE_386 MODULE_ADVANCED_ATA MODULE_WIN95_CMOS_HACK
     120DEFINES_386_LARGE = $(DEFINES_AT_LARGE) USE_386 MODULE_ADVANCED_ATA MODULE_WIN95_CMOS_HACK
    119121
    120122DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_POWER_MANAGEMENT MODULE_COMPATIBLE_TABLES
    121 DEFINES_ALL_FEATURES += ELIMINATE_CGA_SNOW RELOCATE_INT13H_STACK RESERVE_DIAGNOSTIC_CYLINDER
     123DEFINES_ALL_FEATURES += ELIMINATE_CGA_SNOW RELOCATE_INT13H_STACK RESERVE_DIAGNOSTIC_CYLINDER MODULE_WIN95_CMOS_HACK
    122124
    123125
     
    140142DEFS_AT_LARGE = $(DEFINES_AT_LARGE:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_LARGE)
    141143DEFS_XT_TINY = $(DEFINES_XT_TINY:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_TINY)
    142 DEFS_386_8K = $(DEFINES_386_8K:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_SMALL)
     144DEFS_386 = $(DEFINES_386:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_SMALL)
     145DEFS_386_LARGE = $(DEFINES_386_LARGE:%=-D%) -DBIOS_SIZE=$(BIOS_SIZE_LARGE)
    143146DEFS_ALL_FEATURES = $(DEFINES_ALL_FEATURES:%=-D%)
    144147
     
    181184    @echo All done!
    182185
    183 small: xt_tiny xt xtplus at 386_8k
     186small: xt_tiny xt xtplus at 386
    184187    @echo All small binaries built!
    185188
    186 large: xt_large xtplus_large at_large
     189large: xt_large xtplus_large at_large 386_large
    187190    @echo All large binaries built!
    188191
     
    215218    @echo * Tiny XT version "$(TARGET)_tiny.bin" built.
    216219
    217 386_8k:
    218     @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_386_8K) -l"$(TARGET)_386.lst" -o"$(TARGET)_386.bin"
     220386:
     221    @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_386) -l"$(TARGET)_386.lst" -o"$(TARGET)_386.bin"
    219222    @echo * Small 386 version "$(TARGET)_386.bin" built.
     223
     224386_large:
     225    @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_386_LARGE) -l"$(TARGET)_386l.lst" -o"$(TARGET)_386l.bin"
     226    @echo * Large 386 version "$(TARGET)_386l.bin" built.
    220227
    221228strings: src\Strings.asm
     
    237244    @perl ..\Tools\checksum.pl $(TARGET)_atl.bin $(BIOS_SIZE_LARGE)
    238245    @perl ..\Tools\checksum.pl $(TARGET)_386.bin $(BIOS_SIZE_SMALL)
     246    @perl ..\Tools\checksum.pl $(TARGET)_386l.bin $(BIOS_SIZE_LARGE)
    239247
    240248unused:
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc

    r567 r593  
    2020%ifndef MENU_STRUCTS_INC
    2121%define MENU_STRUCTS_INC
     22
     23struc ITEM_VALUE
     24    .wRomvarsValueOffset    resb    2   ; ROMVARS offset to actual value to be configured
     25    .szDialogTitle          resb    2   ; Dialog title string
     26
     27    .szMultichoice          resb    2   ; Multiple choices in one string
     28    .rgwChoiceToValueLookup resb    2   ; Ptr to lookup table for translating selected choice to actual value
     29    .rgszValueToStringLookup:           ; Ptr to lookup table for translating value to string
     30    .rgszChoiceToStringLookup:
     31    .wMinValue              resb    2   ; Minimum allowed integer value
     32    .wMaxValue:
     33    .wValueBitmask          resb    2   ; Bitmask for item value flag or field
     34    .fnValueReader          resb    2   ; Called just after ROMVARS is read, providing a hook for further action
     35    .fnValueWriter          resb    2   ; Called just before ROMVARS is written, providing a hook for further action
     36    .bFieldPosition         resb    1   ; Bit field position
     37endstruc
    2238
    2339struc MENUPAGE
     
    6177
    6278
    63 struc ITEM_VALUE
    64     .wRomvarsValueOffset    resb    2   ; ROMVARS offset to actual value to be configured
    65     .szDialogTitle          resb    2   ; Dialog title string
    66 
    67     .szMultichoice          resb    2   ; Multiple choices in one string
    68     .rgwChoiceToValueLookup resb    2   ; Ptr to lookup table for translating selected choice to actual value
    69     .rgszValueToStringLookup:           ; Ptr to lookup table for translating value to string
    70     .rgszChoiceToStringLookup:
    71     .wMinValue              resb    2   ; Minimum allowed integer value
    72     .wMaxValue:
    73     .wValueBitmask          resb    2   ; Bitmask for item value flag or field
    74     .fnValueReader          resb    2   ; Called just after ROMVARS is read, providing a hook for further action
    75     .fnValueWriter          resb    2   ; Called just before ROMVARS is written, providing a hook for further action
    76     .bFieldPosition         resb    1   ; Bit field position
    77 endstruc
    78 
    79 
    8079%endif ; MENU_STRUCTS_INC
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm

    r592 r593  
    189189    cld
    190190%endif
    191 ;%if g_rgwEepromTypeToSizeInWords = 0   ; *FIXME* It really is but NASM won't accept this.
    192     mov     cx, [cs:bx]
    193 ;%else
    194 ;   mov     cx, [cs:bx+g_rgwEepromTypeToSizeInWords]
    195 ;%endif
     191    mov     cx, [cs:bx+g_rgwEepromTypeToSizeInWords]
    196192    rep movsw
    197193
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm

    r592 r593  
    292292    loop    .WriteActualDataByteAfterSdpCommand
    293293    sti                     ; Enable interrupts
    294     ; Fall to WaitUntilEepromPageWriteHasCompleted
     294    ; Fall to .WaitUntilEepromPageWriteHasCompleted
    295295
    296296
     
    305305;       AX, BX, DI, DS, ES
    306306;--------------------------------------------------------------------
    307 ALIGN JUMP_ALIGN
    308 WaitUntilEepromPageWriteHasCompleted:
     307.WaitUntilEepromPageWriteHasCompleted:
    309308    push    ss
    310309    pop     ds
     
    325324    ret
    326325
     326
    327327;--------------------------------------------------------------------
    328328; DisplayFlashProgressWithPagesLeftInCXandFlashvarsInSSBP
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm

    r592 r593  
    8585    ret
    8686.DosVersionIsOK:
     87    mov     [bDosVersionMajor], al                  ; bDosVersionMajor must be initialized by the application (library code depends on it)
     88    cmp     al, 5
     89    jb      SHORT .DoNotInstallInt2FhHandler
     90    ; Since we are installing our Int2Fh handler we must also hook interrupt 23h to ensure a clean exit on ctrl-c/ctrl-break
     91    call    HookInterrupt23h
     92    call    HookInterrupt2Fh
     93.DoNotInstallInt2FhHandler:
    8794
    8895    mov     ax, SCREEN_BACKGROUND_CHARACTER_AND_ATTRIBUTE
     
    93100    mov     ax, DOS_BACKGROUND_CHARACTER_AND_ATTRIBUTE
    94101    call    InitializeScreenWithBackgroundCharAndAttrInAX
     102
     103    call    UnhookInterrupt2Fh
    95104
    96105    ; Exit to DOS
     
    156165; Section containing uninitialized data
    157166SECTION .bss
     167
     168bDosVersionMajor:   resb    1
     169
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm

    r592 r593  
    346346.GetSelectedEepromSizeInWordsToAX:
    347347    eMOVZX  bx, [cs:g_cfgVars+CFGVARS.bEepromType]
    348 ;%if g_rgwEepromTypeToSizeInWords = 0   ; *FIXME* It really is but NASM won't accept this.
    349     mov     ax, [cs:bx]
    350 ;%else
    351 ;   mov     ax, [cs:bx+g_rgwEepromTypeToSizeInWords]
    352 ;%endif
     348    mov     ax, [cs:bx+g_rgwEepromTypeToSizeInWords]
    353349    ret
     350
    354351
    355352;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/makefile

    r592 r593  
    5454# Assembler preprocessor defines.                               #
    5555#################################################################
    56 DEFINES = EXCLUDE_FROM_XTIDECFG
     56DEFINES = EXCLUDE_FROM_XTIDECFG CLD_NEEDED
    5757DEFINES_XT = ELIMINATE_CGA_SNOW
    5858DEFINES_XTPLUS = USE_186 ELIMINATE_CGA_SNOW
Note: See TracChangeset for help on using the changeset viewer.