forked from xt-sys/exectos
Compare commits
1 Commits
ce8041754b
...
cpuid-enha
| Author | SHA1 | Date | |
|---|---|---|---|
| 46cc5072af |
@@ -60,10 +60,11 @@ file(RELATIVE_PATH _PATH_PREFIX ${EXECTOS_BINARY_DIR} ${EXECTOS_SOURCE_DIR})
|
||||
add_compiler_flags(-D__RELFILE__="&__FILE__[__FILE__[0] == '.' ? sizeof \\\"${_PATH_PREFIX}\\\" - 1 : sizeof XTOS_SOURCE_DIR]")
|
||||
|
||||
# Set the virtual disk image size (in MiB)
|
||||
set_disk_image_size(48)
|
||||
set_disk_image_size(32)
|
||||
|
||||
# Build all subprojects
|
||||
add_subdirectory(boot)
|
||||
add_subdirectory(bootdata)
|
||||
add_subdirectory(drivers)
|
||||
add_subdirectory(sdk)
|
||||
add_subdirectory(xtldr)
|
||||
|
||||
@@ -58,12 +58,10 @@ design, it requires a modern EFI enabled hardware. It is not possible currently
|
||||
|
||||
# Source structure
|
||||
| Directory | Description |
|
||||
|------------------|--------------------------------------------------------------|
|
||||
| boot/bootdata | default configuration and data needed to boot XTOS |
|
||||
| boot/bootsect | boot sector code (MBR & VBR) initializing the boot process |
|
||||
|-------------|----------------------------------------------------------|
|
||||
| bootdata | default configuration and data needed to boot XTOS |
|
||||
| drivers | XT native drivers source code |
|
||||
| sdk/cmake | host toolchain configuration and build-related functions |
|
||||
| sdk/firmware | firmware enabling XTOS to boot on virtual machines |
|
||||
| sdk/cmake | Host toolchain configuration and build-related functions |
|
||||
| sdk/xtdk | XT Software Development Kit headers |
|
||||
| services | integral subsystems services source code |
|
||||
| subsystems | environment subsystems source code |
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
add_subdirectory(bootdata)
|
||||
add_subdirectory(bootsect)
|
||||
|
||||
@@ -394,6 +394,13 @@ typedef struct _CPU_IDENTIFICATION
|
||||
USHORT Stepping;
|
||||
CPU_VENDOR Vendor;
|
||||
UCHAR VendorName[13];
|
||||
UINT32 StandardFeaturesEcx;
|
||||
UINT32 StandardFeaturesEdx;
|
||||
UINT32 ExtendedFeaturesEcx;
|
||||
UINT32 ExtendedFeaturesEdx;
|
||||
UINT32 Standard7FeaturesEbx;
|
||||
UINT32 Standard7FeaturesEcx;
|
||||
UINT32 Standard7FeaturesEdx;
|
||||
} CPU_IDENTIFICATION, *PCPU_IDENTIFICATION;
|
||||
|
||||
/* CPUID registers */
|
||||
|
||||
@@ -359,6 +359,10 @@ typedef struct _CPU_IDENTIFICATION
|
||||
USHORT Stepping;
|
||||
CPU_VENDOR Vendor;
|
||||
UCHAR VendorName[13];
|
||||
UINT32 StandardFeaturesEcx;
|
||||
UINT32 StandardFeaturesEdx;
|
||||
UINT32 ExtendedFeaturesEcx;
|
||||
UINT32 ExtendedFeaturesEdx;
|
||||
} CPU_IDENTIFICATION, *PCPU_IDENTIFICATION;
|
||||
|
||||
/* CPUID registers */
|
||||
|
||||
@@ -64,9 +64,6 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
||||
CPUID_REGISTERS CpuRegisters;
|
||||
CPUID_SIGNATURE CpuSignature;
|
||||
|
||||
/* Not fully implemented yet */
|
||||
UNIMPLEMENTED;
|
||||
|
||||
/* Get current processor control block */
|
||||
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
||||
|
||||
@@ -122,7 +119,42 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
||||
Prcb->CpuId.Vendor = CPU_VENDOR_UNKNOWN;
|
||||
}
|
||||
|
||||
/* TODO: Store a list of CPU features in processor control block */
|
||||
/* Get CPU standard features */
|
||||
RtlZeroMemory(&CpuRegisters, sizeof(CPUID_REGISTERS));
|
||||
CpuRegisters.Leaf = CPUID_GET_STANDARD1_FEATURES;
|
||||
CpuFunc::CpuId(&CpuRegisters);
|
||||
|
||||
/* Store CPU standard features in processor control block */
|
||||
Prcb->CpuId.StandardFeaturesEcx = CpuRegisters.Ecx;
|
||||
Prcb->CpuId.StandardFeaturesEdx = CpuRegisters.Edx;
|
||||
|
||||
/* Get CPU extended features */
|
||||
RtlZeroMemory(&CpuRegisters, sizeof(CPUID_REGISTERS));
|
||||
CpuRegisters.Leaf = 0x80000001;
|
||||
CpuFunc::CpuId(&CpuRegisters);
|
||||
|
||||
/* Store CPU extended features in processor control block */
|
||||
Prcb->CpuId.ExtendedFeaturesEcx = CpuRegisters.Ecx;
|
||||
Prcb->CpuId.ExtendedFeaturesEdx = CpuRegisters.Edx;
|
||||
|
||||
/* Get CPU leaf 7 features (subleaf 0) */
|
||||
RtlZeroMemory(&CpuRegisters, sizeof(CPUID_REGISTERS));
|
||||
CpuRegisters.Leaf = CPUID_GET_STANDARD7_FEATURES;
|
||||
CpuRegisters.SubLeaf = 0;
|
||||
CpuFunc::CpuId(&CpuRegisters);
|
||||
|
||||
/* Store CPU leaf 7 features in processor control block */
|
||||
Prcb->CpuId.Standard7FeaturesEbx = CpuRegisters.Ebx;
|
||||
Prcb->CpuId.Standard7FeaturesEcx = CpuRegisters.Ecx;
|
||||
Prcb->CpuId.Standard7FeaturesEdx = CpuRegisters.Edx;
|
||||
|
||||
/* Print CPU information */
|
||||
DebugPrint(L"CPU: Vendor %hs, Family 0x%X, Model 0x%X, Stepping 0x%X\n",
|
||||
Prcb->CpuId.VendorName,
|
||||
Prcb->CpuId.Family,
|
||||
Prcb->CpuId.Model,
|
||||
Prcb->CpuId.Stepping);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -59,9 +59,6 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
||||
CPUID_REGISTERS CpuRegisters;
|
||||
CPUID_SIGNATURE CpuSignature;
|
||||
|
||||
/* Not fully implemented yet */
|
||||
UNIMPLEMENTED;
|
||||
|
||||
/* Get current processor control block */
|
||||
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
||||
|
||||
@@ -117,7 +114,30 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
||||
Prcb->CpuId.Vendor = CPU_VENDOR_UNKNOWN;
|
||||
}
|
||||
|
||||
/* TODO: Store a list of CPU features in processor control block */
|
||||
/* Get CPU standard features */
|
||||
RtlZeroMemory(&CpuRegisters, sizeof(CPUID_REGISTERS));
|
||||
CpuRegisters.Leaf = CPUID_GET_STANDARD1_FEATURES;
|
||||
CpuFunc::CpuId(&CpuRegisters);
|
||||
|
||||
/* Store CPU standard features in processor control block */
|
||||
Prcb->CpuId.StandardFeaturesEcx = CpuRegisters.Ecx;
|
||||
Prcb->CpuId.StandardFeaturesEdx = CpuRegisters.Edx;
|
||||
|
||||
/* Get CPU extended features */
|
||||
RtlZeroMemory(&CpuRegisters, sizeof(CPUID_REGISTERS));
|
||||
CpuRegisters.Leaf = 0x80000001;
|
||||
CpuFunc::CpuId(&CpuRegisters);
|
||||
|
||||
/* Store CPU extended features in processor control block */
|
||||
Prcb->CpuId.ExtendedFeaturesEcx = CpuRegisters.Ecx;
|
||||
Prcb->CpuId.ExtendedFeaturesEdx = CpuRegisters.Edx;
|
||||
|
||||
/* Print CPU information */
|
||||
DebugPrint(L"CPU: Vendor %hs, Family 0x%X, Model 0x%X, Stepping 0x%X\n",
|
||||
Prcb->CpuId.VendorName,
|
||||
Prcb->CpuId.Family,
|
||||
Prcb->CpuId.Model,
|
||||
Prcb->CpuId.Stepping);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user