[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] | 8 | struc 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] | 33 | endstruc |
---|
| 34 | |
---|
| 35 | ; Bit defines for ROMVARS.wFlags |
---|
[199] | 36 | FLG_ROMVARS_FULLMODE EQU (1<<0) ; Full operating mode (steals base RAM, supports EBIOS etc.) |
---|
| 37 | FLG_ROMVARS_DRVXLAT EQU (1<<2) ; Enable drive number translation |
---|
| 38 | FLG_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) |
---|
| 41 | FLG_ROMVARS_MODULE_SERIAL EQU (1<<6) ; Here in case the configuration needs to know functionality is present |
---|
| 42 | FLG_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) |
---|
| 45 | DEFAULT_TEXT_MODE EQU 4 |
---|
[3] | 46 | |
---|
[143] | 47 | |
---|
[3] | 48 | ; Controller specific variables |
---|
| 49 | struc IDEVARS |
---|
[196] | 50 | .wPort: ; IDE Base Port for Command Block (usual) Registers |
---|
| 51 | .bSerialCOMDigit resb 1 ; Serial Device COM Port digit |
---|
| 52 | .bSerialPackedPortAndBaud resb 1 ; Serial Device packed port and baud |
---|
| 53 | |
---|
| 54 | .wPortCtrl: ; IDE Base Port for Control Block Registers |
---|
| 55 | .wSerialPackedPrintBaud resb 2 ; Serial Device packed baud rate for printing |
---|
| 56 | |
---|
| 57 | .bDevice resb 1 ; Device type |
---|
| 58 | .bIRQ resb 1 ; Interrupt Request Number |
---|
| 59 | .drvParamsMaster resb DRVPARAMS_size |
---|
| 60 | .drvParamsSlave resb DRVPARAMS_size |
---|
[3] | 61 | endstruc |
---|
| 62 | |
---|
[199] | 63 | ; Default values for Port and PortCtrl, shared with the configurator |
---|
| 64 | ; |
---|
| 65 | DEVICE_XTIDE_DEFAULT_PORT EQU 300h |
---|
| 66 | DEVICE_XTIDE_DEFAULT_PORTCTRL EQU 308h |
---|
| 67 | DEVICE_ATA_DEFAULT_PORT EQU 1F0h |
---|
| 68 | DEVICE_ATA_DEFAULT_PORTCTRL EQU 3F0h |
---|
| 69 | DEVICE_SERIAL_DEFAULT_COM EQU 0 ; COM1 |
---|
| 70 | DEVICE_SERIAL_DEFAULT_BAUD EQU 1 ; 9600 |
---|
| 71 | |
---|
[175] | 72 | ; Device types for IDEVARS.bDevice |
---|
[199] | 73 | ; |
---|
[150] | 74 | DEVICE_8BIT_DUAL_PORT_XTIDE EQU (0<<1) |
---|
| 75 | DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0 EQU (1<<1) |
---|
| 76 | DEVICE_8BIT_SINGLE_PORT EQU (2<<1) |
---|
| 77 | DEVICE_16BIT_ATA EQU (3<<1) |
---|
| 78 | DEVICE_32BIT_ATA EQU (4<<1) |
---|
| 79 | DEVICE_SERIAL_PORT EQU (5<<1) |
---|
[3] | 80 | |
---|
[199] | 81 | |
---|
[3] | 82 | ; Master/Slave drive specific parameters |
---|
| 83 | struc DRVPARAMS |
---|
| 84 | .wFlags resb 2 ; Drive flags |
---|
| 85 | .wCylinders resb 2 ; User specified cylinders (1...16383) |
---|
[99] | 86 | .wHeadsAndSectors: |
---|
| 87 | .bHeads resb 1 ; User specified Heads (1...16) |
---|
[3] | 88 | .bSect resb 1 ; User specified Sectors per track (1...63) |
---|
| 89 | endstruc |
---|
| 90 | |
---|
| 91 | ; Bit defines for DRVPARAMS.wFlags |
---|
| 92 | FLG_DRVPARAMS_USERCHS EQU (1<<0) ; User specified P-CHS values |
---|
| 93 | FLG_DRVPARAMS_BLOCKMODE EQU (1<<1) ; Enable Block mode transfers |
---|
| 94 | |
---|
| 95 | |
---|
[199] | 96 | ; Defines for IDEVARS.bSerialPackedPortAndBaud (same format used by DPT.bSerialPortAndBaud) |
---|
| 97 | ; |
---|
| 98 | ; pppp ppbb |
---|
| 99 | ; i/o port address = p * 2 + 240h |
---|
| 100 | ; baud rate = b, where 00 = 2400, 01 = 9600, 10 = 38.4K, 11 = 115.2K |
---|
| 101 | ; |
---|
[203] | 102 | ; 240h/2400baud corresponds to 0 for a PackedPortAndBaud value, which triggers auto detect code. |
---|
| 103 | ; Which means 240h is not usable, and is why ..._MINPORT is 248h. A value is reserved at the upper |
---|
| 104 | ; end of the spectrum in case it is needed (whcih is why it is 430h instead of 438h). |
---|
[200] | 105 | ; |
---|
| 106 | DEVICE_SERIAL_PACKEDPORTANDBAUD_PORTMASK EQU 0fch |
---|
| 107 | DEVICE_SERIAL_PACKEDPORTANDBAUD_PORTBITS EQU 03fh |
---|
| 108 | DEVICE_SERIAL_PACKEDPORTANDBAUD_PORT_FIELD_POSITION EQU 2 |
---|
| 109 | DEVICE_SERIAL_PACKEDPORTANDBAUD_STARTINGPORT EQU 240h |
---|
[203] | 110 | DEVICE_SERIAL_PACKEDPORTANDBAUD_MINPORT EQU 248h ; minimum port value that the user can set |
---|
| 111 | DEVICE_SERIAL_PACKEDPORTANDBAUD_MAXPORT EQU 430h ; or ((..._PORTMASK-1) << 1) + ..._STARTINGPORT |
---|
[199] | 112 | |
---|
[200] | 113 | DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUDMASK EQU 3h |
---|
| 114 | DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUDBITS EQU 3h |
---|
| 115 | DEVICE_SERIAL_PACKEDPORTANDBAUD_BAUD_FIELD_POSITION EQU 0 |
---|
| 116 | |
---|
[199] | 117 | ; Defines for IDEVARS.wSerialPrintBaud |
---|
| 118 | ; |
---|
| 119 | ; pppp ppnn nnnn nnnn |
---|
| 120 | ; unsigned number to output = n |
---|
| 121 | ; postfix character = p + '0' (designed for '0' and 'K', although other values are possible) |
---|
| 122 | ; |
---|
| 123 | ; Note that the contents of this word is only used for printing by the BIOS when a drive is detected. |
---|
| 124 | ; It is not used for any other purpose, and so long as it conforms to the structure, any values can be used. |
---|
| 125 | ; |
---|
| 126 | DEVICE_SERIAL_PRINTBAUD_NUMBERMASK EQU 003ffh |
---|
| 127 | DEVICE_SERIAL_PRINTBAUD_POSTCHARMASK EQU 0fc00h |
---|
| 128 | DEVICE_SERIAL_PRINTBAUD_POSTCHARADD EQU '0' |
---|
| 129 | ; |
---|
| 130 | ; These are defined here (instead of in the configurator) for consistency since they could also be used |
---|
| 131 | ; in main.asm as a default for an IDEVARS structure. |
---|
| 132 | ; |
---|
| 133 | DEVICE_SERIAL_PRINTBAUD_2400 EQU ((('0'-DEVICE_SERIAL_PRINTBAUD_POSTCHARADD)<<10) | 240) ; Prints "2400" |
---|
| 134 | DEVICE_SERIAL_PRINTBAUD_9600 EQU ((('0'-DEVICE_SERIAL_PRINTBAUD_POSTCHARADD)<<10) | 960) ; Prints "9600" |
---|
| 135 | DEVICE_SERIAL_PRINTBAUD_38_4 EQU ((('K'-DEVICE_SERIAL_PRINTBAUD_POSTCHARADD)<<10) | 38) ; Prints "38K" |
---|
| 136 | DEVICE_SERIAL_PRINTBAUD_115_2 EQU ((('K'-DEVICE_SERIAL_PRINTBAUD_POSTCHARADD)<<10) | 115) ; Prints "115K" |
---|
| 137 | |
---|
| 138 | ; |
---|
| 139 | ; COM Number to I/O Port Address Mapping |
---|
| 140 | ; |
---|
| 141 | ; COM Number: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 |
---|
| 142 | ; Corresponds to I/O port: 3f8, 2f8, 3e8, 2e8, 2f0, 3e0, 2e0, 260, 368, 268, 360, 270 |
---|
| 143 | ; Corresponds to Packed I/O port (hex): 37, 17, 35, 15, 16, 34, 14, 4, 25, 5, 24, 6 |
---|
| 144 | ; |
---|
| 145 | DEVICE_SERIAL_COM1 EQU 3f8h |
---|
| 146 | DEVICE_SERIAL_COM2 EQU 2f8h |
---|
| 147 | DEVICE_SERIAL_COM3 EQU 3e8h |
---|
| 148 | DEVICE_SERIAL_COM4 EQU 2e8h |
---|
| 149 | DEVICE_SERIAL_COM5 EQU 2f0h |
---|
| 150 | DEVICE_SERIAL_COM6 EQU 3e0h |
---|
| 151 | DEVICE_SERIAL_COM7 EQU 2e0h |
---|
| 152 | DEVICE_SERIAL_COM8 EQU 260h |
---|
| 153 | DEVICE_SERIAL_COM9 EQU 368h |
---|
| 154 | DEVICE_SERIAL_COMA EQU 268h |
---|
| 155 | DEVICE_SERIAL_COMB EQU 360h |
---|
| 156 | DEVICE_SERIAL_COMC EQU 270h |
---|
| 157 | |
---|
| 158 | |
---|
[3] | 159 | %endif ; ROMVARS_INC |
---|