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

Last change on this file since 235 was 233, checked in by gregli@…, 12 years ago

Serial Port: split single byte port and baud into two bytes, taking advantage of the two bytes in DPT_SERIAL, which supports more serial baud rates and in particular fixed a bug where a 4x client machine couldn't talk to a 115.2K server machine. This is a wide change, touching lots of files, but most are shallow changes. DetectPrint.asm took the most significant changes, now it calculates the baud rate to display instead of using characters provided by the Configurator. The Configurator now has a new menu flag, FLG_MENUITEM_CHOICESTRINGS, for specifying that values are not linear and they should be lookedup rather than indexed. Finally, another important bug fixed here is that in some error cases, the serial port code could get into an infinite loop waiting ont the hardware; now it has a timeout.

File size: 4.8 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
19 .wBootTimeout resb 2 ; Boot Menu selection timeout in system timer ticks
20 .bIdeCnt resb 1 ; Number of available IDE controllers
21 .bBootDrv resb 1 ; Boot Menu default drive
22 .bMinFddCnt resb 1 ; Minimum number of Floppy Drives
23 .bStealSize resb 1 ; Number of 1kB blocks stolen from 640kB base RAM
[90]24
[181]25 .ideVars0 resb IDEVARS_size
26 .ideVars1 resb IDEVARS_size
27 .ideVars2 resb IDEVARS_size
28 .ideVars3 resb IDEVARS_size
[175]29
[176]30%ifdef MODULE_SERIAL
[175]31 .ideVarsSerialAuto resb IDEVARS_size
[176]32%endif
[3]33endstruc
34
35; Bit defines for ROMVARS.wFlags
[199]36FLG_ROMVARS_FULLMODE EQU (1<<0) ; Full operating mode (steals base RAM, supports EBIOS etc.)
37FLG_ROMVARS_DRVXLAT EQU (1<<2) ; Enable drive number translation
38FLG_ROMVARS_SERIAL_SCANDETECT EQU (1<<3) ; Scan COM ports at the end of drive detection. Can also be invoked
39 ; by holding down the ALT key at the end of drive detection.
40 ; (Conveniently, this is 8, a fact we exploit when testing the bit)
41FLG_ROMVARS_MODULE_SERIAL EQU (1<<6) ; Here in case the configuration needs to know functionality is present
42FLG_ROMVARS_MODULE_EBIOS EQU (1<<7) ; Here in case the configuration needs to know functionality is present
[176]43
[143]44; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes)
45DEFAULT_TEXT_MODE EQU 4
[3]46
[143]47
[3]48; Controller specific variables
49struc IDEVARS
[233]50;;; Word 0
51 .wSerialPortAndBaud: ; Serial connection port (low, divided by 4) and baud rate divisor (high)
[196]52 .wPort: ; IDE Base Port for Command Block (usual) Registers
[233]53 .bSerialPort resb 1
54 .bSerialBaud resb 1
[196]55
[233]56;;; Word 1
57 .wPortCtrl:
58 .bSerialUnused resb 1 ; IDE Base Port for Control Block Registers
[196]59
[233]60 .wSerialCOMPortCharAndDevice: ; In DetectPrint, we grab the COM Port char and Device at the same time
61 .bSerialCOMPortChar resb 1 ; Serial connection COM port number/letter
62
63;;; Word 2
[196]64 .bDevice resb 1 ; Device type
[233]65
[196]66 .bIRQ resb 1 ; Interrupt Request Number
[233]67
68;;; And more...
[196]69 .drvParamsMaster resb DRVPARAMS_size
70 .drvParamsSlave resb DRVPARAMS_size
[3]71endstruc
72
[233]73%if IDEVARS.bSerialCOMPortChar+1 != IDEVARS.bDevice
74%erorr "IDEVARS.bSerialCOMPortChar needs to come immediately before IDEVARS.bDevice so that both bytes can be fetched at the same time inside DetectPrint.asm"
75%endif
76
[199]77; Default values for Port and PortCtrl, shared with the configurator
78;
79DEVICE_XTIDE_DEFAULT_PORT EQU 300h
80DEVICE_XTIDE_DEFAULT_PORTCTRL EQU 308h
81DEVICE_ATA_DEFAULT_PORT EQU 1F0h
82DEVICE_ATA_DEFAULT_PORTCTRL EQU 3F0h
83
[175]84; Device types for IDEVARS.bDevice
[199]85;
[150]86DEVICE_8BIT_DUAL_PORT_XTIDE EQU (0<<1)
87DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0 EQU (1<<1)
88DEVICE_8BIT_SINGLE_PORT EQU (2<<1)
89DEVICE_16BIT_ATA EQU (3<<1)
90DEVICE_32BIT_ATA EQU (4<<1)
[233]91DEVICE_SERIAL_PORT EQU (5<<1) ; must be last entry, or remove optimization in DetectPrint
[3]92
[199]93
[3]94; Master/Slave drive specific parameters
95struc DRVPARAMS
96 .wFlags resb 2 ; Drive flags
[227]97 .dwMaximumLBA: ; User specified maximum number of sectors
[3]98 .wCylinders resb 2 ; User specified cylinders (1...16383)
[99]99 .wHeadsAndSectors:
100 .bHeads resb 1 ; User specified Heads (1...16)
[3]101 .bSect resb 1 ; User specified Sectors per track (1...63)
102endstruc
103
104; Bit defines for DRVPARAMS.wFlags
105FLG_DRVPARAMS_USERCHS EQU (1<<0) ; User specified P-CHS values
106FLG_DRVPARAMS_BLOCKMODE EQU (1<<1) ; Enable Block mode transfers
[227]107FLG_DRVPARAMS_USERLBA EQU (1<<2) ; User specified LBA values
[3]108
[199]109;
110; COM Number to I/O Port Address Mapping
111;
112; COM Number: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
113; Corresponds to I/O port: 3f8, 2f8, 3e8, 2e8, 2f0, 3e0, 2e0, 260, 368, 268, 360, 270
114; Corresponds to Packed I/O port (hex): 37, 17, 35, 15, 16, 34, 14, 4, 25, 5, 24, 6
115;
116DEVICE_SERIAL_COM1 EQU 3f8h
117DEVICE_SERIAL_COM2 EQU 2f8h
118DEVICE_SERIAL_COM3 EQU 3e8h
119DEVICE_SERIAL_COM4 EQU 2e8h
120DEVICE_SERIAL_COM5 EQU 2f0h
121DEVICE_SERIAL_COM6 EQU 3e0h
122DEVICE_SERIAL_COM7 EQU 2e0h
123DEVICE_SERIAL_COM8 EQU 260h
124DEVICE_SERIAL_COM9 EQU 368h
125DEVICE_SERIAL_COMA EQU 268h
126DEVICE_SERIAL_COMB EQU 360h
127DEVICE_SERIAL_COMC EQU 270h
128
129
[3]130%endif ; ROMVARS_INC
Note: See TracBrowser for help on using the repository browser.