Working on CPUID
This commit is contained in:
parent
b80c912a34
commit
e176990138
|
@ -113,6 +113,8 @@ static inline int CpuCpuidString(int code, uint where[4])
|
|||
return (int)where[0];
|
||||
}
|
||||
|
||||
void CpuGetInfos(void);
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
|
||||
#endif
|
||||
|
|
|
@ -61,6 +61,7 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
|
|||
// Interrupts launching
|
||||
KeSetupIDT();
|
||||
KeEnableIRQs();
|
||||
CpuGetInfos();
|
||||
MmInitGdt();
|
||||
|
||||
// Start drivers
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <mm/heap.h>
|
||||
#include <mm/mm.h>
|
||||
#include <io/vga.h>
|
||||
#include <ke/cpuid.h>
|
||||
|
||||
// info.c
|
||||
extern void BtDoSanityChecks(uint mbMagic);
|
||||
|
|
|
@ -28,6 +28,6 @@ ulong __stack_chk_guard = 0x447c0ffe4dbf9e55;
|
|||
|
||||
noreturn void __stack_chk_fail(void)
|
||||
{
|
||||
KeStartPanic("Stack has been smashed!\n");
|
||||
KeStartPanic("Stack has been smashed!");
|
||||
}
|
||||
|
||||
|
|
|
@ -31,5 +31,6 @@ volatile BootInfo_t BtBootTab = {0};
|
|||
volatile bool KeIsPanicking = 0;
|
||||
|
||||
volatile CpuCore_t *KeCurCPU = &_KeCPUTable[0];
|
||||
volatile CpuInfo_t CpuInfo = { 0 };
|
||||
|
||||
|
||||
|
|
|
@ -23,13 +23,19 @@
|
|||
//----------------------------------------------------------------------------//
|
||||
|
||||
#include <ke/cpuid.h>
|
||||
#include <io/vga.h>
|
||||
|
||||
void CpuGetInfos(void)
|
||||
{
|
||||
uint CpuVendorString[5] = {0};
|
||||
extern CpuInfo_t CpuInfo;
|
||||
|
||||
/* void CpuGetInfos(void) */
|
||||
/* { */
|
||||
/* CpuCpuidString(0, CpuVendorString); */
|
||||
/* return (char *)&CpuVendorString[1]; */
|
||||
/* } */
|
||||
CpuCpuidString(0, CpuVendorString);
|
||||
|
||||
memmove(CpuInfo.vendorStr, (char *)&CpuVendorString[1], 12*sizeof(char));
|
||||
|
||||
KernLog("\tCPU %s detected\n", CpuInfo.vendorStr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue