Permalink
Browse files

Add IOCTL_DISK_GET_DRIVE_GEOMETRY

This is one of the few IOCTLs required for dashupdate.xbe
  • Loading branch information...
LukeUsher authored and PatrickvL committed Oct 30, 2017
1 parent eb818bd commit a621f7a8d4f0a1dab59d8419a78c753a51078372
Showing with 49 additions and 0 deletions.
  1. +38 −0 import/OpenXDK/include/xboxkrnl/xboxkrnl.h
  2. +11 −0 src/CxbxKrnl/EmuKrnlNt.cpp
@@ -2490,6 +2490,44 @@ typedef struct _XBE_SECTION // Was _XBE_SECTIONHEADER
}
XBEIMAGE_SECTION, *PXBEIMAGE_SECTION;
// From Windows Driver Development Kit
typedef enum _MEDIA_TYPE {
Unknown, // Format is unknown
F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector
F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector
F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector
F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector
F3_720_512, // 3.5", 720KB, 512 bytes/sector
F5_360_512, // 5.25", 360KB, 512 bytes/sector
F5_320_512, // 5.25", 320KB, 512 bytes/sector
F5_320_1024, // 5.25", 320KB, 1024 bytes/sector
F5_180_512, // 5.25", 180KB, 512 bytes/sector
F5_160_512, // 5.25", 160KB, 512 bytes/sector
RemovableMedia, // Removable media other than floppy
FixedMedia, // Fixed hard disk media
F3_120M_512, // 3.5", 120M Floppy
F3_640_512, // 3.5" , 640KB, 512 bytes/sector
F5_640_512, // 5.25", 640KB, 512 bytes/sector
F5_720_512, // 5.25", 720KB, 512 bytes/sector
F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector
F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector
F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector
F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector
F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector
F8_256_128, // 8", 256KB, 128 bytes/sector
F3_200Mb_512, // 3.5", 200M Floppy (HiFD)
F3_240M_512, // 3.5", 240Mb Floppy (HiFD)
F3_32M_512 // 3.5", 32Mb Floppy
} MEDIA_TYPE, *PMEDIA_TYPE;
typedef struct _DISK_GEOMETRY {
LARGE_INTEGER Cylinders;
MEDIA_TYPE MediaType;
DWORD TracksPerCylinder;
DWORD SectorsPerTrack;
DWORD BytesPerSector;
} DISK_GEOMETRY, *PDISK_GEOMETRY;
// ******************************************************************
// * Debug
// ******************************************************************
View
@@ -686,6 +686,17 @@ XBSYSAPI EXPORTNUM(196) xboxkrnl::NTSTATUS NTAPI xboxkrnl::NtDeviceIoControlFile
Authentication->AuthenticationPage.Authentication = 1;
break;
}
case 0x70000: // IOCTL_DISK_GET_DRIVE_GEOMETRY
{
PDISK_GEOMETRY DiskGeometry = (PDISK_GEOMETRY)OutputBuffer;
DiskGeometry->MediaType = FixedMedia;
DiskGeometry->TracksPerCylinder = 1;
DiskGeometry->SectorsPerTrack = 1;
DiskGeometry->BytesPerSector = 512;
DiskGeometry->Cylinders.QuadPart = 0x1400000; // Around 10GB, size of stock xbox HDD
break;
}
default:
LOG_UNIMPLEMENTED();
}

0 comments on commit a621f7a

Please sign in to comment.