WKern
Loading...
Searching...
No Matches
kio.h
Go to the documentation of this file.
1/*
2WKern - A Bare Metal OS / Kernel I am making (For Fun)
3Copyright (C) 2025 Wdboyes13
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 3 of the License, or
8any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <https://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20#include <types/nums.h>
21void Kprintf(const char *fmt, ...);
22void Kputchar(char c);
23void Kcfp();
25void KprintHex(u32 num);
26char Kgetkey();
27unsigned char ScancodeToAscii(unsigned char scancode);
28void Kgetstr(char *str, int length);
29void Kflush();
30void Outb(u16 port, u8 value);
31u8 Inb(u16 port);
32void Outw(u16 port, u16 value);
33u16 Inw(u16 port);
34void Cli();
35void Sti();
36void Outl(u16 port, u32 val);
37u32 Inl(u16 port);
char Kgetkey()
Gets the next character from the keyboard buffer (blocking).
Definition keyin.c:169
void Kgetstr(char *str, int length)
Reads a line of input from the keyboard (blocking).
Definition keyin.c:186
u32 Inl(u16 port)
Read a 32-bit value from the specified I/O port.
Definition asm.c:84
void Kprintf(const char *fmt,...)
Formatted output to the screen.
Definition printer.c:152
u8 Inb(u16 port)
Read a byte from the specified I/O port.
Definition asm.c:40
u16 Inw(u16 port)
Read a 16-bit word from the specified I/O port.
Definition asm.c:62
void Outb(u16 port, u8 value)
Write a byte to the specified I/O port.
Definition asm.c:30
void KputcharBackspace()
Handles backspace keypress by moving the cursor back and clearing the character.
Definition printer.c:71
void Outw(u16 port, u16 value)
Write a 16-bit word to the specified I/O port.
Definition asm.c:52
void Sti()
Enable CPU interrupts (set interrupt flag).
Definition asm.c:104
void Kcfp()
Clears the screen by filling the video memory with spaces.
Definition printer.c:28
void Kflush()
Flushes the keyboard controller input buffer.
Definition keyin.c:219
void Outl(u16 port, u32 val)
Write a 32-bit value to the specified I/O port.
Definition asm.c:74
unsigned char ScancodeToAscii(unsigned char scancode)
void KprintHex(u32 num)
Prints a 32-bit unsigned integer in hexadecimal format prefixed with "0x".
Definition printer.c:92
void Kputchar(char c)
Outputs a single character to the screen at the current cursor position.
Definition printer.c:46
void Cli()
Disable CPU interrupts (clear interrupt flag).
Definition asm.c:96
unsigned int u32
32-Bit Unsigned Int
Definition nums.h:30
unsigned short u16
16-Bit Unsigned Int
Definition nums.h:36
unsigned char u8
8-Bit Unsigned Int
Definition nums.h:32