diff options
author | dzwdz | 2022-03-27 17:49:54 +0200 |
---|---|---|
committer | dzwdz | 2022-03-27 17:49:54 +0200 |
commit | f1cefa851c3bc8aa6a8c2e6b86d23d87db342a2d (patch) | |
tree | ba5a67cbf7a60f19bbe6a2ca83dedf2132b991ba /src/init/main.c | |
parent | 2cd4a60b2f8dd3fc5196fe97c6f1882e2e8ebe0d (diff) |
init: userland tty emulator ; also workaround a fork() bug
Diffstat (limited to 'src/init/main.c')
-rw-r--r-- | src/init/main.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/init/main.c b/src/init/main.c index ba5fdcd..1b9c7ed 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -17,21 +17,19 @@ extern char _initrd; void read_file(const char *path, size_t len); void fs_prep(void); +void ansiterm_drv(void); // TODO header file + __attribute__((section(".text.startup"))) int main(void) { // allocate bss _syscall_memflag(&_bss_start, &_bss_end - &_bss_start, MEMFLAG_PRESENT); + if (!fork2_n_mount("/tty")) ansiterm_drv(); + __tty_fd = _syscall_open("/tty", sizeof("/tty") - 1); if (__tty_fd < 0) _syscall_exit(1); - // change screen color - handle_t vga = _syscall_open(argify("/vga")); - for (int i = 1; i < 80*25*2; i += 2) - _syscall_write(vga, "\x4f", 1, i); - _syscall_close(vga); - fs_prep(); shell_loop(); |