Kernel: Add better termios support

I'm not sure if this is correct but at least it's better than before :)
This commit is contained in:
2025-05-30 22:10:39 +03:00
parent 9b875fb930
commit 8ff9c030bf
6 changed files with 67 additions and 24 deletions

View File

@@ -170,7 +170,15 @@ namespace Kernel
}
SerialTTY::SerialTTY(Serial serial)
: TTY(0600, 0, 0)
: TTY({
.c_iflag = ICRNL,
.c_oflag = OPOST | ONLCR,
.c_cflag = CS8,
.c_lflag = ECHO | ICANON,
.c_cc = {},
.c_ospeed = B38400,
.c_ispeed = B38400,
}, 0600, 0, 0)
, m_name(MUST(BAN::String::formatted("ttyS{}", s_next_tty_number++)))
, m_serial(serial)
{}
@@ -235,8 +243,6 @@ namespace Kernel
while (!m_input.empty())
{
*ptr = m_input.front();
if (*ptr == '\r')
*ptr = '\n';
m_input.pop();
ptr++;
}