|
AquilaOS documentation
How it works, and its code
|
x86: the early console on the boot loader's framebuffer. More...
#include <core/system.h>#include <core/string.h>#include <console/earlycon.h>#include <cpu/io.h>#include <mm/vm.h>#include "font.h"Go to the source code of this file.
Functions | |
| void | earlycon_fb_register (uintptr_t paddr, uint32_t scanline, uint32_t yres, uint32_t xres, uint32_t depth) |
| Registers the boot loader's framebuffer, for the early console. | |
| int | earlycon_fb_available (void) |
| Says whether the boot loader's framebuffer can be the early console. | |
| static void | earlycon_fb_scroll (int n) |
| Scrolls the screen up by n lines of text, clearing the bottom. | |
| static void | fb_putc (int row, int col, char c) |
| Draws a character at a row and a column of text. | |
| static int | earlycon_fb_putc (char c) |
| Writes a character at the cursor, scrolling when it goes past the last line. | |
| static int | earlycon_fb_puts (char *s) |
| Writes a string. | |
| static void | earlycon_fb_init () |
| Maps the framebuffer in the kernel's address space, and sizes the text screen from its resolution. | |
Variables | |
| static uintptr_t | fb_paddr |
| static uintptr_t | fb_init = 0 |
| static uint32_t | fb_xres |
| static uint32_t | fb_yres |
| static uint32_t | fb_depth |
| static uint32_t | fb_scanline |
| static uint32_t | fb_row = 0 |
| static uint32_t | fb_col = 0 |
| static uint32_t | fb_rows = 25 |
| static uint32_t | fb_cols = 80 |
| static uint32_t | fb_size |
| static struct vm_entry | fb_vmr |
| static char * | vmem = (char *) ARCH_EARLYFB_BASE |
| static char * | cursor = (char *) ARCH_EARLYFB_BASE |
| struct earlycon | earlycon_fb |
x86: the early console on the boot loader's framebuffer.
The boot loader may set up a linear framebuffer (Multiboot's VBE or framebuffer information), which the boot code registers here. Text is drawn with the 8x16 font, in 32-bit pixels only, and the screen scrolls by copying it up a line.
Definition in file fb.c.
| int earlycon_fb_available | ( | void | ) |
Says whether the boot loader's framebuffer can be the early console.
Definition at line 55 of file fb.c.
References earlycon_fb_available(), fb_depth, fb_paddr, and fb_size.
Referenced by earlycon_fb_available(), and earlycon_reinit().
|
static |
Maps the framebuffer in the kernel's address space, and sizes the text screen from its resolution.
Definition at line 145 of file fb.c.
References earlycon_fb_init(), fb_cols, fb_init, fb_paddr, fb_rows, fb_size, fb_vmr, fb_xres, fb_yres, vm_entry::flags, kvm_space, vm_entry::paddr, vm_entry::size, VM_KRW, and vm_map().
Referenced by earlycon_fb_init().
|
static |
Writes a character at the cursor, scrolling when it goes past the last line.
Returns 1, 0 for a character it can't draw, or -1 before the framebuffer is mapped.
Definition at line 98 of file fb.c.
References earlycon_fb_putc(), earlycon_fb_scroll(), fb_col, fb_cols, fb_init, fb_putc(), fb_row, and fb_rows.
Referenced by earlycon_fb_putc(), and earlycon_fb_puts().
|
static |
Writes a string.
Returns 0.
Definition at line 135 of file fb.c.
References earlycon_fb_putc(), and earlycon_fb_puts().
Referenced by earlycon_fb_puts().
| void earlycon_fb_register | ( | uintptr_t | paddr, |
| uint32_t | scanline, | ||
| uint32_t | yres, | ||
| uint32_t | xres, | ||
| uint32_t | depth ) |
Registers the boot loader's framebuffer, for the early console.
The boot code calls it, before it is mapped.
| paddr | its physical address |
| scanline | the size of a line, in bytes |
| yres | its height, in pixels |
| xres | its width, in pixels |
| depth | the bits per pixel |
Definition at line 40 of file fb.c.
References earlycon_fb_register(), fb_depth, fb_paddr, fb_scanline, fb_size, fb_xres, fb_yres, and vm_entry::paddr.
Referenced by earlycon_fb_register(), and process_multiboot_info().
|
static |
Scrolls the screen up by n lines of text, clearing the bottom.
Definition at line 62 of file fb.c.
References earlycon_fb_scroll(), fb_scanline, fb_size, memmove(), memset(), and vm_entry::size.
Referenced by earlycon_fb_putc(), and earlycon_fb_scroll().
|
static |
Draws a character at a row and a column of text.
Definition at line 70 of file fb.c.
References vm_entry::base, cursor, fb_depth, fb_putc(), fb_scanline, and font_8x16.
Referenced by earlycon_fb_putc(), and fb_putc().
|
static |
| struct earlycon earlycon_fb |
Definition at line 161 of file fb.c.
Referenced by earlycon_reinit().
|
static |
Definition at line 20 of file fb.c.
Referenced by earlycon_fb_putc().
|
static |
Definition at line 21 of file fb.c.
Referenced by earlycon_fb_init(), and earlycon_fb_putc().
|
static |
Definition at line 19 of file fb.c.
Referenced by earlycon_fb_available(), earlycon_fb_register(), and fb_putc().
|
static |
Definition at line 18 of file fb.c.
Referenced by earlycon_fb_init(), and earlycon_fb_putc().
|
static |
Definition at line 18 of file fb.c.
Referenced by earlycon_fb_available(), earlycon_fb_init(), and earlycon_fb_register().
|
static |
Definition at line 20 of file fb.c.
Referenced by earlycon_fb_putc().
|
static |
Definition at line 21 of file fb.c.
Referenced by earlycon_fb_init(), and earlycon_fb_putc().
|
static |
Definition at line 20 of file fb.c.
Referenced by earlycon_fb_register(), earlycon_fb_scroll(), and fb_putc().
|
static |
Definition at line 21 of file fb.c.
Referenced by earlycon_fb_available(), earlycon_fb_init(), earlycon_fb_register(), earlycon_fb_scroll(), and fbdev_vesa_map().
|
static |
Definition at line 23 of file fb.c.
Referenced by earlycon_fb_init().
|
static |
Definition at line 19 of file fb.c.
Referenced by earlycon_fb_init(), and earlycon_fb_register().
|
static |
Definition at line 19 of file fb.c.
Referenced by earlycon_fb_init(), and earlycon_fb_register().
|
static |