aboutsummaryrefslogtreecommitdiff
path: root/src/userspace
diff options
context:
space:
mode:
authorMarvin Borner2020-04-29 13:19:32 +0200
committerMarvin Borner2020-04-29 13:19:32 +0200
commit4f3c75d23188bd480739d6d1514543c95cfe3399 (patch)
treed7306d1e5496becadee6514e3e50bdfc2e37f3e0 /src/userspace
parent50858d043cbd6f61cc091c6772f981ca2d6cca6b (diff)
Started libgui implementation
Diffstat (limited to 'src/userspace')
-rw-r--r--src/userspace/libc/math.h2
-rw-r--r--src/userspace/libc/stdarg.h2
-rw-r--r--src/userspace/libc/stdbool.h2
-rw-r--r--src/userspace/libc/stddef.h2
-rw-r--r--src/userspace/libc/stdint.h6
-rw-r--r--src/userspace/libc/stdio.h2
-rw-r--r--src/userspace/libc/stdlib.h2
-rw-r--r--src/userspace/libc/syscall.c2
-rw-r--r--src/userspace/libc/syscall.h4
-rw-r--r--src/userspace/libgui/gui.h22
-rw-r--r--src/userspace/libgui/init.c10
-rw-r--r--src/userspace/programs/init.c4
-rw-r--r--src/userspace/programs/sh.c2
13 files changed, 50 insertions, 12 deletions
diff --git a/src/userspace/libc/math.h b/src/userspace/libc/math.h
index 2683535..a2010c9 100644
--- a/src/userspace/libc/math.h
+++ b/src/userspace/libc/math.h
@@ -17,4 +17,4 @@
// Minimum, maximum, difference
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/libc/stdarg.h b/src/userspace/libc/stdarg.h
index 41583f9..9442742 100644
--- a/src/userspace/libc/stdarg.h
+++ b/src/userspace/libc/stdarg.h
@@ -3,4 +3,4 @@
// va_{list,start,arg,end,copy}
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/libc/stdbool.h b/src/userspace/libc/stdbool.h
index b445c80..337ca9b 100644
--- a/src/userspace/libc/stdbool.h
+++ b/src/userspace/libc/stdbool.h
@@ -8,4 +8,4 @@
#define TRUE 1
#define FALSE 0
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/libc/stddef.h b/src/userspace/libc/stddef.h
index 531cee3..09dc508 100644
--- a/src/userspace/libc/stddef.h
+++ b/src/userspace/libc/stddef.h
@@ -5,4 +5,4 @@
#define NULL ((void *)0)
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/libc/stdint.h b/src/userspace/libc/stdint.h
index be28300..63f29f4 100644
--- a/src/userspace/libc/stdint.h
+++ b/src/userspace/libc/stdint.h
@@ -12,7 +12,7 @@ typedef unsigned short u16;
typedef signed int s32;
typedef unsigned int u32;
-typedef signed long s64;
-typedef unsigned long u64;
+typedef signed long long s64;
+typedef unsigned long long u64;
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/libc/stdio.h b/src/userspace/libc/stdio.h
index 03dfd1a..13ab933 100644
--- a/src/userspace/libc/stdio.h
+++ b/src/userspace/libc/stdio.h
@@ -5,4 +5,4 @@
// Character input/output
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/libc/stdlib.h b/src/userspace/libc/stdlib.h
index ab6bff4..dfc97e8 100644
--- a/src/userspace/libc/stdlib.h
+++ b/src/userspace/libc/stdlib.h
@@ -7,4 +7,4 @@
// Memory management
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/libc/syscall.c b/src/userspace/libc/syscall.c
index 42786d4..9194eef 100644
--- a/src/userspace/libc/syscall.c
+++ b/src/userspace/libc/syscall.c
@@ -14,3 +14,5 @@ DEFN_SYSCALL0(getch, 3);
DEFN_SYSCALL1(malloc, 4, u32);
DEFN_SYSCALL1(free, 5, u32);
+
+DEFN_SYSCALL0(pointers, 6); \ No newline at end of file
diff --git a/src/userspace/libc/syscall.h b/src/userspace/libc/syscall.h
index 394118c..90ebee5 100644
--- a/src/userspace/libc/syscall.h
+++ b/src/userspace/libc/syscall.h
@@ -80,4 +80,6 @@ DECL_SYSCALL1(malloc, u32);
DECL_SYSCALL1(free, u32);
-#endif
+DECL_SYSCALL0(pointers);
+
+#endif \ No newline at end of file
diff --git a/src/userspace/libgui/gui.h b/src/userspace/libgui/gui.h
new file mode 100644
index 0000000..b056dea
--- /dev/null
+++ b/src/userspace/libgui/gui.h
@@ -0,0 +1,22 @@
+#ifndef MELVIX_GUI_H
+#define MELVIX_GUI_H
+
+#include <stdint.h>
+
+struct font {
+ u16 font_32[758][32];
+ u16 font_24[758][24];
+ u8 font_16[758][16];
+ u16 cursor[19];
+};
+
+struct pointers {
+ u8 *fb;
+ struct font *font;
+};
+
+struct pointers *pointers;
+
+void gui_init();
+
+#endif \ No newline at end of file
diff --git a/src/userspace/libgui/init.c b/src/userspace/libgui/init.c
new file mode 100644
index 0000000..dfc42eb
--- /dev/null
+++ b/src/userspace/libgui/init.c
@@ -0,0 +1,10 @@
+#include <stdint.h>
+#include <syscall.h>
+#include <gui.h>
+
+struct pointers *pointers;
+
+void gui_init()
+{
+ pointers = syscall_pointers();
+} \ No newline at end of file
diff --git a/src/userspace/programs/init.c b/src/userspace/programs/init.c
index 3011530..91564c0 100644
--- a/src/userspace/programs/init.c
+++ b/src/userspace/programs/init.c
@@ -1,9 +1,11 @@
#include <syscall.h>
+#include <gui.h>
void main()
{
+ gui_init();
syscall_exec("/bin/sh");
while (1) {
};
-}
+} \ No newline at end of file
diff --git a/src/userspace/programs/sh.c b/src/userspace/programs/sh.c
index f477d6e..6dcb206 100644
--- a/src/userspace/programs/sh.c
+++ b/src/userspace/programs/sh.c
@@ -11,4 +11,4 @@ void main()
}
syscall_halt();
-}
+} \ No newline at end of file