source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc @ 233

Last change on this file since 233 was 233, checked in by gregli@…, 11 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: 3.2 KB
Line 
1; Project name  :   XTIDE Universal BIOS
2; Description   :   Defines for DPT structs containing custom
3;                   Disk Parameter Table used by this BIOS.
4%ifndef CUSTOMDPT_INC
5%define CUSTOMDPT_INC
6
7; Base DPT for all device types
8struc DPT   ; 10 bytes
9    ; General Disk Parameter Table related
10    .wFlags:
11    .bFlagsLow                  resb    1
12    .bFlagsHigh                 resb    1
13    .bIdevarsOffset             resb    1   ; Offset to IDEVARS for this drive
14
15    ; IDE Drive related
16    ; .twLbaSectors is used for LBA addressing only.
17    ; .wPchsCylinders and .bPchsSectors are used for CHS addressing only.
18    .bLbaHeads:                             ; Number of LBA assisted heads (1...255)
19    .twLbaSectors               resb    2   ; 48-bit sector count for LBA addressing
20    .wPchsCylinders             resb    2   ; Number of P-CHS Cylinders (1...16383)
21    .wPchsHeadsAndSectors:
22    .bPchsHeads                 resb    1   ; Number of P-CHS heads (1...16)
23    .bPchsSectors               resb    1   ; Number of P-CHS Sectors per Track (1...63)
24endstruc
25
26; DPT for ATA devices
27struc DPT_ATA   ; 10 + 2 bytes = 12 bytes
28    .dpt                        resb    DPT_size
29
30    ; Block size is specified in sectors (1, 2, 4, 8, 16, 32 or 64).
31    ; 128 is not allowed to prevent offset overflow during data transfer.
32    .wSetAndMaxBlock:
33    .bSetBlock                  resb    1   ; Current block size (at least 1)
34    .bMaxBlock                  resb    1   ; Maximum block size, 0 = block mode not supported
35endstruc
36
37%ifdef MODULE_SERIAL
38; DPT for Serial devices
39struc DPT_SERIAL
40    .dpt                        resb    DPT_size
41
42    .wSerialPortAndBaud:
43    .bSerialPort                resb    1   ; Serial connection I/O port address, divided by 4
44    .bSerialBaud                resb    1   ; Serial connection baud rate divisor
45endstruc
46%endif
47
48LARGEST_DPT_SIZE                EQU     DPT_ATA_size
49
50
51; Bit definitions for DPT.bFlagsLow
52MASKL_DPT_CHS_SHIFT_COUNT       EQU (7<<0)  ; Bits 0...3, P-CHS to L-CHS bit shift count (0...4)
53FLGL_DPT_SLAVE                  EQU FLG_DRVNHEAD_DRV    ; (1<<4), Drive is slave drive
54MASKL_DPT_ADDRESSING_MODE       EQU (3<<5)  ; Bits 5..6, Addressing Mode (bit 6 == FLG_DRVNHEAD_LBA)
55FLGL_DPT_ENABLE_IRQ             EQU (1<<7)
56
57; Bit definitions for DPT.bFlagsHigh
58FLGH_DPT_REVERSED_A0_AND_A3     EQU (1<<0)  ; XTIDE mod, Address lines 0 and 3 reversed
59FLGH_DPT_BLOCK_MODE_SUPPORTED   EQU (1<<1)  ; Use block transfer commands (must be bit 1!)
60%ifdef MODULE_SERIAL
61FLGH_DPT_SERIAL_DEVICE          EQU (1<<2)  ; Serial Port Device
62%endif
63FLGH_DPT_INTERRUPT_IN_SERVICE   EQU (1<<3)  ; Set when waiting for IRQ
64FLGH_DPT_RESET_nDRDY            EQU (1<<4)  ; Drive ready to accept commands
65FLGH_DPT_RESET_nINITPRMS        EQU (1<<5)  ; Initialize Device Parameters successfull
66FLGH_DPT_RESET_nRECALIBRATE     EQU (1<<6)  ; Recalibrate successfull
67FLGH_DPT_RESET_nSETBLOCK        EQU (1<<7)  ; Initialize Block Mode successfull
68MASKH_DPT_RESET                 EQU 0F0h
69
70; Addressing modes for DPT.wFlags
71ADDRESSING_MODE_FIELD_POSITION  EQU     5
72ADDRESSING_MODE_LCHS            EQU     0   ; L-CHS Addressing Mode (NORMAL in many other BIOSes)
73ADDRESSING_MODE_PCHS            EQU     1   ; P-CHS Addressing Mode (LARGE in many other BIOSes)
74ADDRESSING_MODE_LBA28           EQU     2   ; 28-bit LBA Addressing Mode
75ADDRESSING_MODE_LBA48           EQU     3   ; 48-bit LBA Addressing Mode
76
77; Number of Sectors per Track is fixed to 63 for LBA assist calculation.
78; 1024 cylinders, 256 heads, 63 sectors = 8.4 GB limit (but DOS does not support more than 255 heads)
79MAX_LCHS_CYLINDERS              EQU     1024
80LBA_ASSIST_SPT                  EQU     63
81
82
83%endif ; CUSTOMDPT_INC
Note: See TracBrowser for help on using the repository browser.