Commit Graph
100 Commits
Author SHA1 Message Date
Bananymous 74e94eedae LibC: Fix malloc bitmap allocator allocation
Use full pages for bitmap allocators and fix the capacity extension
condition
2026-07-02 15:22:52 +03:00
Bananymous d241975ce1 Kernel: Remove SYS_SLEEP and cleanup SYS_NANOSLEEP
`sleep` is now implemented in terms of `nanosleep`. `nanosleep` is now
more precise and handles overflow when calculating wakeup time. I don't
think anything was depending on this, but I could see a program sleeping
for max time to block until signal.
2026-07-02 15:22:52 +03:00
Bananymous 20663b533b Kernel: Rework sleeping API
instead of sleep_{ns,ms} we now have sleep_{for,until}_{ns,ms}. This
makes code cleaner that just wants to sleep until some timestamp
2026-07-02 15:22:52 +03:00
Bananymous 6f002f0c07 LibC: Make pthread_{equal,self,testcancel} static inline
This allows using ::pthread_self or &pthread_self
2026-06-30 20:14:38 +03:00
Bananymous f121e80bfd Kernel: Fix PROT_EXEC flags in sys_mprotect 2026-06-30 20:14:38 +03:00
Bananymous 4e28a35af9 Kernel: Support hardware checksum offload on RTL8169 receive 2026-06-30 20:14:38 +03:00
Bananymous ddb7641b05 Kernel: Support hardware checksum offload on E1000 receive 2026-06-30 20:14:38 +03:00
Bananymous a6ad9b9b2e Kernel: Add system for hardware checksum offload on received packets 2026-06-30 20:14:38 +03:00
Bananymous c0bd07174d Kernel: Reduce the number of E1000 register reads while receiving
There is no need to read and write the receive tail pointer for every
packet. This change bumped my TCP speed from ~11MB/s to ~40MB/s which is
my network speed limit
2026-06-30 20:14:38 +03:00
Bananymous 8f4e15b78e Kernel: Use spinlocks and disable interrupts with loopback interface
This makes sure we don't get pre-empted after acquiring a descriptor but
before finishing marking it ready
2026-06-30 20:14:38 +03:00
Bananymous 17e6e53948 Kernel: Move Ethernet header prepending from NIC to helper 2026-06-30 20:14:38 +03:00
Bananymous 223835c37d Kernel: Fix TCP stack sending a lot of DUP-ACKs 2026-06-30 20:14:37 +03:00
Bananymous aedd53b3e0 Kernel: Disable interrupts while appending packet in E1000
This avoids getting rescheduled and having other packets waiting to get
sent because of that
2026-06-30 20:14:37 +03:00
Bananymous 6339044e4c Kernel: Fix RTL8169 driver
This now works properly on real hardware. Main issue was a race
condition with now ISR was handled in the interrupt handler. We now loop
until we read back ISR as zero
2026-06-30 20:14:37 +03:00
Bananymous 924576cf0d WindowServer: Fix invalidation for fullscreen windows 2026-06-30 20:14:37 +03:00
Bananymous ac333c9677 ports: Update llvm 20.1.8->22.1.8 2026-06-30 20:14:37 +03:00
Bananymous 6e47fa084b Kernel: Fix ext2 indirect block lookup math
This was broken for doubly and triply indirect blocks :D
2026-06-30 20:14:37 +03:00
Bananymous 32c10f7db2 Userspace: Add very simple top program
This is very bare bones but does show what programs use most cpu and
memory
2026-06-30 20:14:37 +03:00
Bananymous 9919cbf66e Kernel: Pass interpreter base address in auxiliary vector 2026-06-30 20:14:37 +03:00
Bananymous fc1a6cacdc Kernel: Optimize process stopping 2026-06-27 03:24:15 +03:00
Bananymous 040bdea08e Kernel: Support volume keys from USB consumer page 2026-06-27 03:24:15 +03:00
Bananymous 579cd07109 Kernel: Expose process cpu time in proc filesystem 2026-06-27 03:24:15 +03:00
Bananymous 7bf7de44d2 Kernel: Support SO_TYPE and SO_KEEPALIVE getsockopt in UNIX socket 2026-06-27 03:24:15 +03:00
Bananymous 58aff97c28 Kernel: Implement getsockname for UNIX sockets 2026-06-27 03:24:15 +03:00
Bananymous 2bb9b9b4b3 Kernel: Don't read CR registers on every exception 2026-06-27 03:24:15 +03:00
Bananymous 59ec05c898 Kernel: Make TSC based timer monotonic
Prior to this I was just blindly rebasing the current TSC stats every
once in a while. Now I check for drift and scale the multiplier
accordingly to keep the timer from drifting
2026-06-27 03:24:15 +03:00
Bananymous ac0ef53e87 Kernel: Fix HPET interrupt routing
If the HPET did not support legacy routing we would still use IRQ0 which
lead to using PIT irq which fired ~18 times per second
2026-06-27 03:24:15 +03:00
Bananymous 5aea95129e BuildSystem: Allow building compressed initrd
Building with BANAN_INITRD=2 will now compress using gzip!
2026-06-25 22:43:47 +03:00
Bananymous 92d10f612e Kernel: Make sure PCIeInfo is zero initialized 2026-06-25 01:42:02 +03:00
Bananymous f3f40a465b Kernel: Fix HDA amplifier step size calculation
step size is zero based, 0 means 250 mdB
2026-06-25 01:41:41 +03:00
Bananymous d3130884b6 Kernel: Hack TTY to work as debug console
debug printing takes the debug lock, but TTY uses mutex for its lock
2026-06-25 01:41:41 +03:00
Bananymous 5a516a6130 ports/xbanan: Update to new version 2026-06-23 23:56:08 +03:00
Bananymous 689494db63 LibGUI/WindowServer: Allow querying global cursor position 2026-06-23 23:31:17 +03:00
Bananymous 1287c8e335 LibGUI: Cleanup packet creation 2026-06-23 23:30:42 +03:00
Bananymous 763a742f6d WindowServer: Fix client fd leaks 2026-06-23 21:08:57 +03:00
Bananymous 4ad586552d LibGUI/WindowServer: Send window move events 2026-06-23 20:52:12 +03:00
Bananymous 8bc93069be Terminal: Fix foreground and background colors when inverted
I was not checking for inverted colors in a lot of places :P
2026-06-23 20:16:25 +03:00
Bananymous 160821869d ports: Add libX{composite,cursor,damage,inerama} ports 2026-06-23 15:28:25 +03:00
Bananymous aa1b1e1af9 ports: Add butterscotch port 2026-06-22 21:25:04 +03:00
Bananymous e19414a64e BuildSystem: Fix GCC compilation with new host GCC
Newer GCCs fail to compile GCC 15.2.0 because of how u8"" literals are
handled. This can be bypassed by compiling with -fno-char8_t
2026-06-07 03:20:50 +03:00
Bananymous 98fd86477a Kernel: Remove allocations from path lookup
this bumped looped /usr/bin/ls stat performance from 750k->1100k/s
2026-05-26 19:10:16 +03:00
Bananymous 16a442f473 Kernel: Fix Thread::will_exit_because_of_signal
I was not checking whether the signal handler has been overwritten to
ignore the signal leading to infinite busy loops :)
2026-05-26 03:31:20 +03:00
Bananymous becfa228fe Kernel: fix signal handler block mask restoration 2026-05-26 03:31:20 +03:00
Bananymous c0ce647c74 ports: Cleanup dependencies and configure flags 2026-05-26 03:31:20 +03:00
Bananymous 05250083b9 ports: Clenup toolchain files 2026-05-26 03:31:20 +03:00
Bananymous bb170ba613 ports: Allow build scripts install to custom path
This will maybe allow packaging ports :)
2026-05-26 03:31:20 +03:00
Bananymous c79e412215 resolver: Fix UB and resolve localhost 2026-05-25 03:19:20 +03:00
Bananymous 585e021c7f Kernel: Don't panic when stack trace leads to GPF
if there is was a uncanonical address in stack trace we ended up in an
infinite recursive loop trying to print stack trace
2026-05-25 02:19:56 +03:00
Bananymous 43d03eb4a9 LibC: Add shm_open/shm_unlink
These can just open files in /tmp/shm. no need for anything fancier
2026-05-25 02:14:04 +03:00
Bananymous 2a6792b44a LibC: Make mlock, munlock and madvice no-ops
These don't have to do anything as I don't swap processes to disk
2026-05-25 02:14:04 +03:00
Bananymous 954898b14d Kernel: Fix file backed mmap syncing, my if condition was inverted 2026-05-25 02:14:04 +03:00
Bananymous d266d2ca88 Kernel: Allow network interface ioctls on interfaces
previously it was only on the sockets
2026-05-25 02:14:04 +03:00
Bananymous c72f2f9b31 LibC: Fix posix_spawn
signal was checking for NULL instead of SIG_ERR

there is no need to do post fork waiting in posix_spawn, we just have to
exit with 127 on error
2026-05-25 02:14:04 +03:00
Bananymous 62e2f4896a LibC: reorder LOCK_SH and LOCK_EX
Some software im porting has static asserts for these :)
2026-05-25 02:14:04 +03:00
Bananymous 9ccdebcd96 LibC: Implement/fix mk{,o}stemp{,s} 2026-05-25 02:14:04 +03:00
Bananymous fe533c2e62 LibC: Fix freopen to preserve file state :) 2026-05-25 02:14:04 +03:00
Bananymous ee5c225954 LibC: Add __fseterr
This is used by some ports to not require internal FILE structure
2026-05-25 02:14:04 +03:00
Bananymous 8fccb74542 Kernel: Add indirect block cache to ext2 inode
This reduces indirect block lookup by a lot :)
2026-05-25 02:14:04 +03:00
Bananymous bc8ecbd6fa Kernel: Add directory entry cache for ext2 inodes 2026-05-25 02:14:04 +03:00
Bananymous 60484b286f Kernel: Fix bugs in sys_pselect
I was not validating nfds passed from userspace. Also invalid fds are
supposed to return EBADF instead of ignoring those entries
2026-05-25 02:14:04 +03:00
Bananymous 12158d9208 Kernel: Add OpenFileDescriptorSet::get_max_open_fd 2026-05-21 14:59:35 +03:00
Bananymous 5c94c30e1b Kernel: Use spinlocks instead of mutexes for RWLock
All the operations are super fast, just checking or changing few
integers, there is no need for a yielding mutex :^)
2026-05-21 02:17:34 +03:00
Bananymous 81d8ab3d79 Kernel: Remove completely unnecessary lock on file lookup
Mount point lookup already does locking internally, there is no need for
a lock for the whole duration of the lookup :D
2026-05-21 01:59:36 +03:00
Bananymous 6a58c716bd Kernel: Make ext2 inode cache thread safe 2026-05-21 01:56:32 +03:00
Bananymous c295af9bd5 BAN: Fix HashMaps with custom hashes and comparators 2026-05-20 23:10:25 +03:00
Bananymous d5ee98708b TaskBar: Show CPU load in task bar! 2026-05-20 19:14:21 +03:00
Bananymous f6679eb4b5 Kernel: Expose CPU load information under /proc/cpu/<index> 2026-05-20 19:13:25 +03:00
Bananymous ed3924722e Kernel: Remove kernel CPU load printing
We still keep track of processor loads but the hacky printing is no
longer done in kernel space :)
2026-05-20 19:11:27 +03:00
Bananymous 4ef03eac97 Kernel: Allow ProcRO inode fail and pass arbitrary argument to it 2026-05-20 19:06:10 +03:00
Bananymous 7ce68b0488 LibGUI: Allow timeout with Window::wait_events 2026-05-20 19:03:11 +03:00
Bananymous 14aa28b043 Kernel: Handle TTY ioctls on all inodes not implementing it
This reduces debug spam while compiling software
2026-05-20 16:57:24 +03:00
Bananymous 6045726e41 Kernel: Optimize PageTable::unmap_range on x86_64 2026-05-20 16:16:44 +03:00
Bananymous 45e55d8907 LibC: Don't compare equal elements in qsort
This seemed to break supertuxkart which returned `less` in this case
2026-05-20 05:54:45 +03:00
Bananymous e9d6431728 DynamicLoader: Fix dynamic TLS init order 2026-05-20 05:03:20 +03:00
Bananymous aa8be130f9 DynamicLoader: Cleanup lazy PLT relocations 2026-05-20 05:02:48 +03:00
Bananymous a19e6938eb Kernel: Remove TTY keyboard thread
This was really hacky as it had no idea when the keyboard had events
and the blocking was just one millisecond sleeps :D

Now keyboard device checks if current tty is receiving input and if so
it forwards the events to the TTY.
2026-05-20 04:17:03 +03:00
Bananymous 32206069bc Kernel: Use per cpu fast page for {Memory,File}BackedRegion 2026-05-20 02:51:48 +03:00
Bananymous 46a1903f8d Kernel: Use per cpu fast page for PMM 2026-05-20 02:46:50 +03:00
Bananymous a3ca49ff1f Kernel: Don't sync ext2 inode on read
This is the most common operation and we don't even update any fields
during read (although we should update atime). The disk read+write is a
bit too heavy with the current cache system
2026-05-20 02:14:40 +03:00
Bananymous 94f92d982c Kernel: Optimize PageTable address space reservation
I only did this for the 64 bit target.
2026-05-20 02:01:16 +03:00
Bananymous 4f5f84bb5b Kernel: Speed up mmap address space reservation by a lot
Instead of scanning the page table for free range, we not use the
process's mapped regions to find a slot. This speeds up mmap by a lot!
2026-05-20 01:08:08 +03:00
Bananymous 5cb5ae2dfe Kernel: Use per cpu fast pages for DiskCache
This makes accessing disk cache a lot faster
2026-05-20 00:17:51 +03:00
Bananymous 7704e3c5c0 Kernel: Implement per cpu fast pages
Basically every fast page usage should be converted into this but I'll
do them one by one when they show up in profiles
2026-05-20 00:16:56 +03:00
Bananymous 376e4b4c45 Kernel: Reduce the number of sent IPIs
Only send an IPI when the target processors don't have pending messages.
This basically gets rid of TLB shootdowns from showing up in profiles.
Before they were taking maybe >10% kernel time :^D
2026-05-19 23:52:38 +03:00
Bananymous 24c37e7381 Kernel: Move TLB invalidation out of standard SMPMessages
This makes accessing TLB messages much faster as TLB flushes are very
frequent in comparison to other messages
2026-05-19 23:51:01 +03:00
Bananymous fb9c67ab15 Kernel: Add PageTable API to invalidate full address space 2026-05-19 23:46:56 +03:00
Bananymous d52ad29afa Kernel: Add missing tr cmake file 2026-05-19 13:57:56 +03:00
Bananymous 1dc26d3c06 Kernel: Cleanup inode stat updating
Inode now handles stat upates itself and calls sync function to make
updates visible on the underlying filesystem
2026-05-19 13:00:05 +03:00
Bananymous a05fcdde8c Kernel: Move UTIME_OMIT handling to the syscall from inode 2026-05-19 11:56:12 +03:00
Bananymous deb2f52a35 Kernel: Add support for named pipes
These only copy inodes stat when created, if you fchmod/fchown a named
pipe, the change will not be visible on the filesystem
2026-05-19 00:15:25 +03:00
Bananymous 8224659c48 Kernel: Allow creating FIFOs in tmpfs 2026-05-19 00:05:22 +03:00
Bananymous 1922d78661 Kernel: Add support for mkfifo{,at} mkdir at
Opening FIFOs still dont work as expected but at least you can create
them now :D
2026-05-18 23:53:09 +03:00
Bananymous 6d1ecc2388 Kernel: Clean up file creation 2026-05-18 15:26:59 +03:00
Bananymous 5cf658c175 Kernel: Fix 2 memory pinning bugs
If pinning a region succeeded but pushing the region to a vector failed,
we would leak the pin preventing the process from cleaning up
2026-05-17 03:38:18 +03:00
Bananymous ef2738bfb7 Kernel: Disable devfs device add/remove logging 2026-05-17 03:38:18 +03:00
Bananymous d7865b2929 Kernel: Don't msync file backed pages that were never mapped writable 2026-05-17 03:21:08 +03:00
Bananymous 9c79971bdc LibC/Kernel: Add support for detached pthreads 2026-05-17 00:40:56 +03:00
Bananymous ff75c15ba3 LibC: Move pthread keys to TCB
This removes all TLS relocations from libc which may become handy ;)
2026-05-17 00:29:20 +03:00
Bananymous 9e6fa0a1ba Kernel: Add fast path for invalid address during region pin
Before I was falling through to the write lock which does allocation,
but as the read loop already saw, specified address was not mapped.
2026-05-17 00:29:20 +03:00
Bananymous 6e95519acc Kernel: Make TTY write lock a mutex instead of a spinlock
The mutex could not be locked while processing ANSI DGR in VTTY
2026-05-17 00:29:20 +03:00