The k project

Console

Description

The console driver is used to display text on the screen when operating in text mode. Using the VGA text framebuffer, you have to implement the write() syscall. It is as superset of the serial interface, the escapes codes must not be sent to the serial.

Syscall interface

NAME
    write - writes to the console and the serial
SYNOPSIS
    int write(const char *buf, size_t count);
DESCRIPTION
    write() writes up to count bytes to the screen from the buffer starting at buf.
RETURN VALUE
    write() returns the number of bytes written on the console (zero indicates nothing was written).
NOTES
    write() is available in text mode only.
    It is possible to affect the console in different ways by using particular character codes. To start
    a special command sequence, send a character <CONS ESCAPE>, and then send:
        <CONS CLEAR>
            Clear the console.
        <CONS COLOR><color>
            Set the current color to color.
        <CONS SETY><line number>
            Set the current line to line number.
        <CONS SETX><column number>
            Set the current column to column number.
SEE ALSO
    Useful constants are defined in k/kstd.h

Notes