kernel/drivers/console.h (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
/*! \file
* Driver for consoles.
*/
#ifndef CONSOLE_H
#define CONSOLE_H
#include <stdint.h>
/*!
* Interface for a console device.
*/
typedef struct {
/*!
* Name of the keyboard.
*/
const char* name;
/*!
* Initializes the console
* \return 1 on success, 0 on fail
*/
int (*init)(void);
/*!
* Prints a single character to the display.
* \param c Character to print.
*/
void (*write_c)(const char c);
void (*write_n)(const char *string, uint32_t num);
void (*write_s)(const char *string);
/*!
* Clears the entire display and resets the cursor.
*/
void (*clear)(void);
/*!
* Moves the cursor to the next line.
*/
void (*newline)(void);
/*!
* Deletes a single character of the display and moves the cursor back.
*/
void (*backspace)(void);
} CON_DRIVER;
//! VGA console driver (default driver)
extern CON_DRIVER vga_con;
extern CON_DRIVER *std_con;
#endif