44f0ec601f
Kernel: Expose /proc/meminfo and fix /proc/<pid>/meminfo
...
Thread was unconditionally calling <stack>->size() without validating
that the stack actually exists
2024-08-09 15:58:56 +03:00
f8261c60c0
Kernel: Rewrite the whole scheduler and re-architecture SMP handling
...
Change Semaphore -> ThreadBlocker
This was not a semaphore, I just named it one because I didn't know
what semaphore was. I have meant to change this sooner, but it was in
no way urgent :D
Implement SMP events. Processors can now be sent SMP events through
IPIs. SMP events can be sent either to a single processor or broadcasted
to every processor.
PageTable::{map_page,map_range,unmap_page,unmap_range}() now send SMP
event to invalidate TLB caches for the changed pages.
Scheduler no longer uses a global run queue. Each processor has its own
scheduler that keeps track of the load on the processor. Once every
second schedulers do load balancing. Schedulers have no access to other
processors' schedulers, they just see approximate loads. If scheduler
decides that it has too much load, it will send a thread to another
processor through a SMP event.
Schedulers are currently run using the timer interrupt on BSB. This
should be not the case, and each processor should use its LAPIC timer
for interrupts. There is no reason to broadcast SMP event to all
processors when BSB gets timer interrupt.
Old scheduler only achieved 20% idle load on qemu. That was probably a
very inefficient implementation. This new scheduler seems to average
around 1% idle load. This is much closer to what I would expect. On my
own laptop idle load seems to be only around 0.5% on each processor.
2024-07-22 00:33:50 +03:00
9d7f97ccd5
Kernel: Implement DevFileSystem::remove_device
...
This function cleanly removes the devices from the whole filesystem.
USB devices are now removed from the filesystem as soon as they are
destroyed.
2024-07-15 22:10:42 +03:00
a97a574718
Kernel: Rewrite the whole input system
...
PS/2 code is now kind of messed up, but it works. Keyboards and mice are
now an abstract class that is automatically exposed to userspace. This
will make adding USB input much nicer.
2024-07-14 01:53:50 +03:00
31568fc5a1
Kernel: Rewrite Sockets to not be TmpInodes
...
TmpInodes just caused issues because TmpFS kept them alive. There was
really no reason for sockets to even be stored inside a TmpFS...
2024-06-27 00:35:19 +03:00
bce16cdd6e
Kernel: Fix how socket closing works
...
Sockets are now closed only when they are not referenced any more. This
allows child process to close socket and still keep it open for the
parent.
2024-06-19 10:39:44 +03:00
318ce5dec8
All: Fix a lot of compiler warnings from header files
...
While reworking build system, header files started to report warnings.
2024-06-18 23:02:10 +03:00
cad55a4da5
Kernel/LibC: Implement getsockname for ipv4 sockets
2024-06-17 20:54:45 +03:00
ea7fc7f6c4
Kernel: Implement read-only FAT12/16/32 driver with long name support
...
You can now mount FAT filesystems! This code might not work perfectly
but my quick testing seemed to work on all (FAT12/16/32) variants.
2024-06-14 01:04:12 +03:00
766439db6d
Kernel: Start work on adding support for new filesystems
...
Old code tried to create ext2 filesystem from all devices.
2024-06-11 10:50:26 +03:00
0af74fccda
Kernel/LibC: Rework dirent structure
...
dirent now contains statically sized d_name. This allows using
sizeof on the name and dirent properly, which some programs seem
to be using.
2024-05-22 20:19:59 +03:00
4d1f0e77f2
Kernel: Fix physical address size for x86_32
...
Having 32 bit address space does not mean physical address space
is also only 32 bits...
2024-03-26 20:16:20 +02:00
99e30a4d7d
Kernel: Replace i386 with i686
...
I don't really want to be working with i386 since it doesn't support
compare exchange instruction
2024-03-26 02:48:26 +02:00
2352c86048
Kernel: i386 has 14 indirect blocks in TmpInode instead of 2
...
This allows keeping size of TmpInodeInfo as 128
2024-03-22 14:01:27 +02:00
d94f6388b7
Kernel: Fix all broken locks from new mutexes
2024-02-28 22:45:34 +02:00
9594ee8e47
Kernel: Start making device numbers unique for each device
2024-02-22 15:53:48 +02:00
f73e954b28
Kernel: Remove SpinLock from Pipe
...
Pipe already is using lock on the inode. If you read from pipe when
there was no data, pipe blocked indefinately since writes were blocked
by Inode::m_lock.
2024-02-14 17:21:32 +02:00
3fc1edede0
Kernel/LibC: Implement super basic select
...
This does not really even block but it works... :D
2024-02-12 17:26:33 +02:00
ff49d8b84f
Kernel: Cleanup OSI layer overlapping
2024-02-09 17:05:07 +02:00
49889858fa
Kernel: Allow chmod on TmpSocketInode
2024-02-08 03:16:01 +02:00
e7dd03e551
Kernel: Implement basic connection-mode unix domain sockets
2024-02-08 02:28:19 +02:00
132286895f
Kernel: Implement Socket inodes for tmpfs
2024-02-07 15:57:45 +02:00
41cad88d6e
Kernel/LibC: Implement dummy syscalls for accept, connect, listen
2024-02-07 15:57:45 +02:00
e1ffbb710b
Kernel/LibC: Implement basic ioctl for network addresses
2024-02-03 01:50:10 +02:00
0f154c3173
Kernel: Implement basic recvfrom
2024-02-02 13:50:00 +02:00
ec2f21bb9f
Kernel/LibC: Implement SYS_SENDTO
2024-02-02 03:16:01 +02:00
ab150b458a
Kernel/LibC: Implement basic socket binding
2024-02-02 01:31:58 +02:00
dfe5a2d665
All: Cleanup all files
...
Add newline to end of files and remove whitespace from end of lines
2024-01-24 15:53:38 +02:00
2cee2a85e6
Kernel: DevFS now stores all devices
...
This allows removing hack in PCI that was required to keep NVMe
controller alive.
2024-01-24 14:33:50 +02:00
96d831c31a
Kernel/LibC/Userspace: Implement chown and set tty owner on login
2024-01-02 22:19:38 +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
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
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
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
885ed218fa
Kernel: Make unlinking from /proc always fail with EPERM
2023-11-07 02:40:27 +02:00
06e176e6b9
Kernel: Make ProcFS use the new TmpFS internally
2023-11-07 02:35:44 +02:00
b7771e95ac
Kernel: Implement TmpFS Inode unlinking and deletion
2023-11-06 21:49:12 +02:00
3e33fc156b
Kernel: TmpFS directory inodes now iterate over only valid entries
2023-11-06 21:41:51 +02:00
c3ed700324
Kernel: Implement TmpFS inode chmod
2023-11-06 20:11:34 +02:00
ba2f09a4e6
Kernel: Cleanup TmpFS code and block access doesn't require allocs
...
TmpFS blocks are now accessed with a simple wrapper
2023-11-06 20:07:09 +02:00
c92c1b8e2b
Kernel: TmpInode blocks are on demand allocated
2023-11-06 10:44:37 +02:00
c27d20abd8
Kernel: Implement read/write/truncate for TmpFileInode
2023-11-05 02:28:43 +02:00
99d7b0917d
Kernel: Start work on proper TmpFS in Heap instead of kmalloc memory
2023-11-04 18:18:45 +02:00