source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS/Inc/CompatibleDPT.inc@ 560

Last change on this file since 560 was 541, checked in by aitotat@…, 12 years ago

Changes to XTIDE Universal BIOS:

  • Brought back compatible DPTs.
File size: 4.3 KB
RevLine 
[541]1; Project name : XTIDE Universal BIOS
2; Description : Defines for DPT structs to present drive geometry
3; to ill behaving applications that want
4; to read DPT from interrupt vectors 41h and 46h.
5
6;
7; XTIDE Universal BIOS and Associated Tools
8; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
9;
10; This program is free software; you can redistribute it and/or modify
11; it under the terms of the GNU General Public License as published by
12; the Free Software Foundation; either version 2 of the License, or
13; (at your option) any later version.
14;
15; This program is distributed in the hope that it will be useful,
16; but WITHOUT ANY WARRANTY; without even the implied warranty of
17; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18; GNU General Public License for more details.
19; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20;
21
22%ifndef COMPATIBLE_DPT
23%define COMPATIBLE_DPT
24
25; Standard DPT for small drives with 1024 or less cylinders
26struc STANDARD_DPT
27 .wPchsCylinders resb 2 ; 0-1, Physical number of cylinders
28 .bPchsHeads resb 1 ; 2, Physical number of heads
29 .bReserved3to4 resb 2 ; 3-4, Reserved
30 .wPrecompCylinder resb 2 ; 5-6, Write Precompensation Cylinder
31 .bReserved7 resb 1 ; 7, Reserved
32 .bDrvControlByte resb 1 ; 8, Drive Control Byte
33 .bReserved9to11 resb 3 ; 9-11, Reserved
34 .wLandingZone resb 2 ; 12-13, Landing Zone Cylinder
35 .bPchsSectPerTrack resb 1 ; 14, Physical sectors per track
36 .bReserved15 resb 1 ; 15, Reserved
37endstruc
38
39
40; Translated DPT for drives with more than 1024 cylinders
41struc TRANSLATED_DPT
42 .wLchsCylinders resb 2 ; 0-1, Logical number of cylinders
43 .bLchsHeads resb 1 ; 2, Logical number of heads
44 .bSignature resb 1 ; 3, Axh signature to indicate Translated DPT
45 .bPchsSectPerTrack resb 1 ; 4, Physical sectors per track
46 .wPrecompCylinder resb 2 ; 5-6, Write Precompensation Cylinder
47 .bReserved7 resb 1 ; 7, Reserved
48 .bDrvControlByte resb 1 ; 8, Drive Control Byte
49 .wPchsCylinders resb 2 ; 9-10, Physical number of cylinders
50 .bPchsHeads resb 1 ; 11, Physical number of heads
51 .wLandingZone resb 2 ; 12-13, Landing Zone Cylinder
52 .bLchsSectPerTrack resb 1 ; 14, Logical sectors per track
53 .bChecksum resb 1 ; 15, Checksum: 2's complement of the 8-bit unsigned sum of bytes 0-14
54endstruc
55
56TRANSLATED_DPT_SIGNATURE EQU 0A0h
57
58
59; Device Parameter Table Extension (returned by AH=48h EBIOS function)
60struc DPTE
61 .wBasePort resb 2 ; 0, Command Block Base Port Address
62 .wControlBlockPort resb 2 ; 2, Control Block Base Port Address
63 .bDrvnhead resb 1 ; 4, Drive and Head Select Register upper nibble
64 .bBiosVendor resb 1 ; 5, BIOS Vendor Specific
65 .bIRQ resb 1 ; 6, IRQ for this device
66 .bBlockSize resb 1 ; 7, Current block size in sectors
67 .bDmaChannelAndType resb 1 ; 8, DMA information
68 .bPioMode resb 1 ; 9, PIO mode
69 .wFlags resb 2 ; 10, BIOS selected hardware specific option flags
70 .wReserved resb 2 ; 12, Reserved. Must be zero.
71 .bRevision resb 1 ; 14, Revision level of this table (11h)
72 .bChecksum resb 1 ; 15, Checksum: 2's complement of the sum of bytes 0-14
73endstruc
74
75; Flags for DPTE.wFlags
76FLG_FAST_PIO_ENABLED EQU (1<<0) ; Set if using PIO mode 1 or above (DPTE.bPioMode is valid when set)
77FLG_DMA_ENABLED EQU (1<<1) ; Set if DMA enabled (DPTE.bDmaChannelAndType is valid when set)
78FLG_BLOCK_MODE_ENABLED EQU (1<<2) ; Set if Block Mode transfers are enabled (DPTE.bBlockSize is valid when set)
79FLG_CHS_TRANSLATION_ENABLED EQU (1<<3) ; Set for drives with more than 1024 cylinders
80FLG_LBA_TRANSLATION_ENABLED EQU (1<<4) ; Set when LBA addresses from DAP are passed directly to the drive
81FLG_REMOVABLE_MEDIA EQU (1<<5)
82FLG_ATAPI_DEVICE EQU (1<<6)
83FLG_32BIT_XFER_MODE EQU (1<<7) ; Set when using 32-bit data transfers
84FLG_ATAPI_USES_IRQ EQU (1<<8) ; ATAPI Device uses IRQ for data transfers
85; L-CHS translation type for old INT 13h (when FLG_CHS_TRANSLATION_ENABLED is set)
86MASK_CHS_TRANSLATION_TYPE EQU (3<<TRANSLATION_TYPE_FIELD_POSITION)
87 TRANSLATION_TYPE_FIELD_POSITION EQU 9
88 BIT_SHIFT_TRANSLATION EQU 0 ; LARGE
89 LBA_ASSISTED_TRANSLATION EQU 1 ; Assisted LBA
90 ; 2 = reserved
91 VENDOR_SPECIFIC_TRANSLATION EQU 3
92
93
94DPTE_REVISION EQU 11h
95
96
97%endif ; COMPATIBLE_DPT
Note: See TracBrowser for help on using the repository browser.