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))
231 if (PartialResourceList ==
NULL)
233 ERR(
"Failed to allocate resource descriptor! Ignoring remaining floppy peripherals. (FloppyNumber = %u)\n",
239 PartialResourceList->
Version = 1;
241 PartialResourceList->
Count = 1;
251 FloppyData->
MaxDensity = MaxDensity[FloppyType];
281 TRACE(
"Floppy count: %u\n", FloppyCount);
287 if (PartialResourceList ==
NULL)
289 ERR(
"Failed to allocate resource descriptor\n");
295 PartialResourceList->
Version = 1;
297 PartialResourceList->
Count = 3;
304 PartialDescriptor->
u.
Port.Start.LowPart = 0x03F0;
305 PartialDescriptor->
u.
Port.Start.HighPart = 0x0;
306 PartialDescriptor->
u.
Port.Length = 8;
315 PartialDescriptor->
u.
Interrupt.Affinity = 0xFFFFFFFF;
321 PartialDescriptor->
Flags = 0;
322 PartialDescriptor->
u.
Dma.Channel = 2;
323 PartialDescriptor->
u.
Dma.Port = 0;
340 return ControllerKey;
351 UCHAR DiskCount, DriveNumber;
362 ERR(
"Failed to detect BIOS disk controller\n");
370 if (PartialResourceList ==
NULL)
372 ERR(
"Failed to allocate resource descriptor\n");
378 PartialResourceList->
Version = 1;
380 PartialResourceList->
Count = 1;
389 for (
i = 0;
i < DiskCount;
i++)
391 DriveNumber = 0x80 +
i;
401 TRACE(
"Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
414 for (
i = 0;
i < DiskCount;
i++)
418 DriveNumber = 0x80 +
i;
441 INT CpuInformation[4] = {-1};
447 NumberOfIds = CpuInformation[0];
449 if (NumberOfIds == 0)
454 "ReactOS requires the CPUID instruction to return "
455 "more than one supported ID.\n\n");
459 if (NumberOfIds == 1)
466 ProcessorFamily = (CpuInformation[0] >> 8) & 0xF;
469 if (ProcessorFamily < 5)
474 "Processor is too old (family %u < 5)\n"
475 "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)
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()
FORCEINLINE 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
struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST
#define CmResourceTypeDma
#define CmResourceTypeDeviceSpecific
#define CmResourceTypePort
#define CmResourceTypeInterrupt
PPC_QUAL void __cpuid(int CPUInfo[], const int InfoType)
#define CM_RESOURCE_PORT_IO
#define CM_RESOURCE_INTERRUPT_LATCHED
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)
UCHAR StepRateHeadUnloadTime
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@393 Port
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@400 DeviceSpecificData
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@394 Interrupt
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@391::@397 Dma
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
#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 CM_INT13_DRIVE_PARAMETER
@ CmResourceShareDeviceExclusive
@ CmResourceShareUndetermined
struct _CM_FLOPPY_DEVICE_DATA CM_FLOPPY_DEVICE_DATA