aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2020-07-26 14:34:54 +0200
committerMarvin Borner2020-07-26 14:34:54 +0200
commitd8410862be2f00bf2ce321bc28b8322f2de944a9 (patch)
treedb7895b12b9a5896b63c5dcf7af8133150e3c858
parent0de8165d440c549847a1c600558305b04a36a77e (diff)
Added terminus font and config file
-rwxr-xr-xrun7
-rw-r--r--src/config.h12
-rw-r--r--src/main.c3
3 files changed, 19 insertions, 3 deletions
diff --git a/run b/run
index bf79de2..ab51f17 100755
--- a/run
+++ b/run
@@ -71,6 +71,11 @@ make_disk() {
tar xf "spleen-$VERSION.tar.gz"
mv spleen-"$VERSION"/*.psfu .
rm -rf "spleen-$VERSION"*
+
+ cp /usr/share/kbd/consolefonts/ter-p32b.psf.gz . &&
+ cp /usr/share/kbd/consolefonts/ter-p32n.psf.gz . &&
+ gunzip ter-p32* || echo "Terminus font not found!"
+
cd ../../
}
@@ -94,8 +99,6 @@ make_build() {
./ext2util/ext2util -x build/disk.img -wf kernel.bin -i 5 >/dev/null
rm kernel.bin
- echo "Hello, world!" >disk/test.txt
-
mkdir -p mnt/
sudo mount build/disk.img mnt/
sudo cp -r disk/* mnt/
diff --git a/src/config.h b/src/config.h
new file mode 100644
index 0000000..08779a7
--- /dev/null
+++ b/src/config.h
@@ -0,0 +1,12 @@
+// MIT License, Copyright (c) 2020 Marvin Borner
+// General kernel config
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+int MELVIX_VERSION = 0;
+
+#define FONT_PATH "/font/ter-p32n.psf"
+//#define FONT_PATH "/font/spleen-16x32.psfu"
+
+#endif
diff --git a/src/main.c b/src/main.c
index 2c7d063..bc1cb96 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,5 +1,6 @@
// MIT License, Copyright (c) 2020 Marvin Borner
+#include "config.h"
#include <boot.h>
#include <def.h>
#include <fs.h>
@@ -27,7 +28,7 @@ void main(struct mem_info *mem_info, struct vid_info *vid_info)
serial_install();
ls_root();
- gui_init("/font/spleen-16x32.psfu");
+ gui_init(FONT_PATH);
u32 c[] = { 0xff, 0xff, 0xff };
gui_write(0, 0, c, "Hello, world!");