diff options
author | Marvin Borner | 2019-12-11 21:22:15 +0100 |
---|---|---|
committer | Marvin Borner | 2019-12-11 21:22:15 +0100 |
commit | e7d88df7a5a7e11677b68303a0d05455bf9a60d6 (patch) | |
tree | c727ea585e21bc68de6add2720e47af7c2506def /src/userspace/main.c | |
parent | 68915f46e66ed65ce2d32009fdfa2f5dca116842 (diff) |
Some user-side graphics
Diffstat (limited to 'src/userspace/main.c')
-rw-r--r-- | src/userspace/main.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/userspace/main.c b/src/userspace/main.c index 4e036c5..9341bd0 100644 --- a/src/userspace/main.c +++ b/src/userspace/main.c @@ -1,37 +1,12 @@ #include <syscall.h> - -char *fb; -int vbe_bpl = 3; -int vbe_pitch = 3000; -int vbe_height = 1080; -int vbe_width = 2560; - -void vesa_draw_rectangle(int x1, int y1, int x2, int y2, const uint32_t color[3]) -{ - int pos1 = x1 * vbe_bpl + y1 * vbe_pitch; - char *draw = (char *) &fb[pos1]; - for (int i = 0; i <= y2 - y1; i++) { - for (int j = 0; j <= x2 - x1; j++) { - draw[vbe_bpl * j] = color[2]; - draw[vbe_bpl * j + 1] = color[1]; - draw[vbe_bpl * j + 2] = color[0]; - } - draw += vbe_pitch; - } -} - -void vesa_clear() -{ - vesa_draw_rectangle(0, 0, vbe_width - 1, vbe_height - 1, 0); -} +#include <graphics/graphics.h> void user_main() { char hello[] = "> Successfully switched to usermode!\n"; syscall_write(hello); - // fb = (char *) 0x110048; - // vesa_clear(); + init_framebuffer(); while (1) {}; |