Commit Graph

16 Commits

Author SHA1 Message Date
Andreas Kling
e452303c66 Allow character devices to block write attempts until there is more space. 2019-01-15 09:17:22 +01:00
Andreas Kling
b0e3f73375 Start refactoring the windowing system to use an event loop.
Userspace programs can now open /dev/gui_events and read a stream of GUI_Event
structs one at a time.

I was stuck on a stupid problem where we'd reenter Scheduler::yield() due to
having one of the has_data_available_for_reading() implementations using locks.
2019-01-14 14:42:49 +01:00
Andreas Kling
aff89d2fd7 Yet more coding style fixes. 2018-12-03 01:38:22 +01:00
Andreas Kling
f6e27c2abe More coding style changes. 2018-12-03 00:39:25 +01:00
Andreas Kling
9a086b2d35 Add a kmalloc_eternal() for things that will never be destroyed. 2018-10-31 23:19:15 +01:00
Andreas Kling
68739dc43e Start working on virtual consoles/TTYs.
This is a mess right now, but I'd rather commit as I go.
2018-10-30 13:59:29 +01:00
Andreas Kling
43475f248b Add save/unsave cursor escape sequences.
Also added a little terminal test program called /bin/tst.
2018-10-28 01:44:53 +02:00
Andreas Kling
dd3244137e Add basic support for ANSI color escape sequences. 2018-10-28 00:56:19 +02:00
Andreas Kling
8289a5c93c Implement 'H' and 'J' escape sequences. 2018-10-27 23:42:20 +02:00
Andreas Kling
c928b06218 Add a very hackish /proc/PID/stack.
It walks the stack and identifies anything that looks like a kernel symbol.
This could be a lot more sophisticated.
2018-10-26 22:33:15 +02:00
Andreas Kling
81627cf7d5 Add a simple /proc/mounts that enumerates the current VFS mounts. 2018-10-26 18:43:25 +02:00
Andreas Kling
c6f2890d8e Implement a basic way for read() to block.
FileHandle gets a hasDataAvailableForRead() getter.
If this returns true in sys$read(), the task will block(BlockedRead) + yield.
The fd blocked on is stored in Task::m_fdBlockedOnRead.
The scheduler then looks at the state of that fd during the unblock phase.

This makes "sh" restful. :^)

There's still some problem with the kernel not surviving the colonel task
getting scheduled. I need to figure that out and fix it.
2018-10-25 13:09:56 +02:00
Andreas Kling
ccd15e0590 Various things:
- putch syscall now directly calls Console::putChar().
- /proc/summary includes some info about kmalloc stats.
- Syscall entry is guarded by a simple spinlock.
- Unmap regions for crashed tasks.
2018-10-23 15:19:02 +02:00
Andreas Kling
09fc9c0698 Make Console::m_rows/m_columns const for now. 2018-10-21 23:48:50 +02:00
Andreas Kling
fc88368582 Have Console::write() directly call vga_putch. 2018-10-21 22:44:26 +02:00
Andreas Kling
a70bfb87d5 Add a Console device and start refactoring screen output. 2018-10-21 21:59:43 +02:00