ReactOS 0.4.16-dev-2613-g9533ad7
disk.h
Go to the documentation of this file.
1/*
2 * FreeLoader
3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20#pragma once
21
22/* FreeLoader-specific disk geometry structure */
23typedef struct _GEOMETRY
24{
31
32/*
33 * Partition type defines (of PSDK)
34 */
35#define PARTITION_ENTRY_UNUSED 0x00 // Entry unused
36#define PARTITION_FAT_12 0x01 // 12-bit FAT entries
37#define PARTITION_FAT_16 0x04 // 16-bit FAT entries
38#define PARTITION_EXTENDED 0x05 // Extended partition entry
39#define PARTITION_HUGE 0x06 // Huge partition MS-DOS V4
40#define PARTITION_IFS 0x07 // IFS Partition
41#define PARTITION_FAT32 0x0B // FAT32
42#define PARTITION_FAT32_XINT13 0x0C // FAT32 using extended int13 services
43#define PARTITION_XINT13 0x0E // Win95 partition using extended int13 services
44#define PARTITION_XINT13_EXTENDED 0x0F // Same as type 5 but uses extended int13 services
45#define PARTITION_PREP 0x41 // PowerPC Reference Platform (PReP) Boot Partition
46#define PARTITION_LDM 0x42 // Logical Disk Manager partition
47#define PARTITION_GPT 0xEE // GPT protective partition
48
49
51//
52// PC x86/64 BIOS Disk Functions (pcdisk.c)
53//
55#if defined(__i386__) || defined(_M_AMD64)
57#endif // defined __i386__ || defined(_M_AMD64)
58
59/* Buffer for disk reads (hwdisk.c) */
62
63
64/* ARC path of the boot drive and partition */
66
67
69//
70// Disk Management Functions
71//
73
74/*
75 * Disk devices helpers (disk.c)
76 */
77
78LONG
80 _In_ BOOLEAN bShowError);
81
82VOID
84 _In_ PCSTR ErrorString,
86
87extern PCSTR
90
91/* See fs.h */
92struct tagDEVVTBL;
93
96 _In_ UCHAR DriveNumber, // FIXME: Arch-specific
99 _In_ const struct tagDEVVTBL* FuncTable,
100 _Out_opt_ PULONG pChecksum,
101 _Out_opt_ PULONG pSignature,
102 _Out_opt_ PBOOLEAN pValidPartitionTable);
103
104
105/*
106 * Fixed Disk Partition Management Functions (partition.c)
107 */
108
109VOID
111 _In_ UCHAR DriveNumber);
112
115 _In_ UCHAR DriveNumber,
116 _Out_opt_ PPARTITION_INFORMATION PartitionEntry,
117 _Out_ PULONG BootPartition);
118
121 _In_ UCHAR DriveNumber,
124 _Out_ PPARTITION_INFORMATION PartitionEntry);
125
126
127/*
128 * SCSI support (disk/scsiport.c)
129 */
131
132PCCHAR FrLdrGetBootPath(VOID);
unsigned char BOOLEAN
Definition: actypes.h:127
VOID DiskDetectPartitionType(_In_ UCHAR DriveNumber)
Definition: partition.c:66
BOOLEAN DiskGetBootPartitionEntry(_In_ UCHAR DriveNumber, _Out_opt_ PPARTITION_INFORMATION PartitionEntry, _Out_ PULONG BootPartition)
Definition: partition.c:123
ULONG FrldrGetBootPartition(VOID)
Definition: freeldr.c:207
PCSTR DiskGetErrorCodeString(_In_ ULONG ErrorCode)
Definition: pcdisk.c:136
CCHAR FrLdrBootPath[MAX_PATH]
Definition: freeldr.c:29
PCCHAR FrLdrGetBootPath(VOID)
Definition: freeldr.c:197
PVOID DiskReadBuffer
Definition: hwdisk.c:47
ULONG LoadBootDeviceDriver(VOID)
Definition: scsiport.c:1656
UCHAR FrldrGetBootDrive(VOID)
Definition: freeldr.c:202
BOOLEAN DiskGetPartitionEntry(_In_ UCHAR DriveNumber, _In_opt_ ULONG SectorSize, _In_ ULONG PartitionNumber, _Out_ PPARTITION_INFORMATION PartitionEntry)
Definition: partition.c:178
LONG DiskReportError(_In_ BOOLEAN bShowError)
Definition: disk.c:38
struct _GEOMETRY * PGEOMETRY
struct _GEOMETRY GEOMETRY
SIZE_T DiskReadBufferSize
Definition: hwdisk.c:48
ARC_STATUS DiskInitialize(_In_ UCHAR DriveNumber, _In_ PCSTR DeviceName, _In_ CONFIGURATION_TYPE DeviceType, _In_ const struct tagDEVVTBL *FuncTable, _Out_opt_ PULONG pChecksum, _Out_opt_ PULONG pSignature, _Out_opt_ PBOOLEAN pValidPartitionTable)
VOID DiskError(_In_ PCSTR ErrorString, _In_ ULONG ErrorCode)
Definition: disk.c:48
#define MAX_PATH
Definition: compat.h:34
#define __cdecl
Definition: corecrt.h:121
DeviceType
Definition: mmdrv.h:42
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define _Out_opt_
Definition: no_sal2.h:214
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
VOID __cdecl DiskStopFloppyMotor(VOID)
Definition: pc98hw.c:1216
long LONG
Definition: pedump.c:60
ULONG ARC_STATUS
Definition: arc.h:4
enum _CONFIGURATION_TYPE CONFIGURATION_TYPE
Definition: disk.h:24
ULONG BytesPerSector
Number of bytes per sector.
Definition: disk.h:28
ULONG Cylinders
Number of cylinders on the disk.
Definition: disk.h:25
ULONGLONG Sectors
Total number of disk sectors/LBA blocks.
Definition: disk.h:29
ULONG SectorsPerTrack
Number of sectors per track.
Definition: disk.h:27
ULONG Heads
Number of heads on the disk.
Definition: disk.h:26
Definition: fs.h:25
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: typedefs.h:53
unsigned char * PBOOLEAN
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
char CCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3281
_In_ ULONG SectorSize
Definition: halfuncs.h:291
_In_ ULONG _In_ ULONG PartitionNumber
Definition: iofuncs.h:2061