Commit Graph

569 Commits

Author SHA1 Message Date
8f89519bcf Kernel: Keymaps can now be loaded from files 2024-01-10 14:43:19 +02:00
e6d42e5c45 Kernel: Add timeout for device commands on PS/2 devices 2024-01-10 12:51:24 +02:00
961ab9768a Kernel: KeyEvent is now well known keycode
Keycodes are easier to handle as you need only one keyboard layout
for keycodes. Otherwise you would need to implement keyboard layout
for every keyboard driver in every language.
2024-01-10 12:51:24 +02:00
e4f48cbc73 Kernel: Move PS/2 command queue to controller instead of device 2024-01-09 20:00:19 +02:00
d760239748 Kernel: Do a big rewrite of PS/2 code
Command sending+response reading is now synchronized. This allows
bochs to properly initialize both mouse and keyboard simultaneously.

Also status register is checked EVERY time read/write to other IO
ports is performed.
2024-01-08 10:50:55 +02:00
f0cf54e194 Kernel: Reads from PS/2 keyboard and mouse can be terminated 2024-01-05 12:13:44 +02:00
41ae05dd6e Kernel: Update block_or_eintr API to return ErrorOr<> 2024-01-05 12:13:11 +02:00
e45b544a39 Kernel: Implement PS/2 mouse driver
This is realtively simple driver that queries extensions (scroll +
extra buttons) from mouse and reads mouse packages.
2024-01-04 12:17:55 +02:00
d4191c0d94 Kernel: Reorganize PS/2 files to their own directory 2024-01-04 12:04:45 +02:00
c2957d8761 Kernel: PS/2 device automatically sends commands when appended 2024-01-04 12:04:45 +02:00
891ced4da2 Kernel: Move PS2Device to its own file 2024-01-04 12:04:45 +02:00
8f8d6bddc0 Kernel: Unify PS2Device to handle commands instead of inherited 2024-01-04 12:04:45 +02:00
d2d12d5281 Kernel: validate_{string,pointer}_access now return ErrorOr<void>
Now that signals are only processed when returning to userspace,
address validation has to do an early return.
2024-01-03 23:53:04 +02:00
0ba278041b Kernel: Start exec by loading the ELF file. It might not exist... 2024-01-03 23:50:02 +02:00
001e95f973 Kernel: Optimize sse saving/loading
Only save and load sse when new thread is trying to execute sse
instruction. There is no need to do that every time we enter kernel.
2024-01-03 02:06:49 +02:00
9fa13079f2 Kernel: Implement supplementary groups
This code has very ugly file parsing code. I have to create API
for reading files line by line in kernel space...

This allows users to open framebuffer/input files without root.

Mounting has to be moved to userspace soon. It makes no sense to
hard code permissions for every (device) file.
2024-01-02 23:24:32 +02:00
96d831c31a Kernel/LibC/Userspace: Implement chown and set tty owner on login 2024-01-02 22:19:38 +02:00
951eac6bfa Kernel: Implement hacky non-block read for ps2 keyboard 2023-12-19 00:20:46 +02:00
2e858fddb5 Kernel: Remove obsolete Scheduler::is_valid_tid()
This function was used when processes could die at any point in time.
Now that processes can only die in known spots, we can be sure they
are not holding any locks. This allows much more performant locking.
2023-12-07 13:26:42 +02:00
12474addda Kernel: Make Inodes use the new lock
Also remove old lock from TTY since it can just use the one Inode
already has.
2023-12-07 13:19:12 +02:00
7c25e4ce5a Kernel: Implement RecursivePrioritySpinLock
This locks won't allow locking from userspace thread if there is
kernel thread waiting to lock this.
2023-12-07 13:18:21 +02:00
1ac831d4b1 Kernel: Add API to block on semaphore until unblock or EINTR 2023-12-06 16:13:07 +02:00
534969df32 Kernel: Scheduler::unblock_thread() wakes sleeping threads 2023-12-06 16:12:37 +02:00
1c78671078 Kernel: Rework all signal code
Signal handling code was way too complex. Now everything is
simplified and there is no need for ThreadBlockers.

Only complication that this patch includes is that blocking syscalls
have to manually be made interruptable by signal. There might be some
clever solution to combat this is make this happen automatically.
2023-12-06 13:02:17 +02:00
cdcc36efde Kernel: Remove unnecessary raise syscall 2023-12-06 13:00:45 +02:00
336daa2cc5 Kernel: Add helper for checking whether segment is from userspace 2023-12-06 12:57:13 +02:00
cc572af390 Kernel: Implement mmaping for framebuffer device 2023-11-28 23:51:56 +02:00
4a87d6052b Kernel: Add API for implementing mmappable devices 2023-11-28 23:50:49 +02:00
09b7cb2f33 Kernel/LibC: Implement pread() 2023-11-28 23:47:30 +02:00
60e755210c Kernel/LibC: Implement very basic msync 2023-11-22 22:44:06 +02:00
ab9954fe73 Kernel: Delete the now obsolete VesaTerminalDriver 2023-11-22 21:59:11 +02:00
fd18071975 Kernel: Implement TerminalDriver for Framebuffer device
Use this new FramebufferTerminalDriver for terminal instead of the
old VesaTerminalDriver. Only drawback with this is that framebuffer
device can only be intialized after DevFS is initialized.
2023-11-22 21:57:17 +02:00
b88a7e0c6b Kernel: Add more APIs to FramebufferDevice 2023-11-22 21:56:27 +02:00
cdf53f33f6 Kernel: Implement basic framebuffer device
This allows exposing framebuffer to userspace
2023-11-22 20:34:41 +02:00
bc5e8add19 Kernel: Make Ext2 filesystem use BlockDevice instead of Partition 2023-11-21 15:20:24 +02:00
7a8fd6d04a Kernel: TmpFS doesn't mark any functions as final
I didn't think these would be overloaded, but they are
2023-11-21 15:19:34 +02:00
b749963b62 Kernel: Add common {read,write}_blocks() api to BlockDevice 2023-11-21 15:19:07 +02:00
6a068fb9f9 Kernel: Move Partition to its own file 2023-11-21 15:16:04 +02:00
cadb56d8ba Kernel: ProcFS inodes reflect processes ruid/rgid
setgid/setuid did not change the permissions of procfs inodes. This
made Shell launched by init not appear in meminfo.
2023-11-18 14:26:44 +02:00
c9e9cfd361 Bootloader: Implement VESA video mode query and pass it to kernel
Kernel now gets framebuffer from bootloader. Framebuffer dimensions
and bpp are hardcoded in bootloader, but will probably be read from
config file at some point.
2023-11-17 22:45:35 +02:00
cb5a5d3ed1 Kernel/Bootloader: banan-os can now be booted with my bootloader :D 2023-11-17 20:33:02 +02:00
84040e64b8 Kernel: Don't use multiboot2 explicitly. Parse it to common structure
This allows support of multiple different bootloaders
2023-11-17 18:54:59 +02:00
c084ce8b01 Kernel/LibC: Implement readlink and readlinkat 2023-11-11 23:16:52 +02:00
fda0dfec30 Kernel: Make TmpFS enforce max page count. 2023-11-07 16:13:21 +02:00
d6ae1bcf36 Kernel: Remove now obsolete RamFS
Everything is using now the better TmpFS which uses physical pages
for page allocation instead of the static kmalloc memory.
2023-11-07 16:07:11 +02:00
5044810451 Kernel: Make DevFS use the new and better TmpFS instead of RamFS 2023-11-07 16:05:05 +02:00
147cd93ed3 Kernel: Add method to TmpFS for looping over all (cached) inodes 2023-11-07 16:04:34 +02:00
07b5920f3f Kernel: Lock TmpFS in all its methods 2023-11-07 16:03:52 +02:00
2bcf934389 Kernel: Implement symlinks to TmpFS 2023-11-07 15:59:50 +02:00
1405712f26 Kernel: Make PS/2 keyboard wait until interrupts are enabled 2023-11-07 15:58:50 +02:00