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]")
|
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 the virtual disk image size (in MiB)
|
||||||
set_disk_image_size(48)
|
set_disk_image_size(32)
|
||||||
|
|
||||||
# Build all subprojects
|
# Build all subprojects
|
||||||
add_subdirectory(boot)
|
add_subdirectory(boot)
|
||||||
|
add_subdirectory(bootdata)
|
||||||
add_subdirectory(drivers)
|
add_subdirectory(drivers)
|
||||||
add_subdirectory(sdk)
|
add_subdirectory(sdk)
|
||||||
add_subdirectory(xtldr)
|
add_subdirectory(xtldr)
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -57,18 +57,16 @@ ExectOS is in very early development stage, thus its requirements have been not
|
|||||||
design, it requires a modern EFI enabled hardware. It is not possible currently to boot ExectOS on a legacy BIOS.
|
design, it requires a modern EFI enabled hardware. It is not possible currently to boot ExectOS on a legacy BIOS.
|
||||||
|
|
||||||
# Source structure
|
# Source structure
|
||||||
| Directory | Description |
|
| Directory | Description |
|
||||||
|------------------|--------------------------------------------------------------|
|
|-------------|----------------------------------------------------------|
|
||||||
| boot/bootdata | default configuration and data needed to boot XTOS |
|
| bootdata | default configuration and data needed to boot XTOS |
|
||||||
| boot/bootsect | boot sector code (MBR & VBR) initializing the boot process |
|
| drivers | XT native drivers source code |
|
||||||
| drivers | XT native drivers source code |
|
| sdk/cmake | Host toolchain configuration and build-related functions |
|
||||||
| sdk/cmake | host toolchain configuration and build-related functions |
|
| sdk/xtdk | XT Software Development Kit headers |
|
||||||
| sdk/firmware | firmware enabling XTOS to boot on virtual machines |
|
| services | integral subsystems services source code |
|
||||||
| sdk/xtdk | XT Software Development Kit headers |
|
| subsystems | environment subsystems source code |
|
||||||
| services | integral subsystems services source code |
|
| xtoskrnl | XTOS kernel source code |
|
||||||
| subsystems | environment subsystems source code |
|
| xtldr | XTOS boot loader source code |
|
||||||
| xtoskrnl | XTOS kernel source code |
|
|
||||||
| xtldr | XTOS boot loader source code |
|
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
XTOS can only be built using [XTchain](https://git.codingworkshop.eu.org/xt-sys/xtchain), a dedicated toolchain designed
|
XTOS can only be built using [XTchain](https://git.codingworkshop.eu.org/xt-sys/xtchain), a dedicated toolchain designed
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
add_subdirectory(bootdata)
|
|
||||||
add_subdirectory(bootsect)
|
add_subdirectory(bootsect)
|
||||||
|
|||||||
@@ -394,6 +394,13 @@ typedef struct _CPU_IDENTIFICATION
|
|||||||
USHORT Stepping;
|
USHORT Stepping;
|
||||||
CPU_VENDOR Vendor;
|
CPU_VENDOR Vendor;
|
||||||
UCHAR VendorName[13];
|
UCHAR VendorName[13];
|
||||||
|
UINT32 StandardFeaturesEcx;
|
||||||
|
UINT32 StandardFeaturesEdx;
|
||||||
|
UINT32 ExtendedFeaturesEcx;
|
||||||
|
UINT32 ExtendedFeaturesEdx;
|
||||||
|
UINT32 Standard7FeaturesEbx;
|
||||||
|
UINT32 Standard7FeaturesEcx;
|
||||||
|
UINT32 Standard7FeaturesEdx;
|
||||||
} CPU_IDENTIFICATION, *PCPU_IDENTIFICATION;
|
} CPU_IDENTIFICATION, *PCPU_IDENTIFICATION;
|
||||||
|
|
||||||
/* CPUID registers */
|
/* CPUID registers */
|
||||||
|
|||||||
@@ -359,6 +359,10 @@ typedef struct _CPU_IDENTIFICATION
|
|||||||
USHORT Stepping;
|
USHORT Stepping;
|
||||||
CPU_VENDOR Vendor;
|
CPU_VENDOR Vendor;
|
||||||
UCHAR VendorName[13];
|
UCHAR VendorName[13];
|
||||||
|
UINT32 StandardFeaturesEcx;
|
||||||
|
UINT32 StandardFeaturesEdx;
|
||||||
|
UINT32 ExtendedFeaturesEcx;
|
||||||
|
UINT32 ExtendedFeaturesEdx;
|
||||||
} CPU_IDENTIFICATION, *PCPU_IDENTIFICATION;
|
} CPU_IDENTIFICATION, *PCPU_IDENTIFICATION;
|
||||||
|
|
||||||
/* CPUID registers */
|
/* CPUID registers */
|
||||||
|
|||||||
@@ -64,9 +64,6 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
|||||||
CPUID_REGISTERS CpuRegisters;
|
CPUID_REGISTERS CpuRegisters;
|
||||||
CPUID_SIGNATURE CpuSignature;
|
CPUID_SIGNATURE CpuSignature;
|
||||||
|
|
||||||
/* Not fully implemented yet */
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
|
|
||||||
/* Get current processor control block */
|
/* Get current processor control block */
|
||||||
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
||||||
|
|
||||||
@@ -122,7 +119,42 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
|||||||
Prcb->CpuId.Vendor = CPU_VENDOR_UNKNOWN;
|
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_REGISTERS CpuRegisters;
|
||||||
CPUID_SIGNATURE CpuSignature;
|
CPUID_SIGNATURE CpuSignature;
|
||||||
|
|
||||||
/* Not fully implemented yet */
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
|
|
||||||
/* Get current processor control block */
|
/* Get current processor control block */
|
||||||
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
Prcb = KE::Processor::GetCurrentProcessorControlBlock();
|
||||||
|
|
||||||
@@ -117,7 +114,30 @@ AR::ProcSup::IdentifyProcessor(VOID)
|
|||||||
Prcb->CpuId.Vendor = CPU_VENDOR_UNKNOWN;
|
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