IgrOS-Kernel 0.1.34.545
Simple C++20 Kernel for i386/x86_64
Loading...
Searching...
No Matches
igros::arch Namespace Reference

Architecture-independent interface: drivers and aliases of current architecture types. More...

Namespaces

namespace  anonymous_namespace{pit.cpp}
 Anonymous namespace.
namespace  anonymous_namespace{rtc.cpp}
 Anonymous namespace.
namespace  anonymous_namespace{keyboard.cpp}
 Anonymous namespace.
namespace  anonymous_namespace{serial.cpp}
 Anonymous namespace.

Classes

struct  clockDateTime_t
 Date/time structure. More...
struct  rtcDate_t
 RTC date. More...
struct  rtcTime_t
 RTC time. More...
struct  rtcDateTime_t
 RTC date/time. More...
struct  vmemSymbol
 VGA memory symbol representation. More...
struct  vmemCursor
 VGA memory cursor struct. More...
class  io
 I/O structure. More...
class  irq
 IRQ structure. More...
struct  register_t
 x86_64 task switch registers save More...

Concepts

concept  Cpu
 CPU control every architecture must provide.
concept  PortIO
 Port I/O every architecture must provide.
concept  Interrupts
 Interrupts control every architecture must provide.

Typedefs

using port_t
 I/O port address type.
using isr_t
 IRQ handler type.

Enumerations

enum class  SERIAL_PORT : igros_word_t { COM1 = 0x03F8_u16 , COM2 = 0x02F8_u16 , COM3 = 0x03E8_u16 , COM4 = 0x02E8_u16 }
 Serial ports (standard PC I/O bases). More...
enum class  BAUD_RATE : igros_dword_t {
  BAUD_110 = 110_u32 , BAUD_300 = 300_u32 , BAUD_600 = 600_u32 , BAUD_1200 = 1200_u32 ,
  BAUD_2400 = 2400_u32 , BAUD_4800 = 4800_u32 , BAUD_9600 = 9600_u32 , BAUD_14400 = 14400_u32 ,
  BAUD_19200 = 19200_u32 , BAUD_38400 = 38400_u32 , BAUD_57600 = 57600_u32 , BAUD_115200 = 115200_u32
}
 Baud rates. More...
enum class  DATA_SIZE : igros_byte_t { CHAR_5 = 0x00 , CHAR_6 = 0x01 , CHAR_7 = 0x02 , CHAR_8 = 0x03 }
 Data size. More...
enum class  STOP_BITS : igros_byte_t { STOP_1 = 0x00_u8 , STOP_1_5 = 0x01_u8 , STOP_2 = 0x03_u8 }
 Stop bits. More...
enum class  PARITY : igros_byte_t {
  NONE = 0x00_u8 , ODD = 0x01_u8 , EVEN = 0x02_u8 , MARK = 0x05_u8 ,
  SPACE = 0x07_u8
}
 Parity. More...
enum class  vmemColor : igros_byte_t {
  Black = 0x00_u8 , Blue = 0x01_u8 , Green = 0x02_u8 , Cyan = 0x03_u8 ,
  Red = 0x04_u8 , Magenta = 0x05_u8 , Brown = 0x06_u8 , LightGray = 0x07_u8 ,
  DarkGray = 0x08_u8 , LightBlue = 0x09_u8 , LightGreen = 0x0A_u8 , LightCyan = 0x0B_u8 ,
  LightRed = 0x0C_u8 , LightMagenta = 0x0D_u8 , Yellow = 0x0E_u8 , White = 0x0F_u8
}
 VGA memory colors enumeration. More...
enum class  irq_t
 IRQ line type. More...

Functions

void pitSetupFrequency (const igros_word_t frequency) noexcept
 Setup PIT frequency.
auto pitGetTicks () noexcept -> igros_quad_t
 Get expired ticks.
static void pitInterruptHandler (const register_t *regs) noexcept
 PIT interrupt (#0) handler.
auto pitSetup () noexcept -> bool
 Setup programmable interrupt timer.
auto clockFromRTC (const rtcDateTime_t &rtcDateTime, const igros_dword_t century) noexcept -> clockDateTime_t
 Clock from RTC conversion.
auto rtcRead (const igros_byte_t cmd) noexcept -> igros_byte_t
 Read CMOS register.
auto rtcReadDate () noexcept -> rtcDate_t
 Read CMOS date.
auto rtcReadTime () noexcept -> rtcTime_t
 Read CMOS time.
auto rtcReadDateTime () noexcept -> rtcDateTime_t
 Read CMOS date/time.
auto rtcFromBCD (const igros_byte_t bcd) noexcept -> igros_byte_t
 Convert BCD to binary.
void rtcDateFromBCD (rtcDate_t &date) noexcept
 Convert BCD date to binary.
void rtcTimeFromBCD (rtcTime_t &time) noexcept
 Convert BCD time to binary.
void rtcDateTimeFromBCD (rtcDateTime_t &dateTime) noexcept
 Convert BCD date/time to binary.
auto clockGetCurrentDateTime () noexcept -> clockDateTime_t
 Get current date/time.
auto rtcSetup () noexcept -> bool
 Setup RTC function.
static void keyboardInterruptHandler (const register_t *regs) noexcept
 Keyboard interrupt (#1) handler.
auto keyboardSetup () noexcept -> bool
 Setup keyboard function.
static constexpr auto serialRegister (const SERIAL_PORT port, const SERIAL_REG reg) noexcept -> port_t
 Serial port register address.
static void serialRegWrite (const SERIAL_PORT port, const SERIAL_REG reg, const igros_byte_t value) noexcept
 Write serial port register.
static auto serialRegRead (const SERIAL_PORT port, const SERIAL_REG reg) noexcept -> igros_byte_t
 Read serial port register.
static auto serialStatus (const SERIAL_PORT port) noexcept -> klib::kFlags< SERIAL_LSR >
 Read line status register.
static auto serialWaitStatus (const SERIAL_PORT port, const SERIAL_LSR status) noexcept -> bool
 Wait until line status bit is set (bounded, so missing UART can't hang the kernel).
auto serialInit (const SERIAL_PORT port, const BAUD_RATE baudRate, const DATA_SIZE dataSize, const STOP_BITS stopBits, const PARITY parity) noexcept -> bool
 Initialize serial port.
auto serialReadyWrite (const SERIAL_PORT port) noexcept -> bool
 Is write ready?
auto serialReadyRead (const SERIAL_PORT port) noexcept -> bool
 Is read ready?
static auto serialWaitWrite (const SERIAL_PORT port) noexcept -> bool
 Wait until write ready.
static auto serialPut (const SERIAL_PORT port, const igros_byte_t value) noexcept -> bool
 Wait for transmitter and send one byte.
static auto serialPutSymbol (const SERIAL_PORT port, const char symbol) noexcept -> bool
 Send one symbol (new line is sent as CR LF).
static auto serialGetSymbol (const SERIAL_PORT port, char &symbol) noexcept -> bool
 Receive one symbol (only if available).
auto serialWrite (const SERIAL_PORT port, const std::string_view text) noexcept -> igros_usize_t
 Serial write.
auto serialRead (const SERIAL_PORT port, const std::span< char > buffer) noexcept -> igros_usize_t
 Serial read.
auto serialWrite (const std::string_view text) noexcept -> igros_usize_t
 Serial write to COM1 (kernel console).
auto serialWrite (const char *const src) noexcept -> igros_usize_t
 Serial write to COM1 (kernel console).
static void serialInterruptHandler1 (const register_t *const regs) noexcept
 Serial #1 | #3 IRQ handler.
auto serialSetup () noexcept -> bool
 Setup COM1 (115200 8N1) with receive interrupt.
static auto vmemScreen () noexcept -> std::span< vmemSymbol, VIDEO_MEM_SIZE >
 VGA text buffer (low memory is mapped at kernel virtual offset).
static auto vmemBlank () noexcept -> vmemSymbol
 Blank symbol (space with current background).
void vmemCursorSet (const igros_byte_t x, const igros_byte_t y) noexcept
 Set VGA memory cursor position.
void vmemCursorSet (const vmemCursor cursor) noexcept
 Set VGA memory cursor position.
auto vmemCursorGet () noexcept -> vmemCursor
 Get VGA memory cursor position.
void vmemCursorDisable () noexcept
 Disable VGA memory cursor.
void vmemCursorEnable () noexcept
 Enable VGA memory cursor.
void vmemSetColor (const igros_byte_t background, const igros_byte_t foreground) noexcept
 Set VGA memory color.
void vmemWrite (const char symbol) noexcept
 Write symbol to VGA memory.
void vmemWrite (const char *const message) noexcept
 Write string to VGA memory.
void vmemWrite (const std::string_view message) noexcept
 Write fixed-width string to VGA memory.
void vmemClear () noexcept
 Clear VGA console.
auto vmemInit () noexcept -> bool
 Init VGA console.

Variables

constexpr auto PIT_CONTROL {static_cast<port_t>(0x0043_u16)}
 Mode/command register.
constexpr auto PIT_CHANNEL_0 {static_cast<port_t>(0x0040_u16)}
 Channel 0 data port (system timer).
static constinit pit_t pit {}
 PIT state.
constexpr auto PIT_MAIN_FREQUENCY = 1193181_u32
 PIT frequency (1.193181(3) MHz).
constexpr auto PIT_DEFAULT_FREQUENCY = 100_u32
 Default pit frequency (100 Hz).
constexpr auto CMOS_COMMAND {static_cast<port_t>(0x0070_u16)}
 Register select port.
constexpr auto CMOS_DATA {static_cast<port_t>(CMOS_COMMAND + 1_u16)}
 Data port.
constexpr auto RTC_YEAR {0x09_u8}
 Year register.
constexpr auto RTC_MONTH {0x08_u8}
 Month register.
constexpr auto RTC_DAY {0x07_u8}
 Day of month register.
constexpr auto RTC_WEEKDAY {0x06_u8}
 Day of week register.
constexpr auto RTC_HOUR {0x04_u8}
 Hour register.
constexpr auto RTC_MINUTE {0x02_u8}
 Minute register.
constexpr auto RTC_SECOND {0x00_u8}
 Second register.
constexpr auto RTC_CENTURY {0x32_u8}
 Century register (ACPI FADT default).
constexpr auto RTC_REGISTER_A {0x0A_u8}
 Status register A.
constexpr auto RTC_REGISTER_B {0x0B_u8}
 Status register B.
constexpr auto KEYBOARD_CONTROL {static_cast<port_t>(0x0064_u16)}
 Controller status/command port.
constexpr auto KEYBOARD_DATA {static_cast<port_t>(0x0060_u16)}
 Data port.
constexpr auto VGA_CURSOR_CONTROL {static_cast<port_t>(0x03D4_u16)}
 CRT controller register select port.
constexpr auto VGA_CURSOR_DATA {static_cast<port_t>(VGA_CURSOR_CONTROL + 1_u16)}
 CRT controller data port.
constexpr auto VIDEO_MEM_PHYS {0x000B8000_usize}
 VGA text buffer physical address.
static constinit auto vmemBkgColor {vmemColor::Green}
 VGA memory background symbol.
static constinit vmemCursor cursorPos {}
 Current cursor coordinates.
static constexpr auto VIDEO_MEM_WIDTH {80_usize}
 VGA console max width.
static constexpr auto VIDEO_MEM_HEIGHT {25_usize}
 VGA console max height.
static constexpr auto VIDEO_MEM_SIZE {VIDEO_MEM_WIDTH * VIDEO_MEM_HEIGHT}
 VGA console size.
static constexpr auto VIDEO_MEM_TAB_SIZE {8_usize}
 TAB size.
static constexpr auto VIDEO_MEM_CURSOR_START {0x0A_u8}
 VGA cursor start register.

Detailed Description

Architecture-independent interface: drivers and aliases of current architecture types.

Typedef Documentation

◆ isr_t

IRQ handler type.

Definition at line 35 of file isr.hpp.

◆ port_t

I/O port address type.

Definition at line 25 of file io.hpp.

Enumeration Type Documentation

◆ BAUD_RATE

Baud rates.

Definition at line 37 of file serial.hpp.

◆ DATA_SIZE

enum class igros::arch::DATA_SIZE : igros_byte_t
strong

Data size.

Definition at line 53 of file serial.hpp.

◆ irq_t

enum class igros::x86::irq_t : igros_dword_t
strong

IRQ line type.

Definition at line 62 of file irq.hpp.

◆ PARITY

enum class igros::arch::PARITY : igros_byte_t
strong

Parity.

Definition at line 68 of file serial.hpp.

◆ SERIAL_PORT

Serial ports (standard PC I/O bases).

Definition at line 29 of file serial.hpp.

◆ STOP_BITS

enum class igros::arch::STOP_BITS : igros_byte_t
strong

Stop bits.

Definition at line 61 of file serial.hpp.

◆ vmemColor

enum class igros::arch::vmemColor : igros_byte_t
strong

VGA memory colors enumeration.

Enumerator
Black 

Black VGA color.

Blue 

Blue VGA color.

Green 

Green VGA color.

Cyan 

Cyan VGA color.

Red 

Red VGA color.

Magenta 

Magenta VGA color.

Brown 

Brown VGA color.

LightGray 

Light gray VGA color.

DarkGray 

Dark gray VGA color.

LightBlue 

Light blue VGA color.

LightGreen 

Light green VGA color.

LightCyan 

Light cyan VGA color.

LightRed 

Light red VGA color.

LightMagenta 

Light magenta VGA color.

Yellow 

Yellow VGA color.

White 

White VGA color.

Definition at line 42 of file vmem.hpp.

Function Documentation

◆ clockFromRTC()

auto igros::arch::clockFromRTC ( const rtcDateTime_t & rtcDateTime,
const igros_dword_t century )->clockDateTime_t
nodiscardnoexcept

Clock from RTC conversion.

Parameters
rtcDateTimeRTC date/time (binary)
centuryCentury years (2000)
Returns
Date/time with full year

Definition at line 33 of file rtc.cpp.

◆ clockGetCurrentDateTime()

auto igros::arch::clockGetCurrentDateTime ( ) ->clockDateTime_t
nodiscardnoexcept

Get current date/time.

Returns
Current date/time

Definition at line 145 of file rtc.cpp.

◆ keyboardInterruptHandler()

void igros::arch::keyboardInterruptHandler ( const register_t * regs)
staticnoexcept

Keyboard interrupt (#1) handler.

Parameters
regsRegisters saved on interrupt (unused)

Definition at line 46 of file keyboard.cpp.

◆ keyboardSetup()

auto igros::arch::keyboardSetup ( ) ->bool
nodiscardnoexcept

Setup keyboard function.

Returns
true if keyboard is set up

Definition at line 65 of file keyboard.cpp.

◆ pitGetTicks()

auto igros::arch::pitGetTicks ( ) ->igros_quad_t
nodiscardnoexcept

Get expired ticks.

Returns
Timer interrupts since setup

Definition at line 81 of file pit.cpp.

◆ pitInterruptHandler()

void igros::arch::pitInterruptHandler ( const register_t * regs)
staticnoexcept

PIT interrupt (#0) handler.

Parameters
regsRegisters saved on interrupt (unused)

Definition at line 97 of file pit.cpp.

◆ pitSetup()

auto igros::arch::pitSetup ( ) ->bool
nodiscardnoexcept

Setup programmable interrupt timer.

Returns
true if timer is set up

Definition at line 126 of file pit.cpp.

◆ pitSetupFrequency()

void igros::arch::pitSetupFrequency ( const igros_word_t frequency)
noexcept

Setup PIT frequency.

Parameters
frequencyInterrupt frequency in Hz

Definition at line 52 of file pit.cpp.

◆ rtcDateFromBCD()

void igros::arch::rtcDateFromBCD ( rtcDate_t & date)
noexcept

Convert BCD date to binary.

Parameters
dateDate (converted in place)

Definition at line 125 of file rtc.cpp.

◆ rtcDateTimeFromBCD()

void igros::arch::rtcDateTimeFromBCD ( rtcDateTime_t & dateTime)
noexcept

Convert BCD date/time to binary.

Parameters
dateTimeDate/time (converted in place)

Definition at line 139 of file rtc.cpp.

◆ rtcFromBCD()

auto igros::arch::rtcFromBCD ( const igros_byte_t bcd) ->igros_byte_t
nodiscardnoexcept

Convert BCD to binary.

Parameters
bcdBCD value
Returns
Binary value

Definition at line 119 of file rtc.cpp.

◆ rtcRead()

auto igros::arch::rtcRead ( const igros_byte_t cmd) ->igros_byte_t
nodiscardnoexcept

Read CMOS register.

Parameters
cmdCMOS register
Returns
Register value

Definition at line 79 of file rtc.cpp.

◆ rtcReadDate()

auto igros::arch::rtcReadDate ( ) ->rtcDate_t
nodiscardnoexcept

Read CMOS date.

Returns
Date as stored by RTC

Definition at line 88 of file rtc.cpp.

◆ rtcReadDateTime()

auto igros::arch::rtcReadDateTime ( ) ->rtcDateTime_t
nodiscardnoexcept

Read CMOS date/time.

Returns
Date/time as stored by RTC

Definition at line 108 of file rtc.cpp.

◆ rtcReadTime()

auto igros::arch::rtcReadTime ( ) ->rtcTime_t
nodiscardnoexcept

Read CMOS time.

Returns
Time as stored by RTC

Definition at line 98 of file rtc.cpp.

◆ rtcSetup()

auto igros::arch::rtcSetup ( ) ->bool
nodiscardnoexcept

Setup RTC function.

Returns
true if RTC is set up

Definition at line 190 of file rtc.cpp.

◆ rtcTimeFromBCD()

void igros::arch::rtcTimeFromBCD ( rtcTime_t & time)
noexcept

Convert BCD time to binary.

Parameters
timeTime (converted in place)

Definition at line 132 of file rtc.cpp.

◆ serialGetSymbol()

auto igros::arch::serialGetSymbol ( const SERIAL_PORT port,
char & symbol )->bool
staticnodiscardnoexcept

Receive one symbol (only if available).

Parameters
portSerial port
symbolReceived character
Returns
true if a character was received

Definition at line 231 of file serial.cpp.

◆ serialInit()

auto igros::arch::serialInit ( const SERIAL_PORT port,
const BAUD_RATE baudRate,
const DATA_SIZE dataSize,
const STOP_BITS stopBits,
const PARITY parity )->bool
nodiscardnoexcept

Initialize serial port.

Parameters
portSerial port
baudRateBaud rate
dataSizeData bits
stopBitsStop bits
parityParity
Returns
true if port passed loopback test

Definition at line 120 of file serial.cpp.

◆ serialInterruptHandler1()

void igros::arch::serialInterruptHandler1 ( const register_t *const regs)
staticnoexcept

Serial #1 | #3 IRQ handler.

Parameters
regsRegisters saved on interrupt (unused)

Definition at line 280 of file serial.cpp.

◆ serialPut()

auto igros::arch::serialPut ( const SERIAL_PORT port,
const igros_byte_t value )->bool
staticnodiscardnoexcept

Wait for transmitter and send one byte.

Parameters
portSerial port
valueByte
Returns
false if port wasn't ready in time

Definition at line 205 of file serial.cpp.

◆ serialPutSymbol()

auto igros::arch::serialPutSymbol ( const SERIAL_PORT port,
const char symbol )->bool
staticnodiscardnoexcept

Send one symbol (new line is sent as CR LF).

Parameters
portSerial port
symbolCharacter
Returns
false if port wasn't ready in time

Definition at line 219 of file serial.cpp.

◆ serialRead()

auto igros::arch::serialRead ( const SERIAL_PORT port,
const std::span< char > buffer )->igros_usize_t
noexcept

Serial read.

Parameters
portSerial port
bufferOutput buffer
Returns
Number of read characters

Definition at line 254 of file serial.cpp.

◆ serialReadyRead()

auto igros::arch::serialReadyRead ( const SERIAL_PORT port) ->bool
nodiscardnoexcept

Is read ready?

Parameters
portSerial port
Returns
true if received byte is available

Definition at line 187 of file serial.cpp.

◆ serialReadyWrite()

auto igros::arch::serialReadyWrite ( const SERIAL_PORT port) ->bool
nodiscardnoexcept

Is write ready?

Parameters
portSerial port
Returns
true if transmitter holding register is empty

Definition at line 181 of file serial.cpp.

◆ serialRegister()

constexpr auto igros::arch::serialRegister ( const SERIAL_PORT port,
const SERIAL_REG reg )->port_t
staticnodiscardconstexprnoexcept

Serial port register address.

Parameters
portSerial port
regRegister
Returns
Register port

Definition at line 74 of file serial.cpp.

◆ serialRegRead()

auto igros::arch::serialRegRead ( const SERIAL_PORT port,
const SERIAL_REG reg )->igros_byte_t
staticnodiscardnoexcept

Read serial port register.

Parameters
portSerial port
regRegister
Returns
Register value

Definition at line 91 of file serial.cpp.

◆ serialRegWrite()

void igros::arch::serialRegWrite ( const SERIAL_PORT port,
const SERIAL_REG reg,
const igros_byte_t value )
staticnoexcept

Write serial port register.

Parameters
portSerial port
regRegister
valueWritten value

Definition at line 82 of file serial.cpp.

◆ serialSetup()

auto igros::arch::serialSetup ( ) ->bool
nodiscardnoexcept

Setup COM1 (115200 8N1) with receive interrupt.

Returns
true if COM1 is set up

Definition at line 298 of file serial.cpp.

◆ serialStatus()

auto igros::arch::serialStatus ( const SERIAL_PORT port) ->klib::kFlags< SERIAL_LSR >
staticnodiscardnoexcept

Read line status register.

Parameters
portSerial port
Returns
Line status bits

Definition at line 99 of file serial.cpp.

◆ serialWaitStatus()

auto igros::arch::serialWaitStatus ( const SERIAL_PORT port,
const SERIAL_LSR status )->bool
staticnodiscardnoexcept

Wait until line status bit is set (bounded, so missing UART can't hang the kernel).

Parameters
portSerial port
statusAwaited status bit
Returns
false if bit wasn't set in time

Definition at line 108 of file serial.cpp.

◆ serialWaitWrite()

auto igros::arch::serialWaitWrite ( const SERIAL_PORT port) ->bool
staticnodiscardnoexcept

Wait until write ready.

Parameters
portSerial port
Returns
false if port wasn't ready in time

Definition at line 195 of file serial.cpp.

◆ serialWrite() [1/3]

auto igros::arch::serialWrite ( const char *const src) ->igros_usize_t
noexcept

Serial write to COM1 (kernel console).

Parameters
srcNull-terminated string
Returns
Number of written characters

Definition at line 273 of file serial.cpp.

◆ serialWrite() [2/3]

auto igros::arch::serialWrite ( const SERIAL_PORT port,
const std::string_view text )->igros_usize_t
noexcept

Serial write.

Parameters
portSerial port
textText
Returns
Number of written characters

Definition at line 242 of file serial.cpp.

◆ serialWrite() [3/3]

auto igros::arch::serialWrite ( const std::string_view text) ->igros_usize_t
noexcept

Serial write to COM1 (kernel console).

Parameters
textText
Returns
Number of written characters

Definition at line 267 of file serial.cpp.

◆ vmemBlank()

auto igros::arch::vmemBlank ( ) ->vmemSymbol
staticnodiscardnoexcept

Blank symbol (space with current background).

Returns
Space in current colors

Definition at line 60 of file vmem.cpp.

◆ vmemClear()

void igros::arch::vmemClear ( )
noexcept

Clear VGA console.

Definition at line 207 of file vmem.cpp.

◆ vmemCursorDisable()

void igros::arch::vmemCursorDisable ( )
noexcept

Disable VGA memory cursor.

Definition at line 110 of file vmem.cpp.

◆ vmemCursorEnable()

void igros::arch::vmemCursorEnable ( )
noexcept

Enable VGA memory cursor.

Definition at line 118 of file vmem.cpp.

◆ vmemCursorGet()

auto igros::arch::vmemCursorGet ( ) ->vmemCursor
nodiscardnoexcept

Get VGA memory cursor position.

Returns
Cursor position

Definition at line 92 of file vmem.cpp.

◆ vmemCursorSet() [1/2]

void igros::arch::vmemCursorSet ( const igros_byte_t x,
const igros_byte_t y )
noexcept

Set VGA memory cursor position.

Parameters
xColumn
yRow

Definition at line 69 of file vmem.cpp.

◆ vmemCursorSet() [2/2]

void igros::arch::vmemCursorSet ( const vmemCursor cursor)
noexcept

Set VGA memory cursor position.

Parameters
cursorPosition

Definition at line 86 of file vmem.cpp.

◆ vmemInit()

auto igros::arch::vmemInit ( ) ->bool
nodiscardnoexcept

Init VGA console.

Returns
true if console is set up

Definition at line 215 of file vmem.cpp.

◆ vmemScreen()

auto igros::arch::vmemScreen ( ) ->std::span< vmemSymbol, VIDEO_MEM_SIZE >
staticnodiscardnoexcept

VGA text buffer (low memory is mapped at kernel virtual offset).

Returns
Text mode cells

Definition at line 43 of file vmem.cpp.

◆ vmemSetColor()

void igros::arch::vmemSetColor ( const igros_byte_t background,
const igros_byte_t foreground )
noexcept

Set VGA memory color.

Parameters
backgroundBackground color
foregroundText color

Definition at line 128 of file vmem.cpp.

◆ vmemWrite() [1/3]

void igros::arch::vmemWrite ( const char *const message)
noexcept

Write string to VGA memory.

Parameters
messageNull-terminated string

Definition at line 192 of file vmem.cpp.

◆ vmemWrite() [2/3]

void igros::arch::vmemWrite ( const char symbol)
noexcept

Write symbol to VGA memory.

Parameters
symbolCharacter (control characters move cursor)

Definition at line 134 of file vmem.cpp.

◆ vmemWrite() [3/3]

void igros::arch::vmemWrite ( const std::string_view message)
noexcept

Write fixed-width string to VGA memory.

Parameters
messageText

Definition at line 198 of file vmem.cpp.

Variable Documentation

◆ CMOS_COMMAND

auto igros::arch::CMOS_COMMAND {static_cast<port_t>(0x0070_u16)}
constexpr

Register select port.

Definition at line 27 of file rtc.cpp.

◆ CMOS_DATA

auto igros::arch::CMOS_DATA {static_cast<port_t>(CMOS_COMMAND + 1_u16)}
constexpr

Data port.

Definition at line 28 of file rtc.cpp.

◆ cursorPos

vmemCursor igros::arch::cursorPos {}
staticconstinit

Current cursor coordinates.

Definition at line 54 of file vmem.cpp.

◆ KEYBOARD_CONTROL

auto igros::arch::KEYBOARD_CONTROL {static_cast<port_t>(0x0064_u16)}
constexpr

Controller status/command port.

Definition at line 30 of file keyboard.cpp.

◆ KEYBOARD_DATA

auto igros::arch::KEYBOARD_DATA {static_cast<port_t>(0x0060_u16)}
constexpr

Data port.

Definition at line 31 of file keyboard.cpp.

◆ pit

pit_t igros::arch::pit {}
staticconstinit

PIT state.

Definition at line 48 of file pit.cpp.

◆ PIT_CHANNEL_0

auto igros::arch::PIT_CHANNEL_0 {static_cast<port_t>(0x0040_u16)}
constexpr

Channel 0 data port (system timer).

Definition at line 31 of file pit.cpp.

◆ PIT_CONTROL

auto igros::arch::PIT_CONTROL {static_cast<port_t>(0x0043_u16)}
constexpr

Mode/command register.

Definition at line 30 of file pit.cpp.

◆ PIT_DEFAULT_FREQUENCY

auto igros::arch::PIT_DEFAULT_FREQUENCY = 100_u32
constexpr

Default pit frequency (100 Hz).

Definition at line 27 of file pit.hpp.

◆ PIT_MAIN_FREQUENCY

auto igros::arch::PIT_MAIN_FREQUENCY = 1193181_u32
constexpr

PIT frequency (1.193181(3) MHz).

Definition at line 25 of file pit.hpp.

◆ RTC_CENTURY

auto igros::arch::RTC_CENTURY {0x32_u8}
constexpr

Century register (ACPI FADT default).

Definition at line 55 of file rtc.cpp.

◆ RTC_DAY

auto igros::arch::RTC_DAY {0x07_u8}
constexpr

Day of month register.

Definition at line 49 of file rtc.cpp.

◆ RTC_HOUR

auto igros::arch::RTC_HOUR {0x04_u8}
constexpr

Hour register.

Definition at line 51 of file rtc.cpp.

◆ RTC_MINUTE

auto igros::arch::RTC_MINUTE {0x02_u8}
constexpr

Minute register.

Definition at line 52 of file rtc.cpp.

◆ RTC_MONTH

auto igros::arch::RTC_MONTH {0x08_u8}
constexpr

Month register.

Definition at line 48 of file rtc.cpp.

◆ RTC_REGISTER_A

auto igros::arch::RTC_REGISTER_A {0x0A_u8}
constexpr

Status register A.

Definition at line 57 of file rtc.cpp.

◆ RTC_REGISTER_B

auto igros::arch::RTC_REGISTER_B {0x0B_u8}
constexpr

Status register B.

Definition at line 58 of file rtc.cpp.

◆ RTC_SECOND

auto igros::arch::RTC_SECOND {0x00_u8}
constexpr

Second register.

Definition at line 53 of file rtc.cpp.

◆ RTC_WEEKDAY

auto igros::arch::RTC_WEEKDAY {0x06_u8}
constexpr

Day of week register.

Definition at line 50 of file rtc.cpp.

◆ RTC_YEAR

auto igros::arch::RTC_YEAR {0x09_u8}
constexpr

Year register.

Definition at line 47 of file rtc.cpp.

◆ VGA_CURSOR_CONTROL

auto igros::arch::VGA_CURSOR_CONTROL {static_cast<port_t>(0x03D4_u16)}
constexpr

CRT controller register select port.

Definition at line 33 of file vmem.cpp.

◆ VGA_CURSOR_DATA

auto igros::arch::VGA_CURSOR_DATA {static_cast<port_t>(VGA_CURSOR_CONTROL + 1_u16)}
constexpr

CRT controller data port.

Definition at line 34 of file vmem.cpp.

◆ VIDEO_MEM_CURSOR_START

auto igros::arch::VIDEO_MEM_CURSOR_START {0x0A_u8}
staticconstexpr

VGA cursor start register.

Definition at line 38 of file vmem.hpp.

◆ VIDEO_MEM_HEIGHT

auto igros::arch::VIDEO_MEM_HEIGHT {25_usize}
staticconstexpr

VGA console max height.

Definition at line 30 of file vmem.hpp.

◆ VIDEO_MEM_PHYS

auto igros::arch::VIDEO_MEM_PHYS {0x000B8000_usize}
constexpr

VGA text buffer physical address.

Definition at line 38 of file vmem.cpp.

◆ VIDEO_MEM_SIZE

auto igros::arch::VIDEO_MEM_SIZE {VIDEO_MEM_WIDTH * VIDEO_MEM_HEIGHT}
staticconstexpr

VGA console size.

Definition at line 32 of file vmem.hpp.

◆ VIDEO_MEM_TAB_SIZE

auto igros::arch::VIDEO_MEM_TAB_SIZE {8_usize}
staticconstexpr

TAB size.

Definition at line 35 of file vmem.hpp.

◆ VIDEO_MEM_WIDTH

auto igros::arch::VIDEO_MEM_WIDTH {80_usize}
staticconstexpr

VGA console max width.

Definition at line 28 of file vmem.hpp.

◆ vmemBkgColor

auto igros::arch::vmemBkgColor {vmemColor::Green}
staticconstinit

VGA memory background symbol.

Definition at line 51 of file vmem.cpp.