From 599af82d6d264c84118cd9407dd03323f0a1cb38 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Thu, 23 Dec 2021 14:35:38 -0800 Subject: Added Graphics Initialization Output --- src/cpu/irq.c | 6 ++++-- src/graphics/lfb.c | 3 ++- src/graphics/lfb.h | 4 ++++ src/sys/core.c | 27 +++++++++++++++++++++------ src/sys/timer.c | 4 ++-- 5 files changed, 33 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/cpu/irq.c b/src/cpu/irq.c index a6ed5e4..1329534 100644 --- a/src/cpu/irq.c +++ b/src/cpu/irq.c @@ -44,8 +44,9 @@ void c_irq_handler(void) { if (off < 2048) { // Newline Case if (data == 0x0D) { + for(int i = off; i>=0;i--) + cmd[i] = 0x0; off = 0; - cmd[0] = 0x0; // Backspace Case } else if (data == 0x08 || data == 0x7F) { if (off > 0) { @@ -69,8 +70,9 @@ void c_irq_handler(void) { } } else if (off == 2048) { if (data == 0x0D) { + for(int i = off; i>=0;i--) + cmd[i] = 0x0; off = 0; - cmd[0] = 0x0; } else if (data == 0x08 || data == 0x7F) { if (off > 0) { off -= 1; diff --git a/src/graphics/lfb.c b/src/graphics/lfb.c index 5e307f4..5494dde 100644 --- a/src/graphics/lfb.c +++ b/src/graphics/lfb.c @@ -4,6 +4,7 @@ #include "../graphics/homer.h" #include "../graphics/glyphs.h" +#define GRAPHICS_LFB_C unsigned int width, height, pitch, isrgb; /* dimensions and channel order */ unsigned char *lfb; /* raw frame buffer address */ @@ -79,7 +80,7 @@ void lfb_showpicture() unsigned char *ptr=lfb; char *data=homer_data, pixel[4]; - ptr += (height-homer_height)/2*pitch + (width-homer_width)*2; + ptr = lfb + (height-homer_height)*pitch + (width-homer_width)*4; for(y=0;y "); + + unsigned int x = g_Drawer.x; + unsigned int y = g_Drawer.y; + g_Drawer.x = 0; + g_Drawer.y = 12; + write_string(&g_Drawer, "VIDEO: "); + write_cstring(&g_Drawer, "Enabled ", 0x00FF00); + write_10(&g_Drawer, width); + write_string(&g_Drawer, "x"); + write_10(&g_Drawer, height); + if(isrgb) { + write_string(&g_Drawer, " RGB"); + } else { + write_string(&g_Drawer, " BGR"); + } + g_Drawer.x = x; + g_Drawer.y = y; } diff --git a/src/sys/timer.c b/src/sys/timer.c index 8e333c4..b82ac2c 100644 --- a/src/sys/timer.c +++ b/src/sys/timer.c @@ -24,8 +24,8 @@ void c_timer() { if (lock_mutex(&exe_cnt_m, SCHED_PID) == 0) { *(exe_cnt_m.addr) += 1; write_cstring(&g_Drawer, "DendritOS", 0xFF0000); - write_cstring(&g_Drawer, " v", 0x00FF00); - write_cstring(&g_Drawer, os_info_v, 0x00FF00); + write_cstring(&g_Drawer, " v", 0x00FFFF); + write_cstring(&g_Drawer, os_info_v, 0x00FFFF); write_string(&g_Drawer, " #"); write_10(&g_Drawer, *(exe_cnt_m.addr)); release_mutex(&exe_cnt_m, SCHED_PID); -- cgit v1.2.1