some memory for it in bss. Also put some space in for the gdt in rodata. Need to leave now, so this broken build goes to the repo!
42 lines
841 B
C
42 lines
841 B
C
/* kio.h
|
|
* Kernel I/O
|
|
*
|
|
* Handles any in/output
|
|
*/
|
|
#ifndef KIO_H
|
|
#define KIO_H
|
|
#define VGA_GRID_COLS 80
|
|
#define VGA_GRID_ROWS 25
|
|
#include <stdint.h>
|
|
#include <stdarg.h>
|
|
|
|
/*
|
|
* CONSTANTS AND VARIABLES
|
|
*/
|
|
|
|
//Information on the VGA buffer
|
|
|
|
extern volatile uint16_t* const vga_buffer;
|
|
|
|
//grid is top left origin. This is our cursor!
|
|
extern int cursor_col;
|
|
extern int cursor_row;
|
|
extern uint16_t vga_attributes; // Black background, White foreground
|
|
|
|
|
|
/*
|
|
* Functions
|
|
*/
|
|
|
|
//Clear the VGA buffer
|
|
void vga_clear();
|
|
//Put a character in the VGA buffer and move the cursor to the right by one
|
|
void vga_putc(char c);
|
|
void vga_set_attributes(uint8_t attributes);
|
|
void vga_print(const char* out);
|
|
void vga_println(const char* out);
|
|
void vga_printhex(uint32_t out);
|
|
void vga_prindec(uint32_t out);
|
|
void vga_printf(const char* fmt, ...);
|
|
|
|
#endif
|