summaryrefslogtreecommitdiff
path: root/src/user
diff options
context:
space:
mode:
authordzwdz2022-08-02 14:07:21 +0200
committerdzwdz2022-08-02 14:07:21 +0200
commit31b0a15671977a0157a57b7efffd9b1f1acafa3b (patch)
tree2976fd94e8f66da93810c54f39438b0e7d1cbfd2 /src/user
parentee3152b239c78ca8888a95b308eb6f0a4aaabe2f (diff)
user: separate ansiterm/vterm out into its own binary
Diffstat (limited to 'src/user')
-rw-r--r--src/user/app/init/driver/driver.h1
-rw-r--r--src/user/app/init/init.c5
-rw-r--r--src/user/app/vterm/vterm.c (renamed from src/user/app/init/driver/ansiterm.c)7
3 files changed, 7 insertions, 6 deletions
diff --git a/src/user/app/init/driver/driver.h b/src/user/app/init/driver/driver.h
index d6e7343..c99955a 100644
--- a/src/user/app/init/driver/driver.h
+++ b/src/user/app/init/driver/driver.h
@@ -1,6 +1,5 @@
#pragma once
-void ansiterm_drv(void);
void ps2_drv(void);
void tmpfs_drv(void);
diff --git a/src/user/app/init/init.c b/src/user/app/init/init.c
index 4e2a668..9e7ab7b 100644
--- a/src/user/app/init/init.c
+++ b/src/user/app/init/init.c
@@ -31,8 +31,11 @@ int main(void) {
MOUNT_AT("/tmp/") { tmpfs_drv(); }
MOUNT_AT("/keyboard") { ps2_drv(); }
- MOUNT_AT("/vtty") { ansiterm_drv(); }
MOUNT_AT("/bin/") { fs_passthru("/init/bin"); }
+ MOUNT_AT("/vtty") {
+ const char *argv[] = {"/bin/vterm", NULL};
+ execv(argv[0], (void*)argv);
+ }
if (fork()) {
/* used to trigger a kernel bug
diff --git a/src/user/app/init/driver/ansiterm.c b/src/user/app/vterm/vterm.c
index b59d0b8..4309900 100644
--- a/src/user/app/init/driver/ansiterm.c
+++ b/src/user/app/vterm/vterm.c
@@ -1,4 +1,3 @@
-#include "driver.h"
#include <camellia/syscalls.h>
#include <stdbool.h>
#include <stdio.h>
@@ -6,7 +5,7 @@
#include <string.h>
#include <unistd.h>
-#define eprintf(fmt, ...) fprintf(stderr, "ansiterm: "fmt"\n" __VA_OPT__(,) __VA_ARGS__)
+#define eprintf(fmt, ...) fprintf(stderr, "vterm: "fmt"\n" __VA_OPT__(,) __VA_ARGS__)
struct psf {
uint32_t magic;
@@ -130,7 +129,7 @@ static void font_load(void) {
font_data = buf + font.glyph_offset;
}
-void ansiterm_drv(void) {
+int main(void) {
fb = malloc(fb_len);
fb_fd = _syscall_open("/kdev/video/b", 13, 0);
@@ -166,5 +165,5 @@ void ansiterm_drv(void) {
}
}
- exit(1);
+ return 1;
}