76f3807e8d0661ee53a70da3ab44f7de619b537f
[reactos.git] / freeldr / freeldr / disk.h
1 /*
2 * FreeLoader
3 * Copyright (C) 1999, 2000, 2001 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
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #ifndef __DISK_H
21 #define __DISK_H
22
23
24 typedef struct _GEOMETRY
25 {
26 ULONG Cylinders;
27 ULONG Heads;
28 ULONG Sectors;
29 ULONG BytesPerSector;
30
31 } GEOMETRY, *PGEOMETRY;
32
33 ///////////////////////////////////////////////////////////////////////////////////////
34 //
35 // BIOS Disk Functions
36 //
37 ///////////////////////////////////////////////////////////////////////////////////////
38 int biosdisk(int cmd, int drive, int head, int track, int sector, int nsects, void *buffer); // Implemented in asmcode.S
39
40 BOOL BiosInt13Read(ULONG Drive, ULONG Head, ULONG Track, ULONG Sector, ULONG SectorCount, PVOID Buffer); // Implemented in asmcode.S
41 BOOL BiosInt13ReadExtended(ULONG Drive, ULONG Sector, ULONG SectorCount, PVOID Buffer); // Implemented in asmcode.S
42 BOOL BiosInt13ExtensionsSupported(ULONG Drive);
43
44 void stop_floppy(void); // Implemented in asmcode.S
45 int get_heads(int drive); // Implemented in asmcode.S
46 int get_cylinders(int drive); // Implemented in asmcode.S
47 int get_sectors(int drive); // Implemented in asmcode.S
48
49 ///////////////////////////////////////////////////////////////////////////////////////
50 //
51 // FreeLoader Disk Functions
52 //
53 ///////////////////////////////////////////////////////////////////////////////////////
54 VOID DiskError(PUCHAR ErrorString);
55 BOOL DiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry);
56 BOOL DiskSetDriveGeometry(ULONG DriveNumber, ULONG Cylinders, ULONG Heads, ULONG Sectors, ULONG BytesPerSector);
57 BOOL DiskReadMultipleLogicalSectors(ULONG DriveNumber, ULONG SectorNumber, ULONG SectorCount, PVOID Buffer);
58 BOOL DiskReadLogicalSector(ULONG DriveNumber, ULONG SectorNumber, PVOID Buffer);
59
60 #endif // defined __DISK_H