LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
fbconsole.c File Reference

(7c4d7d1 userspace/term: change eyecandy inclusion to use objcopy instead of xxd)

#include <fbconsole.h>
#include <mm.h>
#include <vm.h>
#include <log.h>
#include <scheduler.h>
#include <string.h>
#include <stdarg.h>
#include <config.h>
#include "font_acorn_8x8.c"
+ Include dependency graph for fbconsole.c:

Go to the source code of this file.

Data Structures

struct  fbconsole_data
 

Functions

void fbconsole_init (int width, int height, int stride, uint8_t *fb)
 
void fbconsole_init_backbuffer (void)
 
void fbconsole_clear (int r, int g, int b)
 
void fbconsole_blt (const uint8_t *image, uint16_t width, uint16_t height, int16_t tx, int16_t ty)
 
void fbconsole_setpixel (const int x, const int y, const int r, const int g, const int b)
 
void fbconsole_draw_char (int start_x, int start_y, char c)
 
void fbconsole_scroll (unsigned int scroll_amount)
 
void fbconsole_next_line (void)
 
int fbconsole_write (char *string,...)
 
void sc_handle_hardware_framebuffer (ptr_t *fb, uint16_t *width, uint16_t *height, uint16_t *stride, uint16_t *colorFormat)
 
void fbconsole_back_to_kernel (void)
 

Variables

bool fbconsole_active = false
 
static struct fbconsole_data fbconsole
 

Data Structure Documentation

◆ fbconsole_data

struct fbconsole_data

Definition at line 15 of file fbconsole.c.

+ Collaboration diagram for fbconsole_data:
Data Fields
uint8_t * backbuffer
int background_b
int background_g
int background_r
int cols
int current_col
int current_row
uint8_t * fb
int foreground_b
int foreground_g
int foreground_r
int height
int palette[16][3]
int rows
int stride
int width

Function Documentation

◆ fbconsole_back_to_kernel()

void fbconsole_back_to_kernel ( void  )

Definition at line 348 of file fbconsole.c.

References fbconsole_active.

◆ fbconsole_blt()

void fbconsole_blt ( const uint8_t image,
uint16_t  width,
uint16_t  height,
int16_t  tx,
int16_t  ty 
)

Definition at line 123 of file fbconsole.c.

References fbconsole_data::backbuffer, fbconsole_data::fb, fbconsole, height, fbconsole_data::height, memcpy(), fbconsole_data::stride, width, and fbconsole_data::width.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fbconsole_clear()

void fbconsole_clear ( int  r,
int  g,
int  b 
)

Definition at line 103 of file fbconsole.c.

References fbconsole_data::backbuffer, fbconsole_data::current_col, fbconsole_data::current_row, fbconsole_data::fb, fbconsole, fbconsole_active, fbconsole_data::height, logd, memset32(), and fbconsole_data::stride.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fbconsole_draw_char()

void fbconsole_draw_char ( int  start_x,
int  start_y,
char  c 
)

Definition at line 170 of file fbconsole.c.

References fbconsole_data::background_b, fbconsole_data::background_g, fbconsole_data::background_r, fbconsole_data::fb, fbconsole, fbconsole_setpixel(), FONT_HEIGHT, FONT_WIDTH, fbconsole_data::foreground_b, fbconsole_data::foreground_g, fbconsole_data::foreground_r, fbconsole_data::height, and fbconsole_data::width.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fbconsole_init()

void fbconsole_init ( int  width,
int  height,
int  stride,
uint8_t fb 
)

Definition at line 31 of file fbconsole.c.

References fbconsole_data::backbuffer, fbconsole_data::background_b, fbconsole_data::background_g, fbconsole_data::background_r, fbconsole_data::cols, fbconsole_data::current_col, fbconsole_data::current_row, fbconsole_data::fb, fbconsole, FONT_HEIGHT, FONT_WIDTH, fbconsole_data::foreground_b, fbconsole_data::foreground_g, fbconsole_data::foreground_r, height, fbconsole_data::height, memcpy(), fbconsole_data::palette, fbconsole_data::rows, stride, fbconsole_data::stride, width, and fbconsole_data::width.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fbconsole_init_backbuffer()

void fbconsole_init_backbuffer ( void  )

Definition at line 85 of file fbconsole.c.

References ALLOCATOR_REGION_KERNEL_HEAP, fbconsole_data::backbuffer, fbconsole_data::fb, fbconsole, fbconsole_data::height, memcpy(), fbconsole_data::stride, vm_context_alloc_pages(), vm_context_get_physical_for_virtual(), vm_context_map(), and VM_KERNEL_CONTEXT.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fbconsole_next_line()

void fbconsole_next_line ( void  )

Definition at line 209 of file fbconsole.c.

References fbconsole_data::current_col, fbconsole_data::current_row, fbconsole_data::fb, fbconsole, fbconsole_scroll(), and fbconsole_data::rows.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fbconsole_scroll()

void fbconsole_scroll ( unsigned int  scroll_amount)

Definition at line 187 of file fbconsole.c.

References fbconsole_data::backbuffer, fbconsole_data::background_b, fbconsole_data::background_g, fbconsole_data::background_r, fbconsole_data::fb, fbconsole, FONT_HEIGHT, fbconsole_data::height, memcpy(), memset32(), and fbconsole_data::stride.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fbconsole_setpixel()

void fbconsole_setpixel ( const int  x,
const int  y,
const int  r,
const int  g,
const int  b 
)

Definition at line 153 of file fbconsole.c.

References fbconsole_data::backbuffer, fbconsole_data::fb, fbconsole, and fbconsole_data::stride.

+ Here is the caller graph for this function:

◆ fbconsole_write()

int fbconsole_write ( char *  string,
  ... 
)

Definition at line 223 of file fbconsole.c.

References fbconsole_data::background_b, fbconsole_data::background_g, fbconsole_data::background_r, fbconsole_data::cols, fbconsole_data::current_col, fbconsole_data::current_row, fbconsole_data::fb, fbconsole, fbconsole_draw_char(), fbconsole_next_line(), FONT_HEIGHT, FONT_WIDTH, fbconsole_data::foreground_b, fbconsole_data::foreground_g, fbconsole_data::foreground_r, kvsnprintf(), memset(), fbconsole_data::palette, va_end, and va_start.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sc_handle_hardware_framebuffer()

void sc_handle_hardware_framebuffer ( ptr_t fb,
uint16_t width,
uint16_t height,
uint16_t stride,
uint16_t colorFormat 
)

Definition at line 326 of file fbconsole.c.

References colorFormat, fbconsole_data::fb, fbconsole, fbconsole_active, fbconsole_clear(), height, fbconsole_data::height, logd, scheduler_current_process, scheduler_map_hardware(), stride, fbconsole_data::stride, vm_context_get_physical_for_virtual(), VM_KERNEL_CONTEXT, width, and fbconsole_data::width.

+ Here is the call graph for this function:

Variable Documentation

◆ fbconsole

struct fbconsole_data fbconsole
static

Definition at line 29 of file fbconsole.c.

◆ fbconsole_active

bool fbconsole_active = false

Definition at line 13 of file fbconsole.c.