Commit Graph
66647 Commits
Author SHA1 Message Date
Sönke Holz 9dfffd8e0e Meta: Update the year range in LICENSE to 2018-2026 :^) 2026-01-25 21:47:42 +01:00
Sönke Holz 59631ca593 Ports: Don't display git commit info in VVVVVV
We build the port from a tarball, so it will incorrectly use
SerenityOS's git commit hash.
2026-01-25 21:46:20 +01:00
Sönke Holz a748ee34ef Ports: Update VVVVVV to 2.4.3 2026-01-25 21:46:20 +01:00
Sönke Holz c716a30bb2 Ports: Update libmpg123 to 1.33.4
The old version doesn't build with `-std=c23`.
2026-01-25 21:46:20 +01:00
Sönke Holz af754c8485 Ports: Add FAudio 2026-01-25 21:46:20 +01:00
Sönke Holz 8d7e5189e8 Ports: Update libphysfs to 3.2.0 2026-01-25 21:46:20 +01:00
Sönke Holz 3c0eb10f09 Ports: Make libphysfs build again 2026-01-25 21:46:20 +01:00
Sönke Holz f352fd8a65 Ports: Build timidity with -std=c17
C23 removed support for incomplete function prototypes.
2026-01-25 21:46:20 +01:00
Sönke Holz b5e39f5940 Ports: Add tinyxml2 2026-01-25 21:46:20 +01:00
NoobZang 1e69af3b17 top: Fix refresh hangs by correctly configuring non-blocking TTY
Setting O_NONBLOCK via fcntl is not sufficient for TTYs in
non-canonical mode. A subsequent tcsetattr call would override this,
as the default VMIN and VTIME settings cause the driver to block.

Explicitly set VMIN and VTIME to 0 to ensure a true non-blocking read.

Also, apply these TTY settings to STDIN_FILENO instead of STDOUT_FILENO.
This is semantically more correct as we are configuring input behavior.

Fixes #26166.
2026-01-23 21:05:33 +01:00
dependabot[bot] 1931552916 CI: Bump JamesIves/github-pages-deploy-action from 4.7.6 to 4.8.0
Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.7.6 to 4.8.0.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.7.6...v4.8.0)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-version: 4.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-01-23 21:00:40 +01:00
implicitfield ef2fe6e73e Tests: Add a test verifying that ptrace self-attaching fails 2026-01-23 20:50:47 +01:00
implicitfield 6115bd476d Kernel: Don't allow ptracing other threads in the same process
Doing that will currently result in an unkillable process. Simply
disallowing this shouldn't cause any real incompatibilities since Linux
doesn't allow attaching to threads in the same thread group either.
2026-01-23 20:50:47 +01:00
implicitfield f8fda08dd1 Kernel: Don't dispatch signals to threads that are marked to die 2026-01-23 20:50:47 +01:00
Nico Weber b170e163b7 AK+Kernel: Remove AK_COMPILER_APPLE_CLANG workarounds
Xcode's clang is now new enough to no longer need these.
2026-01-23 20:50:13 +01:00
Serosh-commits c70201cdbe LibVT: Fix CNL row/column mixup 2026-01-23 07:43:17 -05:00
Nico Weber eaa713e22f Meta: Add a PR to lb-cherry-picks.py 2026-01-22 19:55:50 -05:00
Andreas Kling 64eff8f658 LibCore: Fix memory leak in anon_create() on BSD/macOS
The mmap() call here served no purpose - anon_create() is only meant to
create and return a file descriptor. The actual mapping is done later
by AnonymousBufferImpl::create().

This leaked an mmap of `size` bytes for every AnonymousBuffer created,
which includes backing stores, shareable bitmaps, and more.

(cherry picked from commit 07630f3b0c4e08771a75edcc68ab3fdbc8948b2f)
2026-01-22 19:55:50 -05:00
Nico Weber 1961d12f5b Meta+Toolchain+Ports: Update CMake to 3.30.0, set it as minimum version
CMake learned which gcc flag to translate `set(CMAKE_CXX_STANDARD 26)`
to in CMake 3.30.0:
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9434

Using earlier versions leads to

    ...requires the language dialect "CXX26" .  But the
    current compiler "GCC" does not support this, or CMake does not know
    the flags to enable it.

errors after #26524.
2026-01-22 16:19:29 -05:00
Nico Weber ab5061a92b Toolchain: Make BuildCMake.sh do clean builds
Without this, when I updated CMake and then ran this script, it failed
right after the bootstrap phase with:

    loading initial cache file /Users/thakis/src/serenity/Toolchain/
        Build/cmake/Bootstrap.cmk/InitialCacheFlags.cmake
    CMake Error: The source "/Users/thakis/src/serenity/Toolchain/
        Tarballs/cmake-3.30.0/CMakeLists.txt" does not match the source
        "/Users/thakis/src/serenity/Toolchain/Tarballs/cmake-3.25.1/
        CMakeLists.txt" used to generate cache.  Re-run cmake with a
        different source directory.
    ---------------------------------------------
    Error when bootstrapping CMake:
    Problem while running initial CMake
    ---------------------------------------------

Forcing a clean build dir resolves this.
2026-01-22 16:19:29 -05:00
Sönke Holz c808a2c2a3 Tests: Add a test verifying that simultaneous page faults work correctly 2026-01-22 12:47:45 +01:00
Sönke Holz dac08384a0 Kernel/MM: Handle concurrent page faults properly in handle_fault()
Not being able to find a reason for a page fault doesn't necessarily
mean that it's a bug. As page faults can happen concurrently (even
without SMP), one thread can already be done handling to a page, while
another thread took a longer time to start handling a page fault to
the same page. In this situation, the second thread won't find a reason
for the page fault, therefore it would previously crash.

To clarify this problem, here a problematic example situation:
On a SMP system, two threads A and B are causing a page fault to the
exact same page at exactly the same time. Thread A enters the page fault
handler, but immediately gets an interrupt after we enable interrupts
again. This interrupt takes quite a long time to handle. Thread B on the
hand immediately enters the page fault handler immediately and handles
the page fault successfully before thread A even entered the page fault
handler. Now thread A finished handling its interrupt and enters the
page fault handler as well, but it can't find a reason for it, so it
crashes.
We can't prevent this situation with spinlocks, since when page faults
happen is not under our control. Therefore the page fault handler needs
to be able to handle situations where the reason for the page fault is
already gone.

Since not being able to find a reason for the page fault can still also
mean that we have a bug in the page fault handler, add some extra
assertions checking if an address translation with the associated page
table entry would still fail. If it would, then this is a kernel bug
and we should panic.
2026-01-22 12:47:45 +01:00
Sönke Holz 15ada92d93 Kernel/MM: Handle concurrent page faults properly in handle_cow_fault()
Similar to the last commit, two page faults to the same page can happen
concurrently, so we need to be able to handle this properly.

Previously, we only held the VMObject's lock in
AnonymousVMObject::handle_cow_fault. But as explained in the previous
commit this isn't enough. We need to keep holding the lock until the
page is remapped.

Additionally, this commit makes handle_cow_fault() take a global lock
to make concurrent page faults to the same page from different processes
work correctly.
This global lock is unfortunately necessary since fork() clones all
VMObjects, so taking its lock won't prevent another process from
handling a page fault to the same physical pages. See the FIXME comment
for details.

There might be a better way to fix this, but this fix should still be
better than potentially panicking when concurrent COW faults occur.
2026-01-22 12:47:45 +01:00
Sönke Holz 577bc7ef95 Kernel/MM: Handle concurrent page faults properly in handle_zero_fault()
This essentially reverts 5ada38f9c3.

Previously, two threads could end up trying to allocate a committed
page at once, possibly resulting in a panic because we tried to
allocate more pages than committed.

Another problem was that a thread could incorrectly think that the page
fault was already handled. This can happen if the thread handling the
page fault already set the physical page slot to the newly allocated
page, but didn't remap the page yet. We check if a page fault was
already processed based on the physical page slot contents.
This issue is not causing problems currently, since thinking a page
fault was already handled and incorrectly returning will still work
eventually when the other thread is done remapping the page.
However, a future commit will add extra assertions checking that page
faults were already handled appropriately if we couldn't find a reason
for the fault. These assertions would trip on this.

Prevent these issues by taking the lock for a longer amount of time.
There might be a better solution to this, but that would likely require
more complex code changes.

Also modify the code in handle_fault() a bit to avoid using should_cow()
for zero faults. The checks in should_cow() can refer to a different
physical page if the page fault was handled immediately after the check.
2026-01-22 12:47:45 +01:00
Sönke Holz 90dc4b1dd8 Kernel/aarch64: Implement PageTableEntry::is_execute_disabled() 2026-01-22 12:47:45 +01:00
Sönke Holz 2687552d0e Kernel/riscv64: Implement all PageTableEntry functions 2026-01-22 12:47:45 +01:00
Sönke Holz 01d705cabe Kernel/x86: Correctly set/retrieve the page base in PageDirectory.h
The old calculations incorrectly included the execute-disable bit, the
protection key and the top ignored bits.
2026-01-22 12:47:45 +01:00
Sönke Holz 23de6e93bd Kernel/MM: Unify the non-RISC-V and RISC-V page fault handler
Instead of having to maintain two different page fault handler
implementations, let's unify the two by using the more generic RISC-V
implementation.
The RISC-V implementation doesn't depend on the processor providing the
reason why a page fault occured.

We don't need to know whether it's a NotPresent or ProtectionViolation
fault to handle it correctly, as we already have enough metadata.
2026-01-22 12:47:45 +01:00
Sönke Holz 76b1277f81 Kernel/MM: Always print the faulting address in the page fault handler
Only some dbgln()s were previously not printing fault.vaddr().
2026-01-22 12:47:45 +01:00
Sönke Holz 0759eefaed Kernel/MM: Make RISC-V page fault implementation checks exhaustive
This causes us to print a more useful error message than "Unexpected
page fault".
Additionally, this change will be necessary in a future commit, which
expects us to handle all reasons for page faults exhaustively.
2026-01-22 12:47:45 +01:00
Sönke Holz e5f671a71c Kernel/riscv64: Set the access mode to Read for instruction page faults
This matches the x86-64 and AArch64 behavior.

This required moving the is_instruction_fetch() check before the
is_read() check, since is_read() is now also true for instruction fetch
page faults.
2026-01-22 12:47:45 +01:00
Sönke Holz dcca347b0b Kernel/MM: Rename handle_{dirty_on => inode}_write_fault
... and always use it for inode write faults.

In the RISC-V page fault implementation, we previously only used this
function if `should_dirty_on_write()` returned true. If it didn't, we'd
use `handle_inode_fault()`. But this shouldn't be necessary, since
`handle_dirty_on_write_fault()` already handles cases where the page
isn't mapped yet.

This should now also cause a page to be immediately marked as dirty
if the first access to it was a write. Previously, this should have
caused two page faults: one for loading the inode page and one for
making it dirty.
2026-01-22 12:47:45 +01:00
Sönke Holz 2a2df29687 Kernel/MM: Remove unreachable code from Region::handle_fault()
This code in the x86-64 and AArch64 page fault handler should be
unreachable, since Region::map_individual_page_impl() always maps all
non-null physical pages, therefore we should never get a PageNotPresent
fault if the page slot is set to a non-null value.

Lazy committed pages are implemented by mapping them read-only, so a
write access to them will result in a ProtectionViolation fault, which
will call very similar code in Region::handle_zero_fault().

Similarly in the RISC-V version, we already handle lazy committed page
faults by calling Region::handle_zero_fault() a couple lines earlier
if the page fault was generated by a write access and the region is
writable.
2026-01-22 12:47:45 +01:00
Fırat Kızılboğa 4b7fea59ba Run: Use user's preferred shell for command execution
Previously, the Run application would always execute commands using
/bin/Shell, ignoring the user's configuration.

This change retrieves the current user's preferred shell via
Core::Account. If the preferred shell cannot be determined or does
not exist on the filesystem, it falls back to /bin/Shell.

A warning message is displayed if the configured shell is missing
to inform the user of the fallback.
2026-01-22 10:48:51 +01:00
Nico Weber d064d59791 Meta: Add matroska to lagom 2026-01-22 08:09:40 +01:00
Fırat Kızılboğa 67a0d6eae6 Browser: Share Find in Page search term across tabs
This adds a global search term stored in BrowserWindow that is shared
across all tabs. When opening Find in Page (Ctrl+F), the widget now
uses the following priority logic:

1. If there's text selected on the page, use that
2. If the search box is empty, use the global search term
3. Otherwise, keep the existing text

To imitatates Chromium's logic, the global search term is updated
whenever the user types, navigates matches, or when a selection
populates the search box.
2026-01-21 22:38:20 -05:00
Fırat Kızılboğa a2d32d03c1 Browser: Add find-in-page widget
This adds a FindInPageWidget to the Browser application, allowing users
to search for text within the current tab.

Features:
- Search textbox with real-time search as you type
- Previous/Next buttons with up/down arrow icons
- Match Case checkbox to toggle case sensitivity
- Result label showing "X of Y matches" or "Phrase not found"
- Close button to hide the widget

Keyboard shortcuts:
- Ctrl+F: Open find-in-page widget
- Enter: Jump to next match
- Shift+Enter: Jump to previous match
- Escape: Close the widget

The widget integrates with LibWebView's existing find_in_page,
find_in_page_next_match, and find_in_page_previous_match APIs.
2026-01-21 22:38:20 -05:00
Luka Rajic 0d10aec897 Kernel: Clear stopped state when a process dies
This patch clears the stopped state in Process::die() while holding the
scheduler lock, ensuring that threads can be correctly resumed to clean
up their kernel stacks before exiting.
2026-01-20 21:28:13 +01:00
Mohd Zaid 3bf28c74f6 Demo/CatDog: Dynamically position connector for advice window
Previously, the advice window used a connector at a fixed absolute
position at the middle of the bubble. This resulted in visual
disconnection as there was no logic to check if the advice bubble
was currently positioned above or below CatDog.

Changes:
- Implemented dynamic calculation for the connector's starting point.
- Added logic to detect the relative vertical position of the advice
  bubble compared to the CatDog character.
- Updated the drawing routine to flip or adjust the connector
  direction based on that relative position.

This patch ensures the connector remains visually in sync with
CatDog's position, providing a cohesive UI regardless of where the
advice window is rendered.
2026-01-19 10:05:20 +01:00
Mohd Zaid f77e12ea34 Demo/CatDog: Ensure advice window stays within screen bounds
After identifying that `advice_window` gets clipped on either axis, and
sometimes rendered completely out of screen itself. This issue was due
to lack of screen-bounds checks before positioning window.

Changes:
- Added notion of minimum_required_margin so that window doesnt stick to
edges.
- Added bounds check for advice_window_x and clamp within bounds.
- Added bounds check for advice_window_y and move window below catdog if
no space is present above.

This brings advice-window within rendered part of screen.
2026-01-19 10:05:20 +01:00
Serosh-commits 5096e2948c LibVT: Clamp repeat count in REP sequence
This prevents an out-of-bounds column access when the repeat count
exceeds the remaining columns on the line.

Fixes #26533
2026-01-18 15:38:39 -05:00
Lucas CHOLLET 7ab4fc1fff Meta: Prefer sudo's --preserve-env over -E
The `-E` option is not supported by `sudo-rs` so give it the list of all
our environment variables.

Fix building on Ubuntu 25.10.
2026-01-18 15:33:24 -05:00
yabobay 1603da285f Base: Add Unicode block “Block Elements” to Csilla 2026-01-18 15:29:21 -05:00
Ali Mohammad Pur ff75e05bbd LibLine: Write history file atomically
It's possible to end up with a garbled history file if two or more users
try to write the history out at once if we don't write the file
atomically.
2026-01-17 23:02:57 +01:00
Sönke Holz 3529f7528f Kernel/aarch64: Add GICv3 and GICv4 support
This can be tested in QEMU with
SERENITY_EXTRA_QEMU_ARGS='-M gic-version=3'
2026-01-15 17:58:20 +01:00
Sönke Holz 7729a6b505 Kernel/aarch64: Add GICv3 CPU interface register definitions
These definitions will be used by the GICv3/GICv4 driver introduced in
the next commit.
2026-01-15 17:58:20 +01:00
Sönke Holz ad60de702e LibDeviceTree: Add Node::get_{u32,u64}_property()
This allows you to more easily implement fallback values with
`device.node().get_u32_property("foo"sv).value_or(0)`.
2026-01-15 17:58:20 +01:00
Sönke Holz 0b43aec114 Kernel/aarch64: Rename GIC => GICv2
The next commit will add GICv3 support in a separate class.
Supporting both versions in one class is not feasible.
2026-01-15 17:58:20 +01:00
Sönke Holz 45cda8ae74 Kernel/aarch64: Remove CPUFeature::GICv*
Support for FEAT_GICv3* and FEAT_GICv4* can't be detected with system
registers. Before, these CPUFeature flags were confusingly never set.
2026-01-15 17:58:20 +01:00
Sönke Holz a34128cba1 Kernel/aarch64: Add wrappers for the ISB, DMB, and DSB instructions 2026-01-15 17:58:20 +01:00