source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc @ 363

Last change on this file since 363 was 363, checked in by aitotat@…, 12 years ago

Changes to XTIDE Universal BIOS:

  • Added Advanced ATA Module (MODULE_ADVANCED_ATA) with native support for QDI Vision QD6500 and QD6580 VLB IDE Controllers.
  • Hopefully optimized IDE transfer functions for 8088 (replaced some memory accesses from WORD to BYTE).
  • XT build does not fit in 8k at the moment!!!
File size: 5.2 KB
RevLine 
[90]1; Project name  :   XTIDE Universal BIOS
[3]2; Description   :   Defines for ROMVARS struct containing variables stored
3;                   in BIOS ROM.
4%ifndef ROMVARS_INC
5%define ROMVARS_INC
6
[181]7; ROM Variables. Written to the ROM image before flashing.
[3]8struc ROMVARS
[181]9    .wRomSign           resb    2   ; ROM Signature (AA55h)
10    .bRomSize           resb    1   ; ROM size in 512 byte blocks
11    .rgbJump            resb    3   ; First instruction to ROM init (jmp)
[90]12
[181]13    .rgbSign            resb    8   ; Signature for XTIDE Configurator Program
14    .szTitle            resb    31  ; BIOS title string
15    .szVersion          resb    25  ; BIOS version string
[90]16
[181]17    .wFlags             resb    2   ; Word for ROM flags
18    .wDisplayMode       resb    2   ; Display mode for boot menu
[243]19    .wfDisplayBootMenu:             ; Zero = no Boot Menu, non-zero = Boot Menu timeout
[181]20    .wBootTimeout       resb    2   ; Boot Menu selection timeout in system timer ticks
21    .bIdeCnt            resb    1   ; Number of available IDE controllers
22    .bBootDrv           resb    1   ; Boot Menu default drive
23    .bMinFddCnt         resb    1   ; Minimum number of Floppy Drives
24    .bStealSize         resb    1   ; Number of 1kB blocks stolen from 640kB base RAM
[90]25
[316]26    .ideVarsBegin:
[181]27    .ideVars0           resb    IDEVARS_size
28    .ideVars1           resb    IDEVARS_size
29    .ideVars2           resb    IDEVARS_size
30    .ideVars3           resb    IDEVARS_size
[175]31
[176]32%ifdef MODULE_SERIAL
[175]33    .ideVarsSerialAuto  resb    IDEVARS_size
[176]34%endif
[316]35
36    .ideVarsEnd:
[3]37endstruc
38
[316]39%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
40    %if ROMVARS.ideVarsEnd & 0xff00 <> 0
41        %error ".ideVars structures must fit within the first 256 bytes of the ROM image"
42    %endif
43    %if (ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) = 0
[322]44        %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."
[316]45    %endif
46%endif
47
[3]48; Bit defines for ROMVARS.wFlags
[199]49FLG_ROMVARS_FULLMODE                EQU (1<<0)  ; Full operating mode (steals base RAM, supports EBIOS etc.)
50FLG_ROMVARS_DRVXLAT                 EQU (1<<2)  ; Enable drive number translation
51FLG_ROMVARS_SERIAL_SCANDETECT       EQU (1<<3)  ; Scan COM ports at the end of drive detection.  Can also be invoked
52                                                ; by holding down the ALT key at the end of drive detection.
53                                                ; (Conveniently, this is 8, a fact we exploit when testing the bit)
[363]54FLG_ROMVARS_MODULE_ADVATA           EQU (1<<4)  ; Here in case the configuration needs to know functionality is present
[243]55FLG_ROMVARS_MODULE_JRIDE            EQU (1<<5)  ; Here in case the configuration needs to know functionality is present
[199]56FLG_ROMVARS_MODULE_SERIAL           EQU (1<<6)  ; Here in case the configuration needs to know functionality is present
57FLG_ROMVARS_MODULE_EBIOS            EQU (1<<7)  ; Here in case the configuration needs to know functionality is present
[176]58
[143]59; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes)
60DEFAULT_TEXT_MODE       EQU 4
[3]61
[143]62
[3]63; Controller specific variables
64struc IDEVARS
[233]65;;; Word 0
66    .wSerialPortAndBaud:                    ; Serial connection port (low, divided by 4) and baud rate divisor (high)
[196]67    .wPort:                                 ; IDE Base Port for Command Block (usual) Registers
[233]68    .bSerialPort                resb    1
69    .bSerialBaud                resb    1
[196]70
[233]71;;; Word 1
72    .wPortCtrl:
73    .bSerialUnused              resb    1   ; IDE Base Port for Control Block Registers
[196]74
[233]75    .wSerialCOMPortCharAndDevice:           ; In DetectPrint, we grab the COM Port char and Device at the same time
76    .bSerialCOMPortChar         resb    1   ; Serial connection COM port number/letter
77
78;;; Word 2
[196]79    .bDevice                    resb    1   ; Device type
[233]80
[196]81    .bIRQ                       resb    1   ; Interrupt Request Number
[233]82
83;;; And more...
[196]84    .drvParamsMaster            resb    DRVPARAMS_size
85    .drvParamsSlave             resb    DRVPARAMS_size
[3]86endstruc
87
[261]88%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
89    %if IDEVARS.bSerialCOMPortChar+1 != IDEVARS.bDevice
90        %error "IDEVARS.bSerialCOMPortChar needs to come immediately before IDEVARS.bDevice so that both bytes can be fetched at the same time inside DetectPrint.asm"
91    %endif
[233]92%endif
93
[199]94; Default values for Port and PortCtrl, shared with the configurator
95;
96DEVICE_XTIDE_DEFAULT_PORT               EQU     300h
97DEVICE_XTIDE_DEFAULT_PORTCTRL           EQU     308h
98DEVICE_ATA_DEFAULT_PORT                 EQU     1F0h
99DEVICE_ATA_DEFAULT_PORTCTRL             EQU     3F0h
[363]100DEVICE_ATA_DEFAULT_SECONDARY_PORT       EQU     170h
101DEVICE_ATA_DEFAULT_SECONDARY_PORTCTRL   EQU     370h
[199]102
[175]103; Device types for IDEVARS.bDevice
[199]104;
[361]105DEVICE_XTIDE_REV1                       EQU (0<<1)
106DEVICE_XTIDE_REV2                       EQU (1<<1)  ; Or rev 1 with swapped A0 and A3 (chuck mod)
107DEVICE_FAST_XTIDE                       EQU (2<<1)  ; (CPLD v2 project)
[150]108DEVICE_16BIT_ATA                        EQU (3<<1)
109DEVICE_32BIT_ATA                        EQU (4<<1)
[244]110DEVICE_SERIAL_PORT                      EQU (5<<1)
[238]111DEVICE_JRIDE_ISA                        EQU (6<<1)
[3]112
[199]113
[3]114; Master/Slave drive specific parameters
115struc DRVPARAMS
116    .wFlags         resb    2   ; Drive flags
[227]117    .dwMaximumLBA:              ; User specified maximum number of sectors
[3]118    .wCylinders     resb    2   ; User specified cylinders (1...16383)
[99]119    .wHeadsAndSectors:
120    .bHeads         resb    1   ; User specified Heads (1...16)
[3]121    .bSect          resb    1   ; User specified Sectors per track (1...63)
122endstruc
123
124; Bit defines for DRVPARAMS.wFlags
[276]125MASK_DRVPARAMS_WRITECACHE   EQU (3<<0)  ; Drive internal write cache settings (must start at bit 0)
126FLG_DRVPARAMS_BLOCKMODE     EQU (1<<2)  ; Enable Block mode transfers
127FLG_DRVPARAMS_USERCHS       EQU (1<<3)  ; User specified P-CHS values
128FLG_DRVPARAMS_USERLBA       EQU (1<<4)  ; User specified LBA values
[3]129
[276]130; Drive Write Cache values for DRVPARAMS.wFlags.MASK_DRVPARAMS_WRITECACHE
131DEFAULT_WRITE_CACHE         EQU 0       ; Must be 0
132DISABLE_WRITE_CACHE         EQU 1
133ENABLE_WRITE_CACHE          EQU 2
134
[3]135%endif ; ROMVARS_INC
Note: See TracBrowser for help on using the repository browser.