[90] | 1 | ; Project name : XTIDE Universal BIOS |
---|
[3] | 2 | ; Description : Defines for ROMVARS struct containing variables stored |
---|
| 3 | ; in BIOS ROM. |
---|
[376] | 4 | |
---|
| 5 | ; |
---|
| 6 | ; XTIDE Universal BIOS and Associated Tools |
---|
| 7 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. |
---|
| 8 | ; |
---|
| 9 | ; This program is free software; you can redistribute it and/or modify |
---|
| 10 | ; it under the terms of the GNU General Public License as published by |
---|
| 11 | ; the Free Software Foundation; either version 2 of the License, or |
---|
| 12 | ; (at your option) any later version. |
---|
| 13 | ; |
---|
| 14 | ; This program is distributed in the hope that it will be useful, |
---|
| 15 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | ; GNU General Public License for more details. |
---|
| 18 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
| 19 | ; |
---|
| 20 | |
---|
[3] | 21 | %ifndef ROMVARS_INC |
---|
| 22 | %define ROMVARS_INC |
---|
| 23 | |
---|
[181] | 24 | ; ROM Variables. Written to the ROM image before flashing. |
---|
[3] | 25 | struc ROMVARS |
---|
[181] | 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) |
---|
[90] | 29 | |
---|
[181] | 30 | .rgbSign resb 8 ; Signature for XTIDE Configurator Program |
---|
| 31 | .szTitle resb 31 ; BIOS title string |
---|
| 32 | .szVersion resb 25 ; BIOS version string |
---|
[90] | 33 | |
---|
[181] | 34 | .wFlags resb 2 ; Word for ROM flags |
---|
| 35 | .wDisplayMode resb 2 ; Display mode for boot menu |
---|
[243] | 36 | .wfDisplayBootMenu: ; Zero = no Boot Menu, non-zero = Boot Menu timeout |
---|
[181] | 37 | .wBootTimeout resb 2 ; Boot Menu selection timeout in system timer ticks |
---|
| 38 | .bIdeCnt resb 1 ; Number of available IDE controllers |
---|
| 39 | .bBootDrv resb 1 ; Boot Menu default drive |
---|
| 40 | .bMinFddCnt resb 1 ; Minimum number of Floppy Drives |
---|
| 41 | .bStealSize resb 1 ; Number of 1kB blocks stolen from 640kB base RAM |
---|
[90] | 42 | |
---|
[316] | 43 | .ideVarsBegin: |
---|
[181] | 44 | .ideVars0 resb IDEVARS_size |
---|
| 45 | .ideVars1 resb IDEVARS_size |
---|
| 46 | .ideVars2 resb IDEVARS_size |
---|
| 47 | .ideVars3 resb IDEVARS_size |
---|
[175] | 48 | |
---|
[176] | 49 | %ifdef MODULE_SERIAL |
---|
[175] | 50 | .ideVarsSerialAuto resb IDEVARS_size |
---|
[176] | 51 | %endif |
---|
[316] | 52 | |
---|
| 53 | .ideVarsEnd: |
---|
[3] | 54 | endstruc |
---|
| 55 | |
---|
[316] | 56 | %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS |
---|
| 57 | %if ROMVARS.ideVarsEnd & 0xff00 <> 0 |
---|
| 58 | %error ".ideVars structures must fit within the first 256 bytes of the ROM image" |
---|
| 59 | %endif |
---|
| 60 | %if (ROMVARS.ideVarsEnd - ROMVARS.ideVarsBegin) = 0 |
---|
[322] | 61 | %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] | 62 | %endif |
---|
| 63 | %endif |
---|
| 64 | |
---|
[3] | 65 | ; Bit defines for ROMVARS.wFlags |
---|
[199] | 66 | FLG_ROMVARS_FULLMODE EQU (1<<0) ; Full operating mode (steals base RAM, supports EBIOS etc.) |
---|
| 67 | FLG_ROMVARS_DRVXLAT EQU (1<<2) ; Enable drive number translation |
---|
| 68 | FLG_ROMVARS_SERIAL_SCANDETECT EQU (1<<3) ; Scan COM ports at the end of drive detection. Can also be invoked |
---|
| 69 | ; by holding down the ALT key at the end of drive detection. |
---|
| 70 | ; (Conveniently, this is 8, a fact we exploit when testing the bit) |
---|
[363] | 71 | FLG_ROMVARS_MODULE_ADVATA EQU (1<<4) ; Here in case the configuration needs to know functionality is present |
---|
[243] | 72 | FLG_ROMVARS_MODULE_JRIDE EQU (1<<5) ; Here in case the configuration needs to know functionality is present |
---|
[199] | 73 | FLG_ROMVARS_MODULE_SERIAL EQU (1<<6) ; Here in case the configuration needs to know functionality is present |
---|
| 74 | FLG_ROMVARS_MODULE_EBIOS EQU (1<<7) ; Here in case the configuration needs to know functionality is present |
---|
[176] | 75 | |
---|
[143] | 76 | ; Boot Menu Display Modes (see Assembly Library Display.inc for standard modes) |
---|
| 77 | DEFAULT_TEXT_MODE EQU 4 |
---|
[3] | 78 | |
---|
[143] | 79 | |
---|
[3] | 80 | ; Controller specific variables |
---|
| 81 | struc IDEVARS |
---|
[233] | 82 | ;;; Word 0 |
---|
| 83 | .wSerialPortAndBaud: ; Serial connection port (low, divided by 4) and baud rate divisor (high) |
---|
[196] | 84 | .wPort: ; IDE Base Port for Command Block (usual) Registers |
---|
[233] | 85 | .bSerialPort resb 1 |
---|
| 86 | .bSerialBaud resb 1 |
---|
[196] | 87 | |
---|
[233] | 88 | ;;; Word 1 |
---|
| 89 | .wPortCtrl: |
---|
| 90 | .bSerialUnused resb 1 ; IDE Base Port for Control Block Registers |
---|
[196] | 91 | |
---|
[233] | 92 | .wSerialCOMPortCharAndDevice: ; In DetectPrint, we grab the COM Port char and Device at the same time |
---|
| 93 | .bSerialCOMPortChar resb 1 ; Serial connection COM port number/letter |
---|
| 94 | |
---|
| 95 | ;;; Word 2 |
---|
[196] | 96 | .bDevice resb 1 ; Device type |
---|
[233] | 97 | |
---|
[196] | 98 | .bIRQ resb 1 ; Interrupt Request Number |
---|
[233] | 99 | |
---|
| 100 | ;;; And more... |
---|
[196] | 101 | .drvParamsMaster resb DRVPARAMS_size |
---|
| 102 | .drvParamsSlave resb DRVPARAMS_size |
---|
[3] | 103 | endstruc |
---|
| 104 | |
---|
[261] | 105 | %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS |
---|
| 106 | %if IDEVARS.bSerialCOMPortChar+1 != IDEVARS.bDevice |
---|
| 107 | %error "IDEVARS.bSerialCOMPortChar needs to come immediately before IDEVARS.bDevice so that both bytes can be fetched at the same time inside DetectPrint.asm" |
---|
| 108 | %endif |
---|
[233] | 109 | %endif |
---|
| 110 | |
---|
[199] | 111 | ; Default values for Port and PortCtrl, shared with the configurator |
---|
| 112 | ; |
---|
| 113 | DEVICE_XTIDE_DEFAULT_PORT EQU 300h |
---|
| 114 | DEVICE_XTIDE_DEFAULT_PORTCTRL EQU 308h |
---|
| 115 | DEVICE_ATA_DEFAULT_PORT EQU 1F0h |
---|
| 116 | DEVICE_ATA_DEFAULT_PORTCTRL EQU 3F0h |
---|
[363] | 117 | DEVICE_ATA_DEFAULT_SECONDARY_PORT EQU 170h |
---|
| 118 | DEVICE_ATA_DEFAULT_SECONDARY_PORTCTRL EQU 370h |
---|
[199] | 119 | |
---|
[175] | 120 | ; Device types for IDEVARS.bDevice |
---|
[199] | 121 | ; |
---|
[361] | 122 | DEVICE_XTIDE_REV1 EQU (0<<1) |
---|
| 123 | DEVICE_XTIDE_REV2 EQU (1<<1) ; Or rev 1 with swapped A0 and A3 (chuck mod) |
---|
| 124 | DEVICE_FAST_XTIDE EQU (2<<1) ; (CPLD v2 project) |
---|
[150] | 125 | DEVICE_16BIT_ATA EQU (3<<1) |
---|
| 126 | DEVICE_32BIT_ATA EQU (4<<1) |
---|
[244] | 127 | DEVICE_SERIAL_PORT EQU (5<<1) |
---|
[238] | 128 | DEVICE_JRIDE_ISA EQU (6<<1) |
---|
[3] | 129 | |
---|
[199] | 130 | |
---|
[3] | 131 | ; Master/Slave drive specific parameters |
---|
| 132 | struc DRVPARAMS |
---|
| 133 | .wFlags resb 2 ; Drive flags |
---|
[227] | 134 | .dwMaximumLBA: ; User specified maximum number of sectors |
---|
[3] | 135 | .wCylinders resb 2 ; User specified cylinders (1...16383) |
---|
[99] | 136 | .wHeadsAndSectors: |
---|
| 137 | .bHeads resb 1 ; User specified Heads (1...16) |
---|
[3] | 138 | .bSect resb 1 ; User specified Sectors per track (1...63) |
---|
| 139 | endstruc |
---|
| 140 | |
---|
| 141 | ; Bit defines for DRVPARAMS.wFlags |
---|
[276] | 142 | MASK_DRVPARAMS_WRITECACHE EQU (3<<0) ; Drive internal write cache settings (must start at bit 0) |
---|
| 143 | FLG_DRVPARAMS_BLOCKMODE EQU (1<<2) ; Enable Block mode transfers |
---|
| 144 | FLG_DRVPARAMS_USERCHS EQU (1<<3) ; User specified P-CHS values |
---|
| 145 | FLG_DRVPARAMS_USERLBA EQU (1<<4) ; User specified LBA values |
---|
[3] | 146 | |
---|
[276] | 147 | ; Drive Write Cache values for DRVPARAMS.wFlags.MASK_DRVPARAMS_WRITECACHE |
---|
| 148 | DEFAULT_WRITE_CACHE EQU 0 ; Must be 0 |
---|
| 149 | DISABLE_WRITE_CACHE EQU 1 |
---|
| 150 | ENABLE_WRITE_CACHE EQU 2 |
---|
| 151 | |
---|
[3] | 152 | %endif ; ROMVARS_INC |
---|