random changes

This commit is contained in:
Karina
2025-12-21 13:57:40 +04:00
parent 602a876fd1
commit 1977e5b02b
4 changed files with 18 additions and 24 deletions
+2 -18
View File
@@ -15,27 +15,11 @@ void kmain(Bootinfo* info) {
sg_ctx.width = info->width;
sg_ctx.pitch = info->pitch;
SG_Point p = {0};
p.x = 0;
p.y = 0;
u32 stripe_h = info->height / 5;
sg_draw_rect(&sg_ctx, &p, info->width, stripe_h, 0x5BCEFA);
p.y += stripe_h;
sg_draw_rect(&sg_ctx, &p, info->width, stripe_h, 0xF5A9B8);
p.y += stripe_h;
sg_draw_rect(&sg_ctx, &p, info->width, stripe_h, 0xFFFFFF);
p.y += stripe_h;
sg_draw_rect(&sg_ctx, &p, info->width, stripe_h, 0xF5A9B8);
p.y += stripe_h;
sg_draw_rect(&sg_ctx, &p, info->width, stripe_h, 0x5BCEFA);
serial_init();
console_init(&sg_ctx);
console_clear(0xFFFFFF);
console_set_color(0x000000);
kprint("Hello!!!");
for (int i = 0; i < 1000; i++) kprint("!");
kprint("Welcome to termOS!!!");
while (1) { __asm__("hlt"); }
}
+15 -3
View File
@@ -18,6 +18,16 @@ void console_init(SG_Context *ctx) {
s_font.base = (const unsigned char*)font8x8_basic;
}
void console_clear(u32 color) {
if (!ctx_ptr) return;
SG_Point p = {0, 0};
sg_draw_rect(ctx_ptr, &p, ctx_ptr->width, ctx_ptr->height, color);
s_cursor_pos.x = 0;
s_cursor_pos.y = 0;
}
static void console_putc(char c) {
serial_writec(c);
if (!ctx_ptr) return;
@@ -35,10 +45,12 @@ static void console_putc(char c) {
}
}
void console_set_color(u32 color) {
s_color = color;
}
void kprint(const char *str) {
for (int i = 0; str[i] != '\0'; i++) console_putc(str[i]);
}
void console_set_color(u32 color) {
s_color = color;
}
-3
View File
@@ -1,6 +1,3 @@
// im really sorry for this code
// but its called shitgui after all
#include "shitgui.h"