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];
|
return (int)where[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CpuGetInfos(void);
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -61,6 +61,7 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic, void *codeSeg)
|
||||||
// Interrupts launching
|
// Interrupts launching
|
||||||
KeSetupIDT();
|
KeSetupIDT();
|
||||||
KeEnableIRQs();
|
KeEnableIRQs();
|
||||||
|
CpuGetInfos();
|
||||||
MmInitGdt();
|
MmInitGdt();
|
||||||
|
|
||||||
// Start drivers
|
// Start drivers
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <mm/heap.h>
|
#include <mm/heap.h>
|
||||||
#include <mm/mm.h>
|
#include <mm/mm.h>
|
||||||
#include <io/vga.h>
|
#include <io/vga.h>
|
||||||
|
#include <ke/cpuid.h>
|
||||||
|
|
||||||
// info.c
|
// info.c
|
||||||
extern void BtDoSanityChecks(uint mbMagic);
|
extern void BtDoSanityChecks(uint mbMagic);
|
||||||
|
|
|
@ -28,6 +28,6 @@ ulong __stack_chk_guard = 0x447c0ffe4dbf9e55;
|
||||||
|
|
||||||
noreturn void __stack_chk_fail(void)
|
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 bool KeIsPanicking = 0;
|
||||||
|
|
||||||
volatile CpuCore_t *KeCurCPU = &_KeCPUTable[0];
|
volatile CpuCore_t *KeCurCPU = &_KeCPUTable[0];
|
||||||
|
volatile CpuInfo_t CpuInfo = { 0 };
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,19 @@
|
||||||
//----------------------------------------------------------------------------//
|
//----------------------------------------------------------------------------//
|
||||||
|
|
||||||
#include <ke/cpuid.h>
|
#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);
|
||||||
/* { */
|
|
||||||
/* CpuCpuidString(0, CpuVendorString); */
|
memmove(CpuInfo.vendorStr, (char *)&CpuVendorString[1], 12*sizeof(char));
|
||||||
/* return (char *)&CpuVendorString[1]; */
|
|
||||||
/* } */
|
KernLog("\tCPU %s detected\n", CpuInfo.vendorStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue