|
IgrOS-Kernel 0.1.34.545
Simple C++20 Kernel for i386/x86_64
|
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. | |
Architecture-independent interface: drivers and aliases of current architecture types.
| using igros::x86::isr_t |
| using igros::x86::port_t |
|
strong |
Baud rates.
Definition at line 37 of file serial.hpp.
|
strong |
Data size.
Definition at line 53 of file serial.hpp.
|
strong |
|
strong |
Parity.
Definition at line 68 of file serial.hpp.
|
strong |
Serial ports (standard PC I/O bases).
Definition at line 29 of file serial.hpp.
|
strong |
Stop bits.
Definition at line 61 of file serial.hpp.
|
strong |
VGA memory colors enumeration.
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
staticnoexcept |
Keyboard interrupt (#1) handler.
| regs | Registers saved on interrupt (unused) |
Definition at line 46 of file keyboard.cpp.
|
nodiscardnoexcept |
Setup keyboard function.
Definition at line 65 of file keyboard.cpp.
|
nodiscardnoexcept |
|
staticnoexcept |
|
nodiscardnoexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
nodiscardnoexcept |
|
noexcept |
|
staticnodiscardnoexcept |
Receive one symbol (only if available).
| port | Serial port |
| symbol | Received character |
Definition at line 231 of file serial.cpp.
|
nodiscardnoexcept |
Initialize serial port.
| port | Serial port |
| baudRate | Baud rate |
| dataSize | Data bits |
| stopBits | Stop bits |
| parity | Parity |
Definition at line 120 of file serial.cpp.
|
staticnoexcept |
Serial #1 | #3 IRQ handler.
| regs | Registers saved on interrupt (unused) |
Definition at line 280 of file serial.cpp.
|
staticnodiscardnoexcept |
Wait for transmitter and send one byte.
| port | Serial port |
| value | Byte |
Definition at line 205 of file serial.cpp.
|
staticnodiscardnoexcept |
Send one symbol (new line is sent as CR LF).
| port | Serial port |
| symbol | Character |
Definition at line 219 of file serial.cpp.
|
noexcept |
Serial read.
| port | Serial port |
| buffer | Output buffer |
Definition at line 254 of file serial.cpp.
|
nodiscardnoexcept |
Is read ready?
| port | Serial port |
Definition at line 187 of file serial.cpp.
|
nodiscardnoexcept |
Is write ready?
| port | Serial port |
Definition at line 181 of file serial.cpp.
|
staticnodiscardconstexprnoexcept |
Serial port register address.
| port | Serial port |
| reg | Register |
Definition at line 74 of file serial.cpp.
|
staticnodiscardnoexcept |
Read serial port register.
| port | Serial port |
| reg | Register |
Definition at line 91 of file serial.cpp.
|
staticnoexcept |
Write serial port register.
| port | Serial port |
| reg | Register |
| value | Written value |
Definition at line 82 of file serial.cpp.
|
nodiscardnoexcept |
Setup COM1 (115200 8N1) with receive interrupt.
Definition at line 298 of file serial.cpp.
|
staticnodiscardnoexcept |
Read line status register.
| port | Serial port |
Definition at line 99 of file serial.cpp.
|
staticnodiscardnoexcept |
Wait until line status bit is set (bounded, so missing UART can't hang the kernel).
| port | Serial port |
| status | Awaited status bit |
Definition at line 108 of file serial.cpp.
|
staticnodiscardnoexcept |
Wait until write ready.
| port | Serial port |
Definition at line 195 of file serial.cpp.
|
noexcept |
Serial write to COM1 (kernel console).
| src | Null-terminated string |
Definition at line 273 of file serial.cpp.
|
noexcept |
Serial write.
| port | Serial port |
| text | Text |
Definition at line 242 of file serial.cpp.
|
noexcept |
Serial write to COM1 (kernel console).
| text | Text |
Definition at line 267 of file serial.cpp.
|
staticnodiscardnoexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
nodiscardnoexcept |
|
noexcept |
|
noexcept |
|
nodiscardnoexcept |
|
staticnodiscardnoexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
constexpr |
|
constexpr |
|
staticconstinit |
|
constexpr |
Controller status/command port.
Definition at line 30 of file keyboard.cpp.
|
constexpr |
Data port.
Definition at line 31 of file keyboard.cpp.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
staticconstexpr |
|
staticconstexpr |
|
constexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstinit |