2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/include/hal.h
5 * PURPOSE: Internal header for the I/O HAL Functions (Fstub)
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
12 // Default implementations of HAL dispatch table
16 xHalExamineMBR(IN PDEVICE_OBJECT DeviceObject
,
18 IN ULONG MbrTypeIdentifier
,
19 OUT PVOID
*MbrBuffer
);
23 xHalIoAssignDriveLetters(IN PLOADER_PARAMETER_BLOCK LoaderBlock
,
24 IN PSTRING NtDeviceName
,
25 OUT PUCHAR NtSystemPath
,
26 OUT PSTRING NtSystemPathString
);
30 xHalIoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject
,
32 IN BOOLEAN ReturnRecognizedPartitions
,
33 IN OUT PDRIVE_LAYOUT_INFORMATION
*PartitionBuffer
);
37 xHalIoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject
,
39 IN ULONG PartitionNumber
,
40 IN ULONG PartitionType
);
44 xHalIoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject
,
46 IN ULONG SectorsPerTrack
,
47 IN ULONG NumberOfHeads
,
48 IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer
);
76 xHalGetInterruptTranslator(IN INTERFACE_TYPE ParentInterfaceType
,
77 IN ULONG ParentBusNumber
,
78 IN INTERFACE_TYPE BridgeInterfaceType
,
81 OUT PTRANSLATOR_INTERFACE Translator
,
82 OUT PULONG BridgeBusNumber
);
86 // Various offsets in the boot record
88 #define PARTITION_TABLE_OFFSET (0x1BE / 2)
89 #define BOOT_SIGNATURE_OFFSET ((0x200 / 2) - 1)
90 #define BOOT_RECORD_RESERVED 0x1BC
91 #define BOOT_RECORD_SIGNATURE 0xAA55
92 #define NUM_PARTITION_TABLE_ENTRIES 4
97 #define GET_STARTING_SECTOR(p) \
98 ((ULONG)(p->StartingSectorLsb0) + \
99 (ULONG)(p->StartingSectorLsb1 << 8 ) + \
100 (ULONG)(p->StartingSectorMsb0 << 16) + \
101 (ULONG)(p->StartingSectorMsb1 << 24))
103 #define GET_ENDING_S_OF_CHS(p) \
104 ((UCHAR)(p->EndingCylinderLsb & 0x3F))
106 #define GET_PARTITION_LENGTH(p) \
107 ((ULONG)(p->PartitionLengthLsb0) + \
108 (ULONG)(p->PartitionLengthLsb1 << 8) + \
109 (ULONG)(p->PartitionLengthMsb0 << 16) + \
110 (ULONG)(p->PartitionLengthMsb1 << 24))
113 // Structure describing a partition
115 typedef struct _PARTITION_DESCRIPTOR
119 UCHAR StartingCylinderLsb
;
120 UCHAR StartingCylinderMsb
;
123 UCHAR EndingCylinderLsb
;
124 UCHAR EndingCylinderMsb
;
125 UCHAR StartingSectorLsb0
;
126 UCHAR StartingSectorLsb1
;
127 UCHAR StartingSectorMsb0
;
128 UCHAR StartingSectorMsb1
;
129 UCHAR PartitionLengthLsb0
;
130 UCHAR PartitionLengthLsb1
;
131 UCHAR PartitionLengthMsb0
;
132 UCHAR PartitionLengthMsb1
;
133 } PARTITION_DESCRIPTOR
, *PPARTITION_DESCRIPTOR
;
136 // Structure describing a boot sector
138 typedef struct _BOOT_SECTOR_INFO
143 UCHAR BytesPerSector
[2];
145 UCHAR NumberOfSectors
[2];
148 UCHAR SectorsPerTrack
[2];
149 UCHAR NumberOfHeads
[2];
150 } BOOT_SECTOR_INFO
, *PBOOT_SECTOR_INFO
;
153 // Partition Table and Disk Layout
155 typedef struct _PARTITION_TABLE
157 PARTITION_INFORMATION PartitionEntry
[4];
158 } PARTITION_TABLE
, *PPARTITION_TABLE
;
160 typedef struct _DISK_LAYOUT
164 PARTITION_TABLE PartitionTable
[1];
165 } DISK_LAYOUT
, *PDISK_LAYOUT
;
168 // Partition Table Entry
174 USHORT StartingCylinder
;
177 USHORT EndingCylinder
;
178 ULONG StartingSector
;
179 ULONG PartitionLength
;