aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-05-14 00:17:03 -0400
committerIan Moffett <ian@osmora.org>2024-05-14 00:17:03 -0400
commit3980f6c5b6a637a290939ed53f00894d3aaa97b1 (patch)
treec08f9f011439ee30bf9b1113cc0b4efa9c8cd44c /sys/kern/init_main.c
parent49da408ed8c3d9903a67e0af113b38283862cb47 (diff)
kernel: tty: Add tty_attach()
This commit adds a new routine called tty_attach(). This routine allows a TTY to be registered with the system and have a device file associated with it. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index c78d401..5a0a64b 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -32,6 +32,7 @@
#include <sys/machdep.h>
#include <sys/timer.h>
#include <sys/sched.h>
+#include <sys/tty.h>
#include <sys/vfs.h>
#include <sys/driver.h>
#include <machine/cpu_mp.h>
@@ -76,6 +77,7 @@ void
main(void)
{
struct cpu_info *ci;
+ int status;
__TRY_CALL(pre_init);
syslog_init();
@@ -93,6 +95,10 @@ main(void)
vfs_init();
+ /* Attach the root TTY */
+ if ((status = tty_attach(&g_root_tty)) < 0)
+ kprintf("Failed to attach root TTY (got %d)\n", status);
+
DRIVERS_INIT();
sched_init();