Commit Graph

1807 Commits

Author SHA1 Message Date
Bananymous bd1290706a Kernel: Implement SharedMemoryObject cloning 2024-06-03 03:41:00 +03:00
Bananymous 939cbf46e4 BAN: Implement BAN::UTF8::to_codepoint() for single byte types 2024-06-03 03:39:57 +03:00
Bananymous aec5a09caf Kernel/LibC: Implement SYS_ISATTY and isatty() 2024-06-03 03:36:25 +03:00
Bananymous 6346d1b6c7 Shell: Add builtin command for starting window server and test windows 2024-06-02 17:27:40 +03:00
Bananymous 05ee242b80 WindowServer: Add window title to title bar and send close events 2024-06-02 17:27:09 +03:00
Bananymous 64be3f05a3 LibGUI: Add 10 second timeout for connecting to WindowServer 2024-06-02 17:25:17 +03:00
Bananymous cfdce9be61 BAN: Mark RefPtr and WeakPtr helper destructors virtual
Also fix a bug in WeakPtr::lock() which would assert false if the
underlying weak link was not initialized
2024-06-02 16:50:26 +03:00
Bananymous 446220494e Kernel: Unix domain sockets close can now be detected
When a unix domain socket is closed and it has a connection to another
socket, it will make the other socket readable and recv will return 0.

This allows detection of socket closing
2024-06-02 16:48:55 +03:00
Bananymous f12ffa92a0 LibFont: Font::get_glyph() now returns nullptr if glyph does not exist
This allows getting glyphs with a single hash lookup
2024-05-31 13:05:07 +03:00
Bananymous b2a4797d16 BAN: Fix dwarnln and derrorln stop color 2024-05-31 13:04:36 +03:00
Bananymous 8bfacb0091 Kernel: Implement deletion of SMO objects 2024-05-31 13:04:23 +03:00
Bananymous 0501f3bd99 Kernel: Move font code to its own library LibFont 2024-05-31 10:47:05 +03:00
Bananymous ae3ae6fd0e WindowServer: Fix partial invalidation over cursor 2024-05-31 03:20:21 +03:00
Bananymous 011a5f57e1 WindowServer: Add title bars and clean up code 2024-05-31 03:02:58 +03:00
Bananymous 84b3289a2a Kernel: Move Scheduler::yield() lock check after interrupts disabled
I have no idea why this solves a bug where current processor has
scheduler lock at the beginning of yield.
2024-05-31 02:56:39 +03:00
Bananymous b760892de2 Kernel: Make pselect use nanosecods instead of milliseconds 2024-05-31 02:56:17 +03:00
Bananymous 6840a8983c Kernel: Make sure MSB is not set on SMO keys 2024-05-29 20:01:12 +03:00
Bananymous a1b3490764 Kernel: Improve random number generation for unsigned types 2024-05-29 20:00:47 +03:00
Bananymous 076f1efecb Kernel: Fix 32 bit fast page locking
I forgot to change this when changing the lock type. 32 bit boots again
fine :D
2024-05-29 19:44:39 +03:00
Bananymous b23511edb1 LibC: Don't use BAN inside pwd.cpp
This made pwd.cpp require libstdc++ which meant that getlogin() also
needed libstdc++. This made build process of libstdc++ require itself
which is of course not possible.
2024-05-29 19:12:15 +03:00
Bananymous 53e572f072 Kernel: Fix s_fast_page_lock type on 32 bit target 2024-05-29 18:04:23 +03:00
Bananymous c2b6ba0d5a Userspace: Start work on GUI and WindowServer
Current implementation can create custom windows and each window has
its own framebuffer. When window wants to write its framebuffer to the
screen it will send a message to the WindowServer using unix sockets.
2024-05-29 16:00:54 +03:00
Bananymous d4d530e6c8 Kernel: Implement basic shared memory objects
These can allocate memory that can be shared between processes using
a global key. There is currenly no safety checks meaning anyone can
map any shared memory object just by trying to map every possible key.
2024-05-29 15:58:46 +03:00
Bananymous 99270e96a9 Kernel: Lock debug lock while printing fault details
This allows multiprocessor to dump clean output on concurrent faults
2024-05-29 15:49:24 +03:00
Bananymous 4bf7a08c80 Kernel: Allow SYS_PSELECT to work with timeout of zero 2024-05-29 15:32:18 +03:00
Bananymous 3823de6552 Kernel: Add templated get function for Random 2024-05-29 15:32:00 +03:00
Bananymous 30592b27ce BAN: Add comparison operators for RefPtr 2024-05-29 13:50:03 +03:00
Bananymous 8bc6c2eb20 Kernel: Move KeyEvent/MouseEvent from kernel to LibInput 2024-05-28 23:30:08 +03:00
Bananymous 87d52e5ebe Kernel: Fix timer early wake message
When printing early return message, current time was read twice. This
could lead to early return check failing, but when printing and reading
the time again subtraction overflow would happen.
2024-05-28 16:04:18 +03:00
Bananymous 598a09c13d Kernel: Allow select to work on any type of inode 2024-05-28 16:03:54 +03:00
Bananymous 54db4ab215 BAN: Increase BAN::Function storage size to 8 pointers 2024-05-28 16:01:41 +03:00
Bananymous 5b5ccba247 LibC: Define PATH_MAX in limits.h 2024-05-28 01:08:25 +03:00
Bananymous 18e2559b1e Kernel/LibC: Add SYS_TRUNCATE 2024-05-28 01:08:04 +03:00
Bananymous f5987b68ff BAN: Mark some class methods as constexpr 2024-05-28 01:07:29 +03:00
Bananymous a1ab44d39f Kernel: Optimize disk reads to read multiple sectors at once
Old StorageDevice::read_sectors() read each sector separately if the
underlying disk had a disk cache. This patch allows multiple sectors to
be read even if the disk cache exists and contains some of the sectors.

Only sectors that could not be found from the disk cache are actually
read from the disk. This optimization is not done for writing, which
still will write each sector separately, if disk cache has no memory to
store new sectors. It would feel kind of unnecessary optimization as you
have greater problems if disk cache cannot allocate a single page.
2024-05-27 15:52:34 +03:00
Bananymous 8b1514e575 Kernel: Make all storage devices readable and writable
I only had a {read,write}_impl defined for ATABaseDevice. This patch
moves that implmentation to general storage device.
2024-05-27 13:41:55 +03:00
Bananymous 2d3810874d Kernel: Fix thread signal handling
Threads will now only handle signals once they are not holding any
mutexes. This removes some dead locks.
2024-05-26 20:08:35 +03:00
Bananymous a4c634e4bf Sysroot: Fix us keymap bracket keys 2024-05-26 16:08:29 +03:00
Bananymous 2a4d986da5 Kernel: Add preliminary support for PCIe
Only segment 0 is supported, but devices can now be accessed through
mmio.

Adding more segments would require adding argument to every PCI API so
it is left for later.
2024-05-25 20:50:07 +03:00
Bananymous 3b18730af6 BuildSystem: Don't build libstdc++ as libc is not complete enough 2024-05-25 19:17:13 +03:00
Bananymous df260fe0e8 Kernel: Process::validate_pointer_access now maps the whole range
This fixes a bug where userspace provided address is not fully mapped
and the kernel tries to read/write it while using PageTable fast page.

In the future userspace input should be copied on syscall entry, so
userspace could not modify the input during syscall. Currently there
is change that userspace input passes kernel syscall validation and
after that userspace could modify the input before the value is
actually used.
2024-05-24 14:14:17 +03:00
Bananymous 2be4fe8404 Kernel: Make PageTable::s_fast_page_lock non-recursive
This lock is only used in wrapper of PageTable. There is no possiblity
of taking the lock outside of these wrappers.
2024-05-24 14:12:35 +03:00
Bananymous 7db7cfe20f BuildSystem: Only use kvm if user has rw access 2024-05-24 11:09:04 +03:00
Bananymous cc2cc2849e Whoami: Rewrite whoami using getlogin 2024-05-23 15:44:21 +03:00
Bananymous 06f4b0b29a BAN: Make String and StringView header only
This allows linking with libc without having to link ban
2024-05-23 15:43:26 +03:00
Bananymous e22821799b LibC: Implement getlogin() 2024-05-23 15:07:21 +03:00
Bananymous 14dd9294aa LibC: Add _POSIX constants to limits.h 2024-05-23 15:04:59 +03:00
Bananymous 83e3409bd8 Kernel/LibC: Update SYS_SEEK to return new offset and implement lseek 2024-05-23 14:49:23 +03:00
Bananymous 7630170ed6 LibC: Implement qsort as quick sort 2024-05-23 14:44:48 +03:00
Bananymous 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