mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fixed partition id bug
Moved some definitions svn path=/trunk/; revision=1304
This commit is contained in:
parent
375b8055e3
commit
cc22ad9378
4 changed files with 82 additions and 85 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: ide.c,v 1.29 2000/06/29 23:35:48 dwelch Exp $
|
||||
/* $Id: ide.c,v 1.30 2000/08/18 17:24:17 ekohl Exp $
|
||||
*
|
||||
* IDE.C - IDE Disk driver
|
||||
* written by Rex Jolliff
|
||||
|
@ -66,10 +66,6 @@
|
|||
|
||||
#include <ddk/ntddk.h>
|
||||
|
||||
// -------------------------------- This stuff should be defined in NTDDK.H
|
||||
|
||||
typedef DISK_GEOMETRY *PDISK_GEOMETRY;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
#include "../../../ntoskrnl/include/internal/i386/io.h"
|
||||
|
@ -79,7 +75,6 @@ typedef DISK_GEOMETRY *PDISK_GEOMETRY;
|
|||
#include <debug.h>
|
||||
|
||||
#include "ide.h"
|
||||
#include "idep.h"
|
||||
#include "partitio.h"
|
||||
|
||||
#define VERSION "V0.1.4"
|
||||
|
@ -601,7 +596,7 @@ IDECreateDevices(IN PDRIVER_OBJECT DriverObject,
|
|||
p = &PrimaryPartitionTable[PartitionIdx];
|
||||
|
||||
// if the partition entry is in use, create a device for it
|
||||
if (PartitionIsSupported(p))
|
||||
if (IsRecognizedPartition(p))
|
||||
{
|
||||
DPRINT("%s ptbl entry:%d type:%02x Offset:%d Size:%d\n",
|
||||
DeviceDirName,
|
||||
|
@ -638,7 +633,7 @@ IDECreateDevices(IN PDRIVER_OBJECT DriverObject,
|
|||
|
||||
// Create devices for logical partitions within an extended partition
|
||||
}
|
||||
else if (PartitionIsExtended(p))
|
||||
else if (IsExtendedPartition(p))
|
||||
{
|
||||
ExtOffset = p->StartingBlock;
|
||||
|
||||
|
@ -657,7 +652,7 @@ IDECreateDevices(IN PDRIVER_OBJECT DriverObject,
|
|||
for (ExtPartitionIdx = 0; ExtPartitionIdx < 4; ExtPartitionIdx++)
|
||||
{
|
||||
ep = &ExtendedPartitionTable[ExtPartitionIdx];
|
||||
if (PartitionIsSupported(ep))
|
||||
if (IsRecognizedPartition(ep))
|
||||
{
|
||||
DPRINT("Harddisk%d: Type:%02x Offset:%d Size:%d\n",
|
||||
HarddiskIdx,
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
|
||||
#define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(FILE_DEVICE_DISK, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(FILE_DEVICE_DISK, 1, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(FILE_DEVICE_DISK, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(FILE_DEVICE_DISK, 3, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(FILE_DEVICE_DISK, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_DISK_VERIFY CTL_CODE(FILE_DEVICE_DISK, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(FILE_DEVICE_DISK, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(FILE_DEVICE_DISK, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_DISK_PERFORMANCE CTL_CODE(FILE_DEVICE_DISK, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_IS_WRITABLE CTL_CODE(FILE_DEVICE_DISK, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_LOGGING CTL_CODE(FILE_DEVICE_DISK, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(FILE_DEVICE_DISK, 11, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(FILE_DEVICE_DISK, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(FILE_DEVICE_DISK, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(FILE_DEVICE_DISK, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(FILE_DEVICE_DISK, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_REQUEST_DATA CTL_CODE(FILE_DEVICE_DISK, 16, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
|
|
@ -21,58 +21,6 @@
|
|||
(c) = (lba) & 0xff, \
|
||||
(s) |= ((lba) >> 2) & 0xc0)
|
||||
|
||||
/* taken from linux fdisk src */
|
||||
typedef enum PartitionTypes {
|
||||
PTEmpty = 0,
|
||||
PTDOS3xPrimary, /* 1 */
|
||||
PTXENIXRoot, /* 2 */
|
||||
PTXENIXUsr, /* 3 */
|
||||
PTOLDDOS16Bit, /* 4 */
|
||||
PTDosExtended, /* 5 */
|
||||
PTDos5xPrimary, /* 6 */
|
||||
PTOS2HPFS, /* 7 */
|
||||
PTAIX, /* 8 */
|
||||
PTAIXBootable, /* 9 */
|
||||
PTOS2BootMgr, /* 10 */
|
||||
PTWin95FAT32,
|
||||
PTWin95FAT32LBA,
|
||||
PTWin95FAT16LBA,
|
||||
PTWin95ExtendedLBA,
|
||||
PTVenix286 = 0x40,
|
||||
PTNovell = 0x51,
|
||||
PTMicroport = 0x52,
|
||||
PTGnuHurd = 0x63,
|
||||
PTNetware286 = 0x64,
|
||||
PTNetware386 = 0x65,
|
||||
PTPCIX = 0x75,
|
||||
PTOldMinix = 0x80,
|
||||
PTMinix = 0x81,
|
||||
PTLinuxSwap = 0x82,
|
||||
PTLinuxExt2 = 0x83,
|
||||
PTAmoeba = 0x93,
|
||||
PTAmoebaBBT = 0x94,
|
||||
PTBSD = 0xa5,
|
||||
PTBSDIFS = 0xb7,
|
||||
PTBSDISwap = 0xb8,
|
||||
PTSyrinx = 0xc7,
|
||||
PTCPM = 0xdb,
|
||||
PTDOSAccess = 0xe1,
|
||||
PTDOSRO = 0xe3,
|
||||
PTDOSSecondary = 0xf2,
|
||||
PTBBT = 0xff
|
||||
} PARTITIONTYPES;
|
||||
|
||||
#define PartitionIsSupported(P) \
|
||||
((P)->PartitionType == PTDOS3xPrimary || \
|
||||
(P)->PartitionType == PTOLDDOS16Bit || \
|
||||
(P)->PartitionType == PTDos5xPrimary || \
|
||||
(P)->PartitionType == PTWin95FAT32 || \
|
||||
(P)->PartitionType == PTWin95FAT32LBA || \
|
||||
(P)->PartitionType == PTWin95FAT16LBA || \
|
||||
(P)->PartitionType == PTLinuxExt2)
|
||||
|
||||
#define PartitionIsExtended(P) \
|
||||
((P)->PartitionType == PTDosExtended)
|
||||
|
||||
typedef struct Partition {
|
||||
unsigned char BootFlags;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
/* $Id: disk.h,v 1.3 2000/08/18 17:22:50 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: include/disk.h
|
||||
|
@ -8,10 +9,82 @@
|
|||
* 27/06/00: Created
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __INCLUDE_DISK_H
|
||||
#define __INCLUDE_DISK_H
|
||||
|
||||
|
||||
#define IOCTL_DISK_GET_DRIVE_GEOMETRY CTL_CODE(FILE_DEVICE_DISK, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_GET_PARTITION_INFO CTL_CODE(FILE_DEVICE_DISK, 1, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_DISK_SET_PARTITION_INFO CTL_CODE(FILE_DEVICE_DISK, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_DISK_GET_DRIVE_LAYOUT CTL_CODE(FILE_DEVICE_DISK, 3, METHOD_BUFFERED, FILE_READ_ACCESS)
|
||||
#define IOCTL_DISK_SET_DRIVE_LAYOUT CTL_CODE(FILE_DEVICE_DISK, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_DISK_VERIFY CTL_CODE(FILE_DEVICE_DISK, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_FORMAT_TRACKS CTL_CODE(FILE_DEVICE_DISK, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_DISK_REASSIGN_BLOCKS CTL_CODE(FILE_DEVICE_DISK, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_DISK_PERFORMANCE CTL_CODE(FILE_DEVICE_DISK, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_IS_WRITABLE CTL_CODE(FILE_DEVICE_DISK, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_LOGGING CTL_CODE(FILE_DEVICE_DISK, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_FORMAT_TRACKS_EX CTL_CODE(FILE_DEVICE_DISK, 11, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
||||
#define IOCTL_DISK_HISTOGRAM_STRUCTURE CTL_CODE(FILE_DEVICE_DISK, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_HISTOGRAM_DATA CTL_CODE(FILE_DEVICE_DISK, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_HISTOGRAM_RESET CTL_CODE(FILE_DEVICE_DISK, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_REQUEST_STRUCTURE CTL_CODE(FILE_DEVICE_DISK, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define IOCTL_DISK_REQUEST_DATA CTL_CODE(FILE_DEVICE_DISK, 16, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
|
||||
|
||||
#define PTEmpty 0x00
|
||||
#define PTDOS3xPrimary 0x01
|
||||
#define PTXENIXRoot 0x02
|
||||
#define PTXENIXUsr 0x03
|
||||
#define PTOLDDOS16Bit 0x04
|
||||
#define PTDosExtended 0x05
|
||||
#define PTDos5xPrimary 0x06
|
||||
#define PTIfs 0x07 // e.g.: HPFS, NTFS, etc
|
||||
#define PTAIX 0x08
|
||||
#define PTAIXBootable 0x09
|
||||
#define PTOS2BootMgr 0x0A
|
||||
#define PTWin95FAT32 0x0B
|
||||
#define PTWin95FAT32LBA 0x0C
|
||||
#define PTWin95FAT16LBA 0x0E
|
||||
#define PTWin95ExtendedLBA 0x0F
|
||||
#define PTVenix286 0x40
|
||||
#define PTNovell 0x51
|
||||
#define PTMicroport 0x52
|
||||
#define PTGnuHurd 0x63
|
||||
#define PTNetware286 0x64
|
||||
#define PTNetware386 0x65
|
||||
#define PTPCIX 0x75
|
||||
#define PTOldMinix 0x80
|
||||
#define PTMinix 0x81
|
||||
#define PTLinuxSwap 0x82
|
||||
#define PTLinuxExt2 0x83
|
||||
#define PTAmoeba 0x93
|
||||
#define PTAmoebaBBT 0x94
|
||||
#define PTBSD 0xA5
|
||||
#define PTBSDIFS 0xB7
|
||||
#define PTBSDISwap 0xB8
|
||||
#define PTSyrinx 0xC7
|
||||
#define PTCPM 0xDB
|
||||
#define PTDOSAccess 0xE1
|
||||
#define PTDOSRO 0xE3
|
||||
#define PTDOSSecondary 0xF2
|
||||
#define PTBBT 0xFF
|
||||
|
||||
|
||||
#define IsRecognizedPartition(P) \
|
||||
((P)->PartitionType == PTDOS3xPrimary || \
|
||||
(P)->PartitionType == PTOLDDOS16Bit || \
|
||||
(P)->PartitionType == PTDos5xPrimary || \
|
||||
(P)->PartitionType == PTWin95FAT32 || \
|
||||
(P)->PartitionType == PTWin95FAT32LBA || \
|
||||
(P)->PartitionType == PTWin95FAT16LBA || \
|
||||
(P)->PartitionType == PTLinuxExt2)
|
||||
|
||||
#define IsExtendedPartition(P) \
|
||||
((P)->PartitionType == PTDosExtended || \
|
||||
(P)->PartitionType == PTWin95ExtendedLBA)
|
||||
|
||||
|
||||
typedef enum _MEDIA_TYPE {
|
||||
Unknown,
|
||||
F5_1Pt2_512,
|
||||
|
@ -50,7 +123,8 @@ typedef struct _DISK_GEOMETRY {
|
|||
DWORD TracksPerCylinder;
|
||||
DWORD SectorsPerTrack;
|
||||
DWORD BytesPerSector;
|
||||
} DISK_GEOMETRY ;
|
||||
|
||||
} DISK_GEOMETRY, *PDISK_GEOMETRY;
|
||||
|
||||
#endif /* __INCLUDE_DISK_H */
|
||||
|
||||
/* EOF */
|
||||
|
|
Loading…
Reference in a new issue