67 },
sizeof(int) * 16 * 3);
72 logi(
"fbconsole",
"No framebuffer, will not actually render anything");
78 logd(
"framebuffer",
"framebuffer console @ 0x%x (0x%x) %dx%d (stride %d)",
91 size_t backbuffer_num_pages = (backbuffer_size + 4095) / 4096;
105 logd(
"fbconsole",
"was in userspace control, fbconsole_clear gave it back to kernel");
135 size_t imgRow = y *
width * 4;
138 size_t imgCol = imgRow + (x * 4);
139 size_t fbCol = fbRow + ((tx + x) * 4);
177 if(FONT_NAME[(c *
FONT_HEIGHT) + y] & (0x80 >> x)) {
192 size_t row_start = scroll_amount * (
FONT_HEIGHT + FONT_ROW_SPACING);
233 int count =
kvsnprintf(buffer, 512,
string, args);
237 int inside_ansi_sequence = 0;
238 int ansi_command = 0;
239 int ansi_args[8] = {0, 0, 0, 0, 0, 0, 0, 0};
240 int ansi_parse_step = 0;
242 while(count-- && i < 512) {
243 char c = buffer[i++];
245 if(inside_ansi_sequence) {
251 inside_ansi_sequence = 0;
253 switch(ansi_command) {
255 if(ansi_args[0] == 5) {
260 else if(ansi_args[0] == 2) {
267 if(ansi_args[0] == 5) {
272 else if(ansi_args[0] == 2) {
283 if(ansi_parse_step == 0) {
285 ansi_command += c -
'0';
288 ansi_args[ansi_parse_step-1] *= 10;
289 ansi_args[ansi_parse_step-1] += c -
'0';
303 else if(c == 0x1B && buffer[i] ==
'[') {
305 inside_ansi_sequence = 1;
309 memset((
void*)ansi_args, 0,
sizeof(
int) * 8);
void sc_handle_hardware_framebuffer(ptr_t *fb, uint16_t *width, uint16_t *height, uint16_t *stride, uint16_t *colorFormat)
void fbconsole_next_line(void)
void fbconsole_init_backbuffer(void)
void fbconsole_blt(const uint8_t *image, uint16_t width, uint16_t height, int16_t tx, int16_t ty)
void fbconsole_scroll(unsigned int scroll_amount)
void fbconsole_back_to_kernel(void)
void fbconsole_clear(int r, int g, int b)
void fbconsole_draw_char(int start_x, int start_y, char c)
int fbconsole_write(char *string,...)
static struct fbconsole_data fbconsole
void fbconsole_init(int width, int height, int stride, uint8_t *fb)
void fbconsole_setpixel(const int x, const int y, const int r, const int g, const int b)
#define ALLOCATOR_REGION_KERNEL_HEAP
void * memcpy(void *dest, void const *source, size_t size)
void * memset(void *dest, int c, size_t size)
void memset32(uint32_t *dest, uint32_t c, size_t size)
size_t kvsnprintf(char *buffer, size_t buffer_size, const char *format, va_list args)
#define logd(component, fmt,...)
#define logi(component, fmt,...)
ptr_t scheduler_map_hardware(ptr_t hw, size_t len)
Map a given memory area in the currently running userspace process at a random location.
volatile pid_t scheduler_current_process
__builtin_va_list va_list
static uint16_t uint16_t uint16_t uint16_t * colorFormat
static uint16_t uint16_t * height
static uint16_t uint16_t uint16_t * stride
ptr_t vm_context_alloc_pages(struct vm_table *context, region_t region, size_t num)
void vm_context_map(struct vm_table *pml4, ptr_t virtual, ptr_t physical, uint8_t pat)
ptr_t vm_context_get_physical_for_virtual(struct vm_table *context, ptr_t virtual)
struct vm_table * VM_KERNEL_CONTEXT