1 | ; Project name : XTIDE Universal BIOS
|
---|
2 | ; Description : Defines for ROMVARS struct containing variables stored
|
---|
3 | ; in BIOS ROM.
|
---|
4 | %ifndef ROMVARS_INC
|
---|
5 | %define ROMVARS_INC
|
---|
6 |
|
---|
7 | ; ROM Variables. Written to the ROM image before flashing.
|
---|
8 | struc ROMVARS
|
---|
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)
|
---|
12 |
|
---|
13 | .rgbSign resb 8 ; Signature for XTIDE Configurator Program
|
---|
14 | .szTitle resb 31 ; BIOS title string
|
---|
15 | .szVersion resb 25 ; BIOS version string
|
---|
16 |
|
---|
17 | .wFlags resb 2 ; Word for ROM flags
|
---|
18 | .wDisplayMode resb 2 ; Display mode for boot menu
|
---|
19 | .wfDisplayBootMenu: ; Zero = no Boot Menu, non-zero = Boot Menu timeout
|
---|
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
|
---|
25 |
|
---|
26 | .ideVars0 resb IDEVARS_size
|
---|
27 | .ideVars1 resb IDEVARS_size
|
---|
28 | .ideVars2 resb IDEVARS_size
|
---|
29 | .ideVars3 resb IDEVARS_size
|
---|
30 |
|
---|
31 | %ifdef MODULE_SERIAL
|
---|
32 | .ideVarsSerialAuto resb IDEVARS_size
|
---|
33 | %endif
|
---|
34 | endstruc
|
---|
35 |
|
---|
36 | ; Bit defines for ROMVARS.wFlags
|
---|
37 | FLG_ROMVARS_FULLMODE EQU (1<<0) ; Full operating mode (steals base RAM, supports EBIOS etc.)
|
---|
38 | FLG_ROMVARS_DRVXLAT EQU (1<<2) ; Enable drive number translation
|
---|
39 | FLG_ROMVARS_SERIAL_SCANDETECT EQU (1<<3) ; Scan COM ports at the end of drive detection. Can also be invoked
|
---|
40 | ; by holding down the ALT key at the end of drive detection.
|
---|
41 | ; (Conveniently, this is 8, a fact we exploit when testing the bit)
|
---|
42 | FLG_ROMVARS_MODULE_JRIDE EQU (1<<5) ; Here in case the configuration needs to know functionality is present
|
---|
43 | FLG_ROMVARS_MODULE_SERIAL EQU (1<<6) ; Here in case the configuration needs to know functionality is present
|
---|
44 | FLG_ROMVARS_MODULE_EBIOS EQU (1<<7) ; Here in case the configuration needs to know functionality is present
|
---|
45 |
|
---|
46 | ; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes)
|
---|
47 | DEFAULT_TEXT_MODE EQU 4
|
---|
48 |
|
---|
49 |
|
---|
50 | ; Controller specific variables
|
---|
51 | struc IDEVARS
|
---|
52 | ;;; Word 0
|
---|
53 | .wSerialPortAndBaud: ; Serial connection port (low, divided by 4) and baud rate divisor (high)
|
---|
54 | .wPort: ; IDE Base Port for Command Block (usual) Registers
|
---|
55 | .bSerialPort resb 1
|
---|
56 | .bSerialBaud resb 1
|
---|
57 |
|
---|
58 | ;;; Word 1
|
---|
59 | .wPortCtrl:
|
---|
60 | .bSerialUnused resb 1 ; IDE Base Port for Control Block Registers
|
---|
61 |
|
---|
62 | .wSerialCOMPortCharAndDevice: ; In DetectPrint, we grab the COM Port char and Device at the same time
|
---|
63 | .bSerialCOMPortChar resb 1 ; Serial connection COM port number/letter
|
---|
64 |
|
---|
65 | ;;; Word 2
|
---|
66 | .bDevice resb 1 ; Device type
|
---|
67 |
|
---|
68 | .bIRQ resb 1 ; Interrupt Request Number
|
---|
69 |
|
---|
70 | ;;; And more...
|
---|
71 | .drvParamsMaster resb DRVPARAMS_size
|
---|
72 | .drvParamsSlave resb DRVPARAMS_size
|
---|
73 | endstruc
|
---|
74 |
|
---|
75 | %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
|
---|
76 | %if IDEVARS.bSerialCOMPortChar+1 != IDEVARS.bDevice
|
---|
77 | %error "IDEVARS.bSerialCOMPortChar needs to come immediately before IDEVARS.bDevice so that both bytes can be fetched at the same time inside DetectPrint.asm"
|
---|
78 | %endif
|
---|
79 | %endif
|
---|
80 |
|
---|
81 | ; Default values for Port and PortCtrl, shared with the configurator
|
---|
82 | ;
|
---|
83 | DEVICE_XTIDE_DEFAULT_PORT EQU 300h
|
---|
84 | DEVICE_XTIDE_DEFAULT_PORTCTRL EQU 308h
|
---|
85 | DEVICE_ATA_DEFAULT_PORT EQU 1F0h
|
---|
86 | DEVICE_ATA_DEFAULT_PORTCTRL EQU 3F0h
|
---|
87 |
|
---|
88 | ; Device types for IDEVARS.bDevice
|
---|
89 | ;
|
---|
90 | DEVICE_8BIT_DUAL_PORT_XTIDE EQU (0<<1)
|
---|
91 | DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0 EQU (1<<1)
|
---|
92 | DEVICE_8BIT_SINGLE_PORT EQU (2<<1)
|
---|
93 | DEVICE_16BIT_ATA EQU (3<<1)
|
---|
94 | DEVICE_32BIT_ATA EQU (4<<1)
|
---|
95 | DEVICE_SERIAL_PORT EQU (5<<1)
|
---|
96 | DEVICE_JRIDE_ISA EQU (6<<1)
|
---|
97 |
|
---|
98 |
|
---|
99 | ; Master/Slave drive specific parameters
|
---|
100 | struc DRVPARAMS
|
---|
101 | .wFlags resb 2 ; Drive flags
|
---|
102 | .dwMaximumLBA: ; User specified maximum number of sectors
|
---|
103 | .wCylinders resb 2 ; User specified cylinders (1...16383)
|
---|
104 | .wHeadsAndSectors:
|
---|
105 | .bHeads resb 1 ; User specified Heads (1...16)
|
---|
106 | .bSect resb 1 ; User specified Sectors per track (1...63)
|
---|
107 | endstruc
|
---|
108 |
|
---|
109 | ; Bit defines for DRVPARAMS.wFlags
|
---|
110 | MASK_DRVPARAMS_WRITECACHE EQU (3<<0) ; Drive internal write cache settings (must start at bit 0)
|
---|
111 | FLG_DRVPARAMS_BLOCKMODE EQU (1<<2) ; Enable Block mode transfers
|
---|
112 | FLG_DRVPARAMS_USERCHS EQU (1<<3) ; User specified P-CHS values
|
---|
113 | FLG_DRVPARAMS_USERLBA EQU (1<<4) ; User specified LBA values
|
---|
114 |
|
---|
115 | ; Drive Write Cache values for DRVPARAMS.wFlags.MASK_DRVPARAMS_WRITECACHE
|
---|
116 | DEFAULT_WRITE_CACHE EQU 0 ; Must be 0
|
---|
117 | DISABLE_WRITE_CACHE EQU 1
|
---|
118 | ENABLE_WRITE_CACHE EQU 2
|
---|
119 |
|
---|
120 | %endif ; ROMVARS_INC
|
---|