Commit Graph

16 Commits

Author SHA1 Message Date
6a924db68c Kernel: Implement FIONREAD for tty and pty 2025-11-24 18:15:10 +02:00
34bdcb12e5 Kernel: Fix termios and enter key handling
Enter key now produces expected \r which gets converted to \n by default
by the ICRNL input flag.

Also input flags are now handled always, not just when ICANON is set.
I don't know why I though ICANON should disable input handling
2025-08-19 16:23:30 +03:00
6084aae603 Kernel: Add guard pages to kernel and userspace stacks 2025-07-02 23:12:36 +03:00
e8491b34b8 Kernel/LibC: Rework TIOC{G,S}WINSZ more linux like
Userspace can freely set terminal size, kernel just updates it when for
example new font is loaded. Also SIGWINCH is now sent by kernel instead
of userspace.
2025-06-28 19:40:54 +03:00
b668173cba Kernel: Fix pseudo terminal writability 2025-06-06 11:09:50 +03:00
eecdad50a6 Kernel: Fix most of mutex + block race conditions
All block functions now take an optional mutex parameter that is
atomically unlocked instead of having the user unlock it before hand.
This prevents a ton of race conditions everywhere in the code!
2025-06-06 03:59:22 +03:00
4c0b7d44b4 Kernel: Enable ECHOE and ECHOK, support VKILL, fix VEOF 2025-06-02 16:26:53 +03:00
fb466b5af7 Kernel: use termios c_cc values instead of hardcoded characters 2025-06-02 15:54:11 +03:00
8ff9c030bf Kernel: Add better termios support
I'm not sure if this is correct but at least it's better than before :)
2025-06-01 13:48:03 +03:00
692ba43182 Kernel: Fix spinlock bugs found by the new spinlock security 2025-06-01 13:48:03 +03:00
1bcd1edbf5 Kernel/LibC: Implement basic epoll
This implementation is on top of inodes instead of fds as linux does it.
If I start finding ports/software that relies on epoll allowing
duplicate inodes, I will do what linux does.

I'm probably missing multiple epoll_notify's which may cause hangs but
the system seems to work fine :dd:
2025-05-13 10:18:05 +03:00
9f4cb5c4dd Kernel: Make pseudo terminals not overwrite old data
If pseudo terminal buffer was filled, old implementation would overwrite
old data. This is bad if producer is capable of producing more data than
consumer can handle.
2025-04-23 22:03:53 +03:00
69137cddab Kernel: Implement TIOCSWINSZ for pseudo terminals
I have no idea how I had forgotten this
2024-12-21 03:22:48 +02:00
1838ea5c30 Kernel: Fix pseudo terminal leaks 2024-11-04 15:35:07 +02:00
2911d1f018 Kernel: Cleanup and fix pseudo terminals 2024-09-15 02:38:07 +03:00
a5a097fa4a Kernel/LibC: Add initial pseudo terminal support
This patch implements posix_openpt() and ptsname()

grantpt() and unlockpt() are left in LibC as stubs, as posix_openpt
currently does all of the needed work.
2024-08-11 01:02:59 +03:00