From 7fcadc2e8c9d3cd0f05c55fe7856191628475fba Mon Sep 17 00:00:00 2001 From: sotech117 Date: Mon, 4 Mar 2024 02:49:31 +0000 Subject: pass basic functionality --- kernel/drivers/tty/tty.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'kernel/drivers/tty/tty.c') diff --git a/kernel/drivers/tty/tty.c b/kernel/drivers/tty/tty.c index c47a582..e3c77be 100644 --- a/kernel/drivers/tty/tty.c +++ b/kernel/drivers/tty/tty.c @@ -80,9 +80,13 @@ ssize_t tty_read(chardev_t *cdev, size_t pos, void *buf, size_t count) // lock the read mutex of the tty kmutex_lock(&tty->tty_read_mutex); + dbg(DBG_DISK, "tty_read: before wait_read\n"); + // wait until there is something in the line discipline's buffer ldisc_wait_read(&tty->tty_ldisc); + dbg(DBG_DISK, "tty_read: after wait_read\n"); + // read from the ldisc's buffer if there are new characters ssize_t bytes_read = ldisc_read(&tty->tty_ldisc, buf, count); // unlock the read mutex of the tty -- cgit v1.2.3-70-g09d2