tape-kernel 1.0
a modular modern independent kernel
Loading...
Searching...
No Matches
cpu.c File Reference
#include "cpu.h"
#include "../lib/types.h"
#include "../lib/utils.h"
Include dependency graph for cpu.c:

Go to the source code of this file.

Functions

int __cpuid_supported (void)
void __cpuid_get_vendor (uint32_t *ebx, uint32_t *edx, uint32_t *ecx)
uint32_t __cpuid_get_features (void)
void __getcpu (char *buffer, uint32_t buffer_len)
 getcpu detects cpu vendor and model information

Function Documentation

◆ __cpuid_get_features()

uint32_t __cpuid_get_features ( void )
extern

Referenced by __getcpu().

◆ __cpuid_get_vendor()

void __cpuid_get_vendor ( uint32_t * ebx,
uint32_t * edx,
uint32_t * ecx )
extern

Referenced by __getcpu().

◆ __cpuid_supported()

int __cpuid_supported ( void )
extern

Referenced by __getcpu().

◆ __getcpu()

void __getcpu ( char * buffer,
uint32_t buffer_len )

getcpu detects cpu vendor and model information

getcpu is a function that uses the cpuid instruction to detect the cpu vendor string and model information and formats it into a readable string

Parameters
buffer,theoutput buffer for the cpu description string
buffer_len,thesize of the output buffer

using getcpu is done with

#include "../kernel/cpu.h" //or just cpu.h
char cpu[64];
getcpu(cpu, sizeof(cpu));
#define getcpu
Definition cpu.h:6
See also
__cpuid_supported(), shell() info cmd

Definition at line 29 of file cpu.c.

References __cpuid_get_features(), __cpuid_get_vendor(), __cpuid_supported(), itoa(), NULL, strcat(), and strcpy().