|
tape-kernel 1.0
a modular modern independent kernel
|
#include "../lib/types.h"#include "vga.h"#include "kb.h"#include "cm.h"#include "../lib/err.h"#include "../lib/utils.h"
Go to the source code of this file.
Functions | |
| void | __scrl (void) |
| scrl scrolls the vga text screen up by one row | |
| void | __prt (int x, int y, const char *txt, uint8_t col) |
| prt prints a string to the vga screen at a given position | |
| void | __prtd (int x, int y, int num, uint8_t col) |
| prtd prints a decimal integer to the vga screen | |
| void | __prth (int x, int y, uint32_t hex, uint8_t col) |
| prth prints a 32 bit hex value to the vga screen | |
| void | __clscr (void) |
| clscr clears the entire vga text screen | |
| void | __rdln (char *buffer, int maxlen) |
| rdln reads a line of text input from the keyboard | |
| void | __drw (int x1, int y1, int x2, int y2, uint8_t col) |
| drw draws a line on the vga screen using '#' characters | |
| void | __pchr (int x, int y, char chr, uint8_t col) |
| pchr prints a single raw character to the vga screen | |
Variables | |
| uint16_t * | vga = (uint16_t*)0xB8000 |
| the vga framebuffer pointer | |
| void __clscr | ( | void | ) |
| void __drw | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2, | ||
| uint8_t | col ) |
drw draws a line on the vga screen using '#' characters
drw is a function that draws horizontal, vertical, or diagonal lines on the vga screen using bresenhams line algorithm for the diagonal case
| x1,the | starting column (0-79) |
| y1,the | starting row (0-24) |
| x2,the | ending column (0-79) |
| y2,the | ending row (0-24) |
| col,the | vga color attribute byte |
using drw is done with
| void __pchr | ( | int | x, |
| int | y, | ||
| char | chr, | ||
| uint8_t | col ) |
pchr prints a single raw character to the vga screen
pchr is a function that prints a single character at a given screen position, useful for printing extended ascii characters
| x,the | column to print at |
| y,the | row to print at |
| chr,the | raw character to print (e.g. a char literal) |
| col,the | vga color attribute byte |
using pchr is done with
Definition at line 352 of file vga.c.
References prt.
| void __prt | ( | int | x, |
| int | y, | ||
| const char * | txt, | ||
| uint8_t | col ) |
prt prints a string to the vga screen at a given position
prt is a function that writes a null-terminated string to the vga text framebuffer handling newlines, line wrapping, and scrolling
| x,the | column to start printing at (0-79) |
| y,the | row to start printing at (0-24) |
| txt,the | null-terminated string to print |
| col,the | vga color attribute byte (0x00-0xFF) |
using prt is done with
| void __prtd | ( | int | x, |
| int | y, | ||
| int | num, | ||
| uint8_t | col ) |
prtd prints a decimal integer to the vga screen
prtd is a function that converts an integer to a decimal string using itoa and prints it at the given position
| x,the | column to start printing at |
| y,the | row to start printing at |
| num,the | signed integer to print |
| col,the | vga color attribute byte |
using prtd is done with
prth prints a 32 bit hex value to the vga screen
prth is a function that converts a uint32_t to an 8 character hexadecimal string and prints it at the given position
| x,the | column to start printing at |
| y,the | row to start printing at |
| hex,the | 32 bit unsigned integer to print in hex |
| col,the | vga color attribute byte |
using prth is done with
Definition at line 162 of file vga.c.
References prt.
| void __rdln | ( | char * | buffer, |
| int | maxlen ) |
rdln reads a line of text input from the keyboard
rdln is a function that reads keyboard input into a buffer, handling backspace, echoing characters, and returning on enter
| buffer,the | buffer to store the input string in |
| maxlen,the | maximum length of the input including null |
using rdln is done with
| void __scrl | ( | void | ) |