30#if defined(SARCH_XBOX)
31#define CLOCK_TICK_RATE 1125000
33#define CLOCK_TICK_RATE 1193182
37#define LATCH (CLOCK_TICK_RATE / HZ)
56 register volatile unsigned int i;
57 for (
i = 0;
i < Loops;
i++);
93 Delta = CurCount - PrevCount;
132 while (CurCount >
LATCH / 2);
148 if (!calib_bit)
break;
160 if (CurCount <=
LATCH / 2)
180 if (DriveNumber == 0)
182 else if (DriveNumber == 1)
210 ULONG MaxDensity[6] = {0, 360, 1200, 720, 1440, 2880};
213 for (FloppyNumber = 0; FloppyNumber < 2; FloppyNumber++)
217 if ((FloppyType > 5) || (FloppyType == 0))
230 if (PartialResourceList ==
NULL)
232 ERR(
"Failed to allocate resource descriptor! Ignoring remaining floppy peripherals. (FloppyNumber = %u)\n",
238 PartialResourceList->
Version = 1;
240 PartialResourceList->
Count = 1;
250 FloppyData->
MaxDensity = MaxDensity[FloppyType];
280 TRACE(
"Floppy count: %u\n", FloppyCount);
285 if (PartialResourceList ==
NULL)
287 ERR(
"Failed to allocate resource descriptor\n");
293 PartialResourceList->
Version = 1;
295 PartialResourceList->
Count = 3;
302 PartialDescriptor->
u.
Port.Start.LowPart = 0x03F0;
303 PartialDescriptor->
u.
Port.Start.HighPart = 0x0;
304 PartialDescriptor->
u.
Port.Length = 8;
313 PartialDescriptor->
u.
Interrupt.Affinity = 0xFFFFFFFF;
319 PartialDescriptor->
Flags = 0;
320 PartialDescriptor->
u.
Dma.Channel = 2;
321 PartialDescriptor->
u.
Dma.Port = 0;
338 return ControllerKey;
349 UCHAR DiskCount, DriveNumber;
360 ERR(
"Failed to detect BIOS disk controller\n");
368 if (PartialResourceList ==
NULL)
370 ERR(
"Failed to allocate resource descriptor\n");
376 PartialResourceList->
Version = 1;
378 PartialResourceList->
Count = 1;
387 for (
i = 0;
i < DiskCount;
i++)
389 DriveNumber = 0x80 +
i;
399 TRACE(
"Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
412 for (
i = 0;
i < DiskCount;
i++)
416 DriveNumber = 0x80 +
i;
439 INT CpuInformation[4] = {-1};
445 NumberOfIds = CpuInformation[0];
447 if (NumberOfIds == 0)
452 "ReactOS requires the CPUID instruction to return "
453 "more than one supported ID.\n\n");
457 if (NumberOfIds == 1)
464 ProcessorFamily = (CpuInformation[0] >> 8) & 0xF;
467 if (ProcessorFamily < 5)
472 "Processor is too old (family %u < 5)\n"
473 "ReactOS requires a Pentium-level processor or newer.",
VOID FldrCreateComponentKey(_In_ PCONFIGURATION_COMPONENT_DATA SystemNode, _In_ CONFIGURATION_CLASS Class, _In_ CONFIGURATION_TYPE Type, _In_ IDENTIFIER_FLAG Flags, _In_ ULONG Key, _In_ ULONG Affinity, _In_ PCSTR IdentifierString, _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList, _In_ ULONG Size, _Out_ PCONFIGURATION_COMPONENT_DATA *ComponentKey)
VOID FldrSetConfigurationData(_Inout_ PCONFIGURATION_COMPONENT_DATA ComponentData, _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList, _In_ ULONG Size)
DECLSPEC_NORETURN VOID FrLdrBugCheckWithMessage(ULONG BugCode, PCHAR File, ULONG Line, PSTR Format,...)
PCM_PARTIAL_RESOURCE_LIST(* GET_HARDDISK_CONFIG_DATA)(UCHAR DriveNumber, ULONG *pSize)
@ MISSING_HARDWARE_REQUIREMENTS
#define DBG_DEFAULT_CHANNEL(ch)
#define MachDiskGetDriveGeometry(Drive, Geom)
#define MachGetFloppyCount()
PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
PPC_QUAL void __cpuid(int CPUInfo[], const int InfoType)
#define CM_RESOURCE_PORT_IO
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
#define READ_PORT_UCHAR(p)
#define WRITE_PORT_UCHAR(p, d)
BOOLEAN DiskResetController(UCHAR DriveNumber)
VOID FrLdrCheckCpuCompatibility(VOID)
static VOID DetectBiosFloppyPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
VOID HalpCalibrateStallExecution(VOID)
static VOID WaitFor8254Wraparound(VOID)
VOID DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey, PCONFIGURATION_COMPONENT_DATA BusKey)
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
static VOID __StallExecutionProcessor(ULONG Loops)
static PCONFIGURATION_COMPONENT_DATA DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey)
VOID StallExecutionProcessor(ULONG Microseconds)
static PVOID GetInt1eTable(VOID)
PCHAR GetHarddiskIdentifier(UCHAR DriveNumber)
static unsigned int delay_count
static ULONG Read8254Timer(VOID)
static UCHAR GetFloppyType(UCHAR DriveNumber)
#define CmResourceTypeDma
#define CmResourceTypeDeviceSpecific
#define CmResourceTypePort
#define CM_RESOURCE_INTERRUPT_LATCHED
#define CmResourceTypeInterrupt
UCHAR StepRateHeadUnloadTime
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382::@391 DeviceSpecificData
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382::@388 Dma
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382::@384 Port
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382::@385 Interrupt
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
ULONG BytesPerSector
Number of bytes per sector.
ULONG Cylinders
Number of cylinders on the disk.
ULONG SectorsPerTrack
Number of sectors per track.
ULONG Heads
Number of heads on the disk.
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define TAG_HW_RESOURCE_LIST
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
struct _CM_INT13_DRIVE_PARAMETER * PCM_INT13_DRIVE_PARAMETER
struct _CM_INT13_DRIVE_PARAMETER CM_INT13_DRIVE_PARAMETER
@ CmResourceShareDeviceExclusive
@ CmResourceShareUndetermined
struct _CM_FLOPPY_DEVICE_DATA * PCM_FLOPPY_DEVICE_DATA