|
ginnOS
The reference: libc, the libraries and the kernel
|
Go to the source code of this file.
Macros | |
| #define | CONSOLE_DEVICE_NUMBER DEVICE_NUMBER(4, 0) |
Functions | |
| void | console_initialize (const boot_info_t *boot) |
| initialize the console driver. | |
| void | console_putchar (char c) |
| write a single character to the console. | |
| void | console_write (const char *str) |
| write a null-terminated string to the console. | |
| void | console_write_bytes (const char *buf, uint32_t len) |
| write a buffer to the console as one update: the whole buffer is drawn, then the caret is placed and the display flushed once. | |
| void | console_panic_mode (void) |
| stop locking the console: a panic is printing and the CPU will halt, so nothing else runs, and the panic may have hit while the lock was held. | |
| void | console_size (uint32_t *rows, uint32_t *cols) |
| the size of the console in character cells. | |
| uint32_t | console_lock_acquire (void) |
| take the console lock, unless a panic is printing. | |
| void | console_lock_release (uint32_t flags) |
| release the console lock that console_lock_acquire() took. | |
| #define CONSOLE_DEVICE_NUMBER DEVICE_NUMBER(4, 0) |
| void console_initialize | ( | const boot_info_t * | boot | ) |
initialize the console driver.
chooses the framebuffer backend when the bootloader provided a graphics-mode framebuffer, otherwise the VGA text backend. must be called before any other console functions are used.
| boot | boot information (carries the framebuffer description). |
| void console_putchar | ( | char | c | ) |
write a single character to the console.
safe from any context, including interrupt handlers.
| c | the character to write |
| void console_write | ( | const char * | str | ) |
write a null-terminated string to the console.
safe from any context.
| str | the string to write |
| void console_write_bytes | ( | const char * | buf, |
| uint32_t | len ) |
write a buffer to the console as one update: the whole buffer is drawn, then the caret is placed and the display flushed once.
translates
to \r
. this is the write syscall's path to the terminal. process context only: it may sleep until another process's write has finished.
| buf | bytes to write (need not be null-terminated). |
| len | number of bytes. |
| void console_panic_mode | ( | void | ) |
stop locking the console: a panic is printing and the CPU will halt, so nothing else runs, and the panic may have hit while the lock was held.
the size of the console in character cells.
| rows | receives the number of rows. |
| cols | receives the number of columns. |
| uint32_t console_lock_acquire | ( | void | ) |
take the console lock, unless a panic is printing.
the console is the kernel's drawer on the framebuffer, so a change of the screen mode holds it too (as Linux changes the mode with console_lock held).
| void console_lock_release | ( | uint32_t | flags | ) |
release the console lock that console_lock_acquire() took.
| flags | the value console_lock_acquire() returned. |