summaryrefslogtreecommitdiff
path: root/applications/init
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-01-13 16:43:49 -0500
committerBenji Dial <benji@benjidial.net>2024-01-13 16:43:49 -0500
commit4130562b1555cabe441efe9420cebe12e7ed8d39 (patch)
treebeaf0012373aab2c3a13fe0147a5cda4af28ef78 /applications/init
parent882e74b2191c059a9226cbd8bcb51c97da36247c (diff)
downloadhilbert-os-4130562b1555cabe441efe9420cebe12e7ed8d39.tar.gz
application loading
Diffstat (limited to 'applications/init')
-rw-r--r--applications/init/main.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/applications/init/main.cpp b/applications/init/main.cpp
new file mode 100644
index 0000000..7aa2a38
--- /dev/null
+++ b/applications/init/main.cpp
@@ -0,0 +1,24 @@
+#include <mercury/syscall.hpp>
+
+using mercury::syscall::encoded_color;
+using mercury::syscall::color;
+
+encoded_color *fb;
+uint32_t fb_width;
+uint32_t fb_height;
+uint32_t fb_pitch;
+
+int main(int, char **) {
+ mercury::syscall::get_framebuffer(fb, fb_width, fb_height, fb_pitch);
+ for (uint32_t y = 0; y < fb_height; ++y)
+ for (uint32_t x = 0; x < fb_width; ++x) {
+ color c = {
+ .r = 0,
+ .g = (uint8_t)(y * 255 / fb_height),
+ .b = (uint8_t)(x * 255 / fb_width)
+ };
+ fb[y * fb_pitch + x] = mercury::syscall::encode_color(c);
+ }
+ mercury::syscall::draw_framebuffer();
+ return 0;
+}