aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/Makefile2
-rw-r--r--apps/a.c12
-rw-r--r--apps/b.c12
-rw-r--r--apps/init.c12
-rw-r--r--apps/wm.c26
5 files changed, 30 insertions, 34 deletions
diff --git a/apps/Makefile b/apps/Makefile
index 8f9408e..390d181 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -1,6 +1,6 @@
# MIT License, Copyright (c) 2020 Marvin Borner
-COBJS = a.o b.o init.o
+COBJS = init.o wm.o
CC = ../cross/opt/bin/i686-elf-gcc
LD = ../cross/opt/bin/i686-elf-ld
OC = ../cross/opt/bin/i686-elf-objcopy
diff --git a/apps/a.c b/apps/a.c
deleted file mode 100644
index b49e7f9..0000000
--- a/apps/a.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// MIT License, Copyright (c) 2020 Marvin Borner
-
-#include <def.h>
-#include <print.h>
-
-void main()
-{
- print("\nA loaded.\n");
- while (1) {
- print("A");
- }
-}
diff --git a/apps/b.c b/apps/b.c
deleted file mode 100644
index 504a5fd..0000000
--- a/apps/b.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// MIT License, Copyright (c) 2020 Marvin Borner
-
-#include <def.h>
-#include <print.h>
-
-void main()
-{
- print("\nB loaded.\n");
- while (1) {
- print("B");
- }
-}
diff --git a/apps/init.c b/apps/init.c
index 89d446b..de87798 100644
--- a/apps/init.c
+++ b/apps/init.c
@@ -11,14 +11,8 @@
void main(struct vbe *vbe)
{
print("Init loaded.\n");
- printf("VBE: %dx%d\n", vbe->width, vbe->height);
+ int a = exec("/wm", vbe);
- const u32 color[3] = { 0, 0, 0 };
- vesa_fill(vbe, color);
- gui_init("/font/spleen-16x32.psfu");
- gui_term_write(vbe, "hallo");
-
- /* exec("/a"); */
- /* exec("/b"); */
- exit();
+ if (a)
+ exit();
}
diff --git a/apps/wm.c b/apps/wm.c
new file mode 100644
index 0000000..b9cae91
--- /dev/null
+++ b/apps/wm.c
@@ -0,0 +1,26 @@
+// MIT License, Copyright (c) 2020 Marvin Borner
+
+#include <cpu.h>
+#include <def.h>
+#include <gui.h>
+#include <print.h>
+#include <sys.h>
+#include <vesa.h>
+
+void main(char **argv)
+{
+ struct vbe *vbe = (struct vbe *)argv[0];
+
+ print("WM loaded.\n");
+ printf("VBE: %dx%d\n", vbe->width, vbe->height);
+
+ const u32 color[3] = { 0xff, 0xff, 0 };
+ const u32 text[3] = { 0, 0, 0 };
+ vesa_fill(vbe, color);
+ gui_init("/font/spleen-16x32.psfu");
+ gui_write(vbe, 50, 50, text, "hallo");
+
+ while (1) {
+ };
+ exit();
+}