Commit graph

24153 commits

Author SHA1 Message Date
Ali Mohammad Pur
e5af15a6e9 LibRegex: Don't do out-of-bound match accesses when a test fails 2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
a245ea1743 AK: Add the at()/operator[]() getter to Utf32View
This is trivial, and makes it easier to get the code point compared to
the previous `.code_points()[index]` (which was not actually checked
for in-bounds length).
2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
55fa51b4e2 AK: Add a is_null() method to Utf{8,32}View
Both of these can be null as well as empty, and there's a difference.
2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
2961982277 LibRegex: Use <...> includes in RegexMatch.h 2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
5089fd8b3c LibRegex: Also print a newline after each debug line
Otherwise the new debug line would be printed right after the previous
one without a newline.
2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
052004f92d LibRegex: Partially implement string compare for Utf32View 2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
da1fda73a7 LibRegex: Implement line splitting for Utf32View
Co-authored-by: Timothy Flynn <trflynn89@pm.me>
2021-07-18 21:10:55 +04:30
Ali Mohammad Pur
0060fa48d4 AK: Don't return a null Utf32View when a zero-length one is requested
There is still an offset to consider, a zero-length view is very
different from a nonexistent string :P

Co-authored-by: Timothy Flynn <trflynn89@pm.me>
2021-07-18 21:10:55 +04:30
Tom
2f754013a1 LibGUI: Fix widgets not being occluded
Widget::is_visible_for_timer_purposes needs to also consult with the
base implementation, which ultimately checks the owning Window's
visibility and occlusion state. Widget::is_visible merely determins
whether a widget should be visible or not, regardless of the window's
state.

Fixes #8825
2021-07-18 18:39:20 +02:00
Tom
220886db4c WindowServer: Fix compositor overdraw issues related to transparency
We were re-rendering areas that were considered transparency areas even
though they weren't transparency areas or were occluded by opaque
areas.

In order to fix this, we need to be a bit smarter about what is above
and below any given window. Even though a window may have transparent
areas, if those are occluded by opaque window areas on top they are
not actually any areas that should be rendered at all. And the opposite
also applies, opaque window areas for windows below that are occluded
by transparent areas, do need to be rendered as transparency. This
solves the problem of unnecessary transparency areas.

The other problem is that we need to know what areas of a window's
dirty rectangles affect other windows, and where. Basically any
opaque area that is somehow below a transparent area that isn't
otherwise occluded, and any transparent area above any other window
area (transparent or opaque) needs to be marked dirty prior to
composing. This makes sure that all affected windows render these
areas in the correct order. To track these, we now have a map of
affected windows and the rectangles that are affected (because not all
of that window's transparency areas may be affected).
2021-07-18 18:39:20 +02:00
Tom
6bb1825366 WindowServer: Recompute occlusions when removing an overlay
This makes sure we don't needlessly render areas with transparency
that used to be occupied by an overlay.
2021-07-18 18:39:20 +02:00
Gunnar Beutner
f56ee10a13 Kernel: Hand out 64-bit addresses to userspace 2021-07-18 17:31:13 +02:00
Liav A
5938d882d8 Kernel: Use a different kernel load address for x86_64
Co-authored-by: Gunnar Beutner <gbeutner@serenityos.org>
2021-07-18 17:31:13 +02:00
Gunnar Beutner
7e94b090fe Kernel: Introduce basic pre-kernel environment
This implements a simple bootloader that is capable of loading ELF64
kernel images. It does this by using QEMU/GRUB to load the kernel image
from disk and pass it to our bootloader as a Multiboot module.

The bootloader then parses the ELF image and sets it up appropriately.
The kernel's entry point is a C++ function with architecture-native
code.

Co-authored-by: Liav A <liavalb@gmail.com>
2021-07-18 17:31:13 +02:00
Gunnar Beutner
357ddd393e Kernel: Make allocate_randomized() work for 64-bit addresses
The odds of finding a suitable address in 1000 attempts were not in our
favor given the size of the 64-bit address space.
2021-07-18 17:31:13 +02:00
Gunnar Beutner
f0c4941beb Kernel: Fix 64-bit address truncation in MemoryManager::ensure_pte() 2021-07-18 17:31:13 +02:00
Gunnar Beutner
ed25a6ad0d SystemMonitor: Add support for 64-bit addresses 2021-07-18 17:31:13 +02:00
Gunnar Beutner
ce123c3b7f pmap: Add support for 64-bit addresses 2021-07-18 17:31:13 +02:00
Gunnar Beutner
98f8ecd9d2 Kernel: Split debug symbols into a separate file
This speeds up the boot process considerably when specifying the kernel
image via -initrd.
2021-07-18 17:31:13 +02:00
Gunnar Beutner
b708b23b13 Kernel: Add support for kernel addresses other than 3-4GB 2021-07-18 17:31:13 +02:00
Gunnar Beutner
6c6b778e2e Kernel: Support 64-bit addresses for kernel thread stacks 2021-07-18 17:31:13 +02:00
Gunnar Beutner
c878054682 Kernel: Make VirtualAddress::page_base() work with 64-bit addresses 2021-07-18 17:31:13 +02:00
Gunnar Beutner
679ae6af81 Kernel: Remove some more hardcoded addresses 2021-07-18 17:31:13 +02:00
Gunnar Beutner
7c3bfde8fd Kernel: Make SCHEDULER_DEBUG work on x86_64 2021-07-18 17:31:13 +02:00
Gunnar Beutner
741ca5477c Kernel: Fix {read,write}_gs_ptr() for 64-bit addresses 2021-07-18 17:31:13 +02:00
Gunnar Beutner
3ed29895e4 readelf: Add names for x86_64 relocations and machine type 2021-07-18 17:31:13 +02:00
Gunnar Beutner
294b918e9b Kernel: Ignore KUBSAN symbols in the kernel symbol map 2021-07-18 17:31:13 +02:00
Sahan Fernando
2845c6753e Kernel: Clean up VirtIOGPU class interfaces 2021-07-18 19:58:17 +04:30
Sahan Fernando
d9330c42fa Kernel: Replace VirtIOGPU reinterpret casts with AK::BinaryBufferWriter 2021-07-18 19:58:17 +04:30
Sahan Fernando
217415226e AK: Add helper type for serializing structures into buffer 2021-07-18 19:58:17 +04:30
Sahan Fernando
04226f0c0a Kernel: Improve debug prints for VirtIOGPU device config events 2021-07-18 19:58:17 +04:30
Sahan Fernando
4dddc56ad9 Kernel: Rename VirtIOGPU/VirtIOGPU.cpp to VirtIOGPU/GPU.cpp 2021-07-18 19:58:17 +04:30
Sahan Fernando
1c77f80676 Kernel: Put VirtIOGPU related types into a namespace 2021-07-18 19:58:17 +04:30
Timothy
215f383b12 LibFileSystemAccessClient: Use WindowServer window stealing interface 2021-07-18 17:21:28 +02:00
Timothy
9e04ab936f WindowServer: Let clients mark windows as stealable by specific clients
This implements window stealing in WindowServer, which allows clients
to mark a window they own as 'stealable' by another client. Indicating
that the other client may use it for any purpose.

This also updates set_window_parent_from_id so that the client must
first mark its window as stealable before allowing other clients to
use it as a parent.
2021-07-18 17:21:28 +02:00
Timothy
f5e0475bdf FileSystemAccessServer: Add expose_window_server_client_id()
This will expose the client id of the WindowServerConnection this
instance of FileSystemAccessServer is using.
2021-07-18 17:21:28 +02:00
Timothy
38594dde79 FileSystemAccessServer+TextEditor: Implement cross-process modal prompts
This transitions from synchronous IPC calls to asynchronous IPC calls
provided through a synchronous interface in LibFileSystemAccessClient
which allows the parent Application to stay responsive.

It achieves this with Promise which is pumping the Application event
loop while waiting for the Dialog to respond with the user's action.

LibFileSystemAccessClient provides a lazy singleton which also ensures
that FileSystemAccessServer is running in the event of a crash.

This also transitions TextEditor into using LibFileSystemAccessClient.
2021-07-18 17:21:28 +02:00
Gunnar Beutner
ab353fd4e1 LibIPC: Close the socket and die when the peer is closed
This will close the socket when the recv() returns 0 indicating that
the peer has shutdown, and when there are no pending bytes to be
processed.
2021-07-18 17:21:28 +02:00
Gunnar Beutner
e331ef7057 LibIPC: Add Connection::is_open()
This will allow clients to see if the IPC socket is still open.
2021-07-18 17:21:28 +02:00
Timothy
b77b631571 WindowServer: Add WindowServer::get_window_rect_from_client()
This allows a client to get the rect of a window in another client.
2021-07-18 17:21:28 +02:00
Timothy
88e6d18a61 WindowServer: Add WindowServer::async_set_window_parent_from_client()
This allows a client to set the parent for one of its local windows
where the parent window is in another client.
2021-07-18 17:21:28 +02:00
Timothy
522f6775a7 LibGUI+WindowServer: Expose WindowServer client id to the client
This allows an WindowServer client to identify itself and allow future
cross-client functionality in WindowServer.
2021-07-18 17:21:28 +02:00
Andreas Kling
7791f7b9e6 Kernel/TmpFS: Remove some unnecessary includes 2021-07-18 14:29:27 +02:00
Andreas Kling
61e17ed590 Kernel/TmpFS: Use IntrusiveList and KString for OOM safety
This patch moves TmpFS to using OOM-safe data types for storing
directory children.
2021-07-18 14:29:27 +02:00
Peter Bindels
b748f11f2d Tests: Disable test if platform has no UserspaceEmulator
Disable test for component with same check that component itself has.
2021-07-18 12:49:33 +01:00
Peter Bindels
d4113f6028 LibJS: Correct test to work with our strtod on x86_64 & Clang
Modify constant to be half a ULP lower so our strtod also parses it
correctly. Needs to have issue associated for actually fully fixing
strtod to be correct, rather than correct-enough.
2021-07-18 12:45:10 +01:00
Peter Bindels
0a0089fc11 LibC strtod: Reduce incremental error to nearly nothing
Instead of scaling by 1/10th N times, scale 10^N and then divide by
that. Avoid doing this beyond double-infinity. This decreases the
progressive error for numbers outside of integer range immensely. Not
a full 100% fix; there is still a single ULP difference detected by a
Javascript test
2021-07-18 12:45:10 +01:00
Maurice Hieronymus
a205633643 HackStudio: Prevent crash when stepping through a program
The backtrace view expects that there is always a valid selection. This
is not true when we execute a step in the debugger. Therefore we need
to check if we have a valid selection in the on_selection_change
handler.
2021-07-18 13:13:31 +02:00
Tom
ae8472f9ca Kernel: Fix blocking relock of the big_lock while unlocking other Lock
When a Thread is being unblocked and we need to re-lock the process
big_lock and re-locking blocks again, then we may end up in
Thread::block again while still servicing the original lock's
Thread::block. So permit recursion as long as it's only the big_lock
that we block on again.

Fixes #8822
2021-07-18 13:08:51 +02:00
Timothy Flynn
06ddfcde89 AK: Allow setting both width and precision when formatting a string 2021-07-18 02:57:49 +02:00