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>

Functions

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

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