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
);
64 // Various offsets in the boot record
66 #define PARTITION_TABLE_OFFSET (0x1BE / 2)
67 #define BOOT_SIGNATURE_OFFSET ((0x200 / 2) - 1)
68 #define BOOT_RECORD_RESERVED 0x1BC
69 #define BOOT_RECORD_SIGNATURE 0xAA55
70 #define NUM_PARTITION_TABLE_ENTRIES 4
75 #define GET_STARTING_SECTOR(p) \
76 ((ULONG)(p->StartingSectorLsb0) + \
77 (ULONG)(p->StartingSectorLsb1 << 8 ) + \
78 (ULONG)(p->StartingSectorMsb0 << 16) + \
79 (ULONG)(p->StartingSectorMsb1 << 24))
81 #define GET_ENDING_S_OF_CHS(p) \
82 ((UCHAR)(p->EndingCylinderLsb & 0x3F))
84 #define GET_PARTITION_LENGTH(p) \
85 ((ULONG)(p->PartitionLengthLsb0) + \
86 (ULONG)(p->PartitionLengthLsb1 << 8) + \
87 (ULONG)(p->PartitionLengthMsb0 << 16) + \
88 (ULONG)(p->PartitionLengthMsb1 << 24))
91 // Structure describing a partition
93 typedef struct _PARTITION_DESCRIPTOR
97 UCHAR StartingCylinderLsb
;
98 UCHAR StartingCylinderMsb
;
101 UCHAR EndingCylinderLsb
;
102 UCHAR EndingCylinderMsb
;
103 UCHAR StartingSectorLsb0
;
104 UCHAR StartingSectorLsb1
;
105 UCHAR StartingSectorMsb0
;
106 UCHAR StartingSectorMsb1
;
107 UCHAR PartitionLengthLsb0
;
108 UCHAR PartitionLengthLsb1
;
109 UCHAR PartitionLengthMsb0
;
110 UCHAR PartitionLengthMsb1
;
111 } PARTITION_DESCRIPTOR
, *PPARTITION_DESCRIPTOR
;
114 // Structure describing a boot sector
116 typedef struct _BOOT_SECTOR_INFO
121 UCHAR BytesPerSector
[2];
123 UCHAR NumberOfSectors
[2];
126 UCHAR SectorsPerTrack
[2];
127 UCHAR NumberOfHeads
[2];
128 } BOOT_SECTOR_INFO
, *PBOOT_SECTOR_INFO
;
131 // Partition Table and Disk Layout
133 typedef struct _PARTITION_TABLE
135 PARTITION_INFORMATION PartitionEntry
[4];
136 } PARTITION_TABLE
, *PPARTITION_TABLE
;
138 typedef struct _DISK_LAYOUT
142 PARTITION_TABLE PartitionTable
[1];
143 } DISK_LAYOUT
, *PDISK_LAYOUT
;
146 // Partition Table Entry
152 USHORT StartingCylinder
;
155 USHORT EndingCylinder
;
156 ULONG StartingSector
;
157 ULONG PartitionLength
;