Commit graph

24236 commits

Author SHA1 Message Date
Brian Gianforcaro
9201a06027 Kernel: Annotate all syscalls with VERIFY_PROCESS_BIG_LOCK_ACQUIRED
Before we start disabling acquisition of the big process lock for
specific syscalls, make sure to document and assert that all the
lock is held during all syscalls.
2021-07-20 03:21:14 +02:00
Brian Gianforcaro
120b9bc05b Kernel: Conditionally acquire the big lock based on syscall metadata 2021-07-20 03:21:14 +02:00
Brian Gianforcaro
bb1fa019de Kernel: Allow MutexLocker to be conditionally initialized
There are cases where we want to conditionally take a lock, but still
would like to use an RAII type to make sure we don't leak the lock.

This was previously impossible to do with `MutexLocker` due to it's
design. This commit tweaks the design to allow the object to be
initialized to an "empty" state without a lock associated, so it does
nothing, and then later a lock can be "attached" to the locker.

I realized that the get_lock() API's where also unused, and would no
longer make sense for empty locks, so they were removed.
2021-07-20 03:21:14 +02:00
Brian Gianforcaro
354e18a5a0 Kernel: Move validate_syscall_preconditions outside of the big lock
Now that we hold the space lock for the duration of the validation
it should be safe to move the validation outside the big lock.
2021-07-20 03:21:14 +02:00
Brian Gianforcaro
85e95105c6 Kernel: Mark read only RegisterState function parameters as const 2021-07-20 03:21:14 +02:00
Brian Gianforcaro
27e1120dff Kernel: Move syscall precondition validates to MM
Move these to MM to simplify the flow of the syscall handler.

While here, also make sure we hold the process space lock for
the duration of the validation to avoid potential issues where
another thread attempts to modify the process space during the
validation. This will allow us to move the validation out of the
big process lock scope in a future change.

Additionally utilize the new no_lock variants of functions to avoid
unnecessary recursive process space spinlock acquisitions.
2021-07-20 03:21:14 +02:00
Brian Gianforcaro
af543328ea Kernel: Instrument syscalls with their process big lock requirements
Currently all syscalls run under the Process:m_big_lock, which is an
obvious bottleneck. Long term we would like to remove the big lock and
replace it with the required fine grained locking.

To facilitate this goal we need a way of gradually decomposing the big
lock into the all of the required fine grained locks. This commit
introduces instrumentation to the syscall table, allowing the big lock
requirement to be toggled on/off per syscall.

Eventually when we are finished, no syscall will required the big lock,
and we'll be able to remove all of this instrumentation.
2021-07-20 03:21:14 +02:00
Brian Gianforcaro
308396bca1 Kernel: No lock validate_user_stack variant, switch to Space as argument
The entire process is not needed, just require the user to pass in the
Space. Also provide no_lock variant to use when you already have the
VM/Space lock acquired, to avoid unnecessary recursive spinlock
acquisitions.
2021-07-20 03:21:14 +02:00
Andreas Kling
59b6169b51 Taskbar: Update the start button width when system fonts change 2021-07-20 02:48:29 +02:00
Andreas Kling
f5e914fb9f LibTTF+LibGfx: Make Gfx::Font::bold_variant() work for TTF fonts
There's no need for this to be a virtual, it's just a font database
lookup and can be done in the Font base class.
2021-07-20 02:48:29 +02:00
Andreas Kling
9f601fcbcf LibTTF+LibGfx: Improve vertical alignment of glyphs
Before this patch, some glyphs had a weird off-by-1 vertical position
which looked really jarring at small font sizes.

This was caused by glyph bitmaps having different heights from each
other. (Each glyph bitmap was minimally sized to fit only the glyph
itself, and then vertically positioned during the paint phase.
Since this vertical positioning was integer based, subpixel precision
was lost and things ended up looking wonky.)

Fix this by making all glyph bitmaps be the same height so we can blit
them at the same integer y position. We use the typographic ascent from
the OS/2 table to transform the glyph coordinates.

The end result is a huge improvement visually. :^)
2021-07-20 02:48:29 +02:00
Andreas Kling
e984200206 LibTTF: Parse OS/2 tables
The OS/2 table contains nice typographic ascent/descent information.
2021-07-20 02:48:29 +02:00
Andreas Kling
3b1e05f714 LibTTF: Don't choke on fonts with CompositeGlyfFlags::UseMyMetrics
This was preventing us from loading JetBrains Mono Regular with LibTTF.
2021-07-20 02:48:29 +02:00
Andreas Kling
808f1f63ff LibTTF: Minor const correctness fix in TTF rasterizer 2021-07-20 02:48:29 +02:00
Andreas Kling
d8f435fa50 LibTTF: Propagate glyph bitmap allocation failure in rasterizer 2021-07-20 02:48:28 +02:00
Andreas Kling
7b3a4f8281 LibTTF: Rename "raster" => "rasterize" 2021-07-20 02:48:28 +02:00
Andreas Kling
8070bbd442 LibTTF: Convert code to east-const style 2021-07-20 02:48:28 +02:00
Linus Groh
84efed502a Ports: Add a launcher for Python
We're even downloading an additional older icon from the git repo
instead of using their current ones for accurate look and feel :^)
2021-07-20 00:58:26 +01:00
Linus Groh
b8cd6ae02e Ports: Use "launcher_run_in_terminal=true" instead of "Terminal -e ..." 2021-07-20 00:58:26 +01:00
Linus Groh
6b9e0d98d9 Ports: Add launcher_run_in_terminal package.sh variable
This is being used to generate the RunInTerminal entry in launcher app
files.
2021-07-20 00:58:26 +01:00
Linus Groh
37cc110003 Taskbar: Launch apps in Terminal when RunInTerminal=true is specified
This feels a bit awkward right now, and needs code duplication - I think
adding a mechanism to the AppFile class to run the executable would be
neat, especially if we add an arguments field to app files - but this
will do for now.
2021-07-20 00:58:26 +01:00
Linus Groh
4983a972b0 LibDesktop: Add a RunInTerminal boolean field to app files
This is common enough to warrant its own setting by now - but it's also
partially a workaround. Since app files currently only support a single
executable path with no arguments, we resort to generating wrapper
scripts for port launchers with arguments - and then the executable is
that shell script. We also moved from manually specifying icon files to
embedding them in executables. As shell scripts can't have icons
embedded in them, a different solution is needed - this one solves the
common case of running a CLI program in a terminal, and still allows
embedding of icons in the executable itself as no shell script is
needed, meaning it will be shown in the taskbar and system menu.

The second use case of actually passing arguments to the executable
itself (and not just "Terminal -e ...") is not covered by this and still
requires an external script (meaning no icon for now), but I think that
can easily be solved by adding something like an "Arguments" field to
app files. :^)
2021-07-20 00:58:26 +01:00
roepfeli
f44f7927a8 Help: Add check for pushing current page to history 2021-07-20 01:54:36 +02:00
Karol Kosek
fd5bc36fc1 Pong: Disable resizing the window
The game doesn't handle resize events.

It's a pretty lazy fix.  The proper way would be to actually allow
the game to be resized, with some scaling trickery, but most games
here don't do that anyway, so I guess that's good enough.
2021-07-20 01:51:11 +02:00
Gunnar Beutner
69fd68b1c8 Prekernel: Make sure we're not overwriting the ELF header
This copies the ELF header because we might end up overwriting when
loading the ELF sections.
2021-07-20 01:50:55 +02:00
Brian Gianforcaro
06468d9794 Revert "Profiler: Configure the TimelineContainer to be shrink to fit"
This reverts commit cfef3040fb.

It looks like although this does improve things, it also degrades the
experience and messes with the usability, especially for large amounts
of processes.

Need to come back to this with a more holistic fix.
2021-07-19 23:09:28 +04:30
Peter Elliott
01248d28ef Applets: Add DesktopPicker applet
This applet displays a grid of desktops, and shows the user what virtual
desktop they are on. When clicked, the desktop will be changed.
2021-07-19 18:21:40 +02:00
Peter Elliott
2b37fad60b WindowServer: Add set_virtual_dekstop WindowManager message
Users can specify the row and column of the virtual desktop, and
WindowServer will animate to it.
2021-07-19 18:21:40 +02:00
Peter Elliott
b8f3441300 LibGUI: Add callback for screen rect change to Desktop.h
callbacks for screen rect changes can be added with
on_receive_screen_rects()
2021-07-19 18:21:40 +02:00
ls
222b97488a VirtualFileSystem: Check for '.' '..' and empty filenames
This commit adds a check, to prevent empty dot or dot-dot filenames when
renaming a file and returns EINVAL in that case.
2021-07-19 18:20:34 +02:00
ls
fe7bacc2df File Manager: Differentiate between navigation and rename errors
Adds a new on_rename_error handler and renames the old on_error handler
to on_directory_change_error in FileSystemModel. The on_rename_error
handler creates a MessageDialog with the error message.
2021-07-19 18:20:34 +02:00
LuK1337
35b930112f Assistant: Trim terminal command before displaying or running it 2021-07-19 17:49:14 +02:00
Itamar
941087ee25 LibGUI: Call did_update() from AutocompleteSuggestionModel::update()
This fixes an issue where the column widths of the AutocompleteBox did
not properly update after update_suggestions() was called.
2021-07-19 17:48:05 +02:00
Itamar
4a7be3f81c LibGUI: Remove column width limitation in AutocompleteProvider 2021-07-19 17:48:05 +02:00
Gunnar Beutner
3678f78bfb Prekernel: Make sure the last few bytes of the kernel image are mapped
Depending on the exact layout of the .ksyms section the kernel would
fail to boot because the kernel_load_end variable didn't account for the
section's size.
2021-07-19 17:47:54 +02:00
Kenneth Myhra
157fccfe7b Ports/dosbox-staging: Change 'serenity*' build target to '*serenity*'
The serenity build target in config.sub did not match
'i686-pc-serenity'. This commit changes the build target from
'serenity*' to '*serenity*'.
2021-07-19 16:59:56 +02:00
Kenneth Myhra
777e103908 Ports: Bump libarchive from version 3.4.0 to 3.5.1 2021-07-19 16:24:15 +02:00
Kenneth Myhra
afb47d1741 LibC: Add stub for iswprint
Without the declaration of iswprint libarchive will not compile.
2021-07-19 16:24:15 +02:00
Marcus Nilsson
bab83ecc95 LibGUI: Tighten invalidation rect for TabWidget
Previously the whole bar was repainted, there's no need to invalidate
past the last tab button.
2021-07-19 16:24:06 +02:00
Marcus Nilsson
b57f7def1f LibGUI: Don't invalidate scrollbar rect if disabled
No need to repaint if it's not scrollable, this saves a tiny bit of
repaint :)
2021-07-19 16:24:06 +02:00
Tobias Christiansen
0229663102 Base: Add a test page for the 'justify-content' CSS property
This adds a simple page to showcase the justify-content CSS-property.
2021-07-19 18:47:09 +04:30
Tobias Christiansen
439d955471 LibWeb: Implement justify-content for the FlexFormattingContext
This patch implements the algorithm for placing flex-items on a line
according to the specified justify-content property.
2021-07-19 18:47:09 +04:30
Tobias Christiansen
80a44c3891 LibWeb: Add parsing for the justify-content property 2021-07-19 18:47:09 +04:30
LuK1337
fb66feef5e Base: Add file associations for multiple programs
This change adds missing file association for the following programs:
 - ImageViewer
 - PDFViewer
 - PixelPaint
 - Playground
 - Profiler
 - SoundPlayer
2021-07-19 17:42:14 +04:30
Hendiadyoin1
ed46d52252 Everywhere: Use AK/Math.h if applicable
AK's version should see better inlining behaviors, than the LibM one.
We avoid mixed usage for now though.

Also clean up some stale math includes and improper floatingpoint usage.
2021-07-19 16:34:21 +04:30
Hendiadyoin1
c5f6ba6e71 AK: Introduce Math.h
This is to implement constexpr template based implementations for
mathematical functions

This also changes math.cpp to use these implementations.

Also adds a fastpath for floating point trucation for values smaller
than the signed 64 bit limit.
2021-07-19 16:34:21 +04:30
Gunnar Beutner
675de847f7 Kernel: Remove obsolete code 2021-07-19 11:29:09 +02:00
Gunnar Beutner
b6ddb4b70f Kernel: Simplify the linker script for the prekernel 2021-07-19 11:29:09 +02:00
Gunnar Beutner
a364f5c7b7 Kernel: Make sure super pages are in the first 16MiB of physical memory
This was broken by recent changes.
2021-07-19 11:29:09 +02:00
Gunnar Beutner
e01cc39eed SoundPlayer: Fix a spelling mistake in a variable name 2021-07-19 11:27:58 +02:00