Turnstone Operating System
Loading...
Searching...
No Matches
cpu_simple.xx.c File Reference

cpu commands implementation that supports both real and long mode. More...

#include <cpu.h>
#include <logging.h>
#include <strings.h>

Functions

 MODULE ("turnstone.kernel.cpu")
 
void cpu_hlt (void)
 stops cpu.
 
void cpu_idle (void)
 
uint16_t cpu_read_data_segment (void)
 reads data segment (ds) value from cpu.
 
int8_t cpu_check_rdrand (void)
 checks rdrand supported
 
uint8_t cpu_cpuid (cpu_cpuid_regs_t query, cpu_cpuid_regs_t *answer)
 
boolean_t cpu_is_interrupt_enabled (void)
 
cpu_type_t cpu_get_type (void)
 

Variables

static cpu_type_t cpu_type = CPU_TYPE_UNKNOWN
 
static boolean_t cpu_type_initialized = false
 

Detailed Description

cpu commands implementation that supports both real and long mode.

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Function Documentation

◆ cpu_check_rdrand()

int8_t cpu_check_rdrand ( void )

checks rdrand supported

Returns
0 when supported else -1

◆ cpu_hlt()

void cpu_hlt ( void )

stops cpu.

This command stops cpu using hlt assembly command inside for.

◆ cpu_read_data_segment()

uint16_t cpu_read_data_segment ( void )

reads data segment (ds) value from cpu.

Returns
ds value

This function is meaningful at real mode. At long mode is does nothing