Commit Graph
68741 Commits
Author SHA1 Message Date
Augustin Cavalier b10415b7cc kernel/fs: Update comments in EntryCache.
Make the concurrency model slightly clearer.
2026-03-26 14:08:57 -04:00
Augustin Cavalier acde38ead3 freebsd_network: Update comment in kernel_malloc.
bus_dmamem_alloc doesn't need this behavior anymore.
2026-03-26 14:01:54 -04:00
Augustin Cavalier eb097f749b kernel/slab: Use (1 << x) to define cache flag bits.
No functional change intended.
2026-03-26 12:26:22 -04:00
Augustin Cavalier bb1c367a6d kqueue: Add a no-op EV_ENABLE definition.
EV_ADD implies ENABLE, so this isn't needed, but a lot of applications
try to specify it anyway. So this extends source compatibility.

If in the future we ever implement EV_DISABLE, we can just add a
real definition for it then, and since ADD implies ENABLE existing
applications shouldn't break.
2026-03-26 12:25:41 -04:00
Augustin Cavalier 5ac1c21e5f kernel/vm: Set the memory type on cloned device cache areas.
If the source area is now mapped write-combining, so will the
target area.

May fix some problems or slowness that occurred after the
framebuffers refactor commits.
2026-03-25 12:50:57 -04:00
Leo Rouleau 787ff471d3 Devices: Implement Order by Bus sorting feature
Adds a new sorting mode to the Devices app to allow users to view the
hardware tree sorted by bus connections.

Resolves the TODO: Implement BY_BUS in DevicesView.cpp

Changes:
- Added ORDER_BY_BUS state and kMsgOrderBus constant
- Added Bus option to the orderByPopupMenu
- Implemented alogrithm in RebuildDevicesOutline() to group devices under their CAT_BUS parent
- Added kMsgOrderBus in DevicesApplication to ensure it updates when
  selected

Change-Id: I266333e1ced25d231d73a0850e6a8ff3155084c4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10481
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2026-03-25 12:33:28 +00:00
Augustin Cavalier 7240f3762f kernel: Add mechanism to replace specific object caches with the guarded heap.
This allows the guarded heap to be used in a much more targeted way,
if it's suspected specific object_caches have problems.

Enabled by default for KDEBUG. The new safemode/kernel option is
"guarded_heap_for_object_caches". This accepts a comma-separated
list of quoted strings, optionally with * at beginning and/or end
(but not middle.) Examples:

mbufs*   # matches caches starting with "mbufs"
*jumbo9*	# matches caches containing "jumbo9"
"*jumbo9 chunks","mbufs*" # matches caches ending with "jumbo9 chunks"
                          # or starting with "mbufs"

This should help with diagnosing #19973, among others, without needing
to compile custom versions of drivers or anything like that.

Unfortunately it is not possible to use this mechanism to selectively
replace parts of the slab malloc. The slab malloc free() relies on
the MemoryManager to figure out what cache an object belongs to, which
doesn't work if objects of some size classes aren't known to the
MemoryManager at all.
2026-03-24 18:10:10 -04:00
John Davis 76df196f25 hyperv: Fix VMBus receive buffer signaling
Hyper-V needs to be notified when VMBus receive buffer has enough
space for devices supporting this functionality.

Change-Id: Ib2bb0d65bbd8c402d1c73e9cad83d00d644dcf2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10566
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-24 17:18:15 +00:00
shivamsinghydv 6e52ff1941 bluetooth: Before activation of a local device in UI, verify that it has a valid address.
Change-Id: I516d71312ed269d75fa9ae81e05cabfa41f264fa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10568
Reviewed-by: waddlesplash <[email protected]>
2026-03-24 14:44:40 +00:00
X512 0a40b3a1ce BPicture: fix subpicture token storage
Picture token written for `BView::DrawPicture` and
`BView::ClipTo[Inverse]Picture` should be zero-based index in
subpictures array, not global app_server BPicture token.

Part of #1133.

Change-Id: I2a544aefb343650e8bad58c5d297f7b9d5d1dbb5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10575
Reviewed-by: waddlesplash <[email protected]>
2026-03-24 14:33:50 +00:00
Augustin Cavalier 90ac9e6538 kernel/vm: Overhaul swap cache commitments.
Before this commit, swap space was committed entirely orthogonally
from memory commitments. This was not handled at all correctly
when cutting areas (the area cutting logic tries to migrate commitments
between caches, but in the case of swapping caches, it didn't,
and couldn't, take the separate fCommittedSwapSize into account.)

Even without that problem, totally separate swap and memory commitments
caused other problems. For instance, suppose a setup with 4GB of RAM
and 4GB of swap. Many caches are created, and all 4GB of swap gets
reserved, but the caches with this swap reserved have no or few pages
in them. Then, all 4GB of RAM gets used up. The page daemon runs, and
looks for things to swap out, but it can't find anything because all
our swappable caches with pages have no swap reservations, so all it
can do is flush out cached pages, which just degrades performance.

Or, consider what would happen if the 4GB of swap was released, but
the 4GB of RAM was still in use, and then the kernel tried to
allocate memory. It would get OOM errors, because none of the
caches have swap commitments and so nothing can be written out.

Under this new system, the specific swap space reservation only happens
just before the page is first written out, so both these cases should
be handled smoothly, and swap should be used in a much more sensible
fashion overall.

This change seems to be more in line with what other OSes do (Windows
Task Manager's "Committed" clearly is RAM+swap, for instance.)

The only potential downside to this change is that swappable caches
may temporarily go over their commitment when reading or writing
out pages to swap, before the page daemon has a chance to come by
and free the page or the swap space. But as that is a temporary state
and should always be resolved by the page daemon, I think it's
probably an acceptable trade-off.

Change-Id: I928f4b4cacbec26ed6315179476eaff1a7f626c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10305
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-24 14:02:52 +00:00
Augustin Cavalier 9be0e148a2 vesa & framebuffer: Clone the framebuffer instead of having it be user-accessible.
This begins paving the way for removal of user access to kernel
address space.

After the previous commits, BDirectWindow and BWindowScreen
still function properly.

Part of #19990.

Change-Id: I8477e43cd517ba67383755a4cb60b00bc117f5d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10559
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-24 14:01:11 +00:00
Augustin Cavalier 95ace7f374 kernel/vm: Introduce methods to change the cache of all an area's clones.
This will be useful in the case of cloned device caches based
around physical memory, e.g. for framebuffers.

Change-Id: If2b864208e86f436e91379b73c4b866b0bd5e1d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10558
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-24 14:01:11 +00:00
Augustin Cavalier 861f644f19 app_server & BWindowScreen: Do away with AS_GET_FRAME_BUFFER_CONFIG.
It can't work if the framebuffer is mapped per-application.
Instead, use the accelerant hook to get the framebuffer.

The BScreen methods this disables were deprecated and marked
private already, so no Haiku applications should be affected.
(If really necessary they could be reimplemented with BWindowScreen.)

Remove first _GetCardInfo in BWindowScreen; we invoke it
later, closer to where the buffer is actually used.

Tested with ParticlesII (which uses BWindowScreen) on VESA
with the new user-only-mapping accelerant.

Change-Id: I405bcfa8cb1eb2d0c346fafbc6233bef15196134
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10572
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-24 14:01:11 +00:00
Augustin Cavalier f6be811473 BDirectWindow: Clone the framebuffer from app_server, if necessary.
This paves the way for accelerants to map the framebuffer in
user memory, not kernel memory. It uses the ServerMemoryAllocator
in order to avoid mapping the framebuffer multiple times in
client applications.

While at it, clean up some names.

Tested with DirectWindowStars and GLTeapot, both work.

Change-Id: I4e0c003fae99891044af0a5e6e1d6a4506da6430
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10571
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-24 14:01:11 +00:00
Augustin Cavalier ede14380e5 kernel/slab: Run slab_object automatically when the 0xdeadbeef assert fails. 2026-03-23 23:11:40 -04:00
Augustin Cavalier a277043c1f kernel: Overhaul debug heaps system.
Instead of the kernel heap being a compile-time parameter, make it
a runtime parameter (if DEBUG_HEAPS is specified, at least; otherwise
we're hardwired to the slab heap as before.)

This is similar to what's done in userland: there LD_PRELOAD and
MALLOC_DEBUG control the heaps, here "kernel_malloc" and then
"guarded_heap_options" kernel settings control the heap.

While at it, apply fixes to the guarded and debug heaps to ensure
a minimum alignment of sizeof(void*), if no specific alignment
is requested.

Tested with a lot of build configurations (DEBUG_HEAPS 0, 1;
DEBUG_HEAPS_DEFAULT slab, guarded; USE_DEBUG_HEAPS_FOR_OBJECT_CACHE
0, 1) and with various parameters specified in the bootloader.
2026-03-23 23:01:26 -04:00
Augustin Cavalier 4fd16356e0 kernel: Move the debug heap to a separate file in the debug directory. 2026-03-23 23:01:26 -04:00
nipos e9c8f1a9e1 WebPositive: Allow closing the last tab and don't reopen it in the next session
Fixes #19992

Change-Id: Iae11e9440039b72fc3c4dc02afe18563e673d804
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10573
Reviewed-by: nephele nephele <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-23 21:01:58 +00:00
Augustin Cavalier 0e5639ad74 L2CAP: Remove dependency on userland bdaddrUtils.h.
And do some other code cleanup too.
2026-03-23 14:35:09 -04:00
Augustin Cavalier 7e813b6181 bluetooth: Drop unused int128.
This should be done using __int128 if necessary.
2026-03-23 14:34:25 -04:00
Augustin Cavalier 3c05f06edb kernel/user_mutex: Add missing get after allocating contexts.
Fixes a potential KDL.
2026-03-23 14:34:10 -04:00
Augustin Cavalier 54ad26255c kernel/vm: Fix set_memory_protection syscall.
check_protection adds kernel flags, so we need to do that after
checking the already-set flags.

Fixes #19988.
2026-03-23 14:31:51 -04:00
Augustin Cavalier 935941e772 kernel/vm: Drop team argument from vm_set_area_protection.
It's not needed and just creates confusion. Permissions checks
are done with the current team and the "kernel" parameter.
2026-03-23 14:31:00 -04:00
Augustin Cavalier c977e8a221 libroot/locale: Handle current_locale() being called early in initialization.
Fixes #19954.
2026-03-23 14:24:32 -04:00
Augustin Cavalier 89c3592b51 BBlockCache: Initialize the mutex unconditionally.
Otherwise we may get assertion failures under the debug heaps.
2026-03-23 14:07:18 -04:00
Oscar Lesta 007fba2312 hda: fix build if TRACE_CODEC is left undefined.
Due to `-Werror`, the warnings about unused variables, if
TRACE_CODEC is undefined, were breaking the build.

Change-Id: I2521f313b497afcb798b2b6c0ac6c00908fd0aac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10570
Reviewed-by: waddlesplash <[email protected]>
2026-03-23 17:52:42 +00:00
Oscar Lesta 62eb6227b6 device_manager_introduction.rst: minor fix.
Three "only"s on the same sentence were a bit too distracting :^D

Change-Id: I0b2cbb80f4d976a586ef3972c2e608937a89eb81
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10569
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-23 16:34:26 +00:00
Humdinger 8f8b01f5b4 Mail: natural sorting of labels
* Use BLocale collator to naturally sort labels.
* Add shortcut ALT+0 to "Remove label".

Change-Id: I6499e43e8d01718165b702a8005f2d398125c9df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10554
Reviewed-by: nephele nephele <[email protected]>
Reviewed-by: humdinger humdinger <[email protected]>
2026-03-23 16:30:01 +00:00
Humdinger fa0e6b2192 Added "Label as" Tracker add-on
Similar to the "Mark as" Tracker add-on, but for custom labels
stored as files in ~/config/settings/Mail/labels.

* Sets the MAIL:label file attribute.

* The pop-up menu with all available labels also has an item to
  remove a currently set label from an email, and to open the
  labels folder to "Manage labels…" (add, remove, rename etc.).

* Added File_Mail_label icon to distinguish from the "Mark as"
  add-on icon. It's supposed to be a narrow post-it as label…

"Mark as" Tracker add-on:
* Remove custom statuses from the "Mark as" Tracker add-on. That's
  what the new labels were introduced for.

Change-Id: I912a747156da3538457f622c1e2b163700c0c7eb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10539
Reviewed-by: nephele nephele <[email protected]>
2026-03-23 16:30:01 +00:00
X512 043ad4d92d BPicture: fix font shear storage
`SET_FONT_SHEAR` store shear angle in radians and relative to up
direction in BeOS. Formula of conversion from `BFont::SetShear()` to
`SET_FONT_SHEAR` value:

`pictShear = (fontShear - 90) * (M_PI / 180.0f)`.

Part of #1133.

Change-Id: I089c003e6509e519866d83dfe145e5b0226d32b1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10564
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-23 12:18:55 +00:00
PulkoMandy 30a96490a0 ImageRules: do not include catalogs from .so in dependencies
The rule to add an executable or shared library to the Haiku image
automatically also includes the corresponding locale catalogs and MIME
database entries.

The locale catalogs for .a files linked in the executable are also
included, since .a files are not themselves added to the same package.
This makes sure the executable has all the catalogs it needs.

The jam rule was written assuming that NEEDLIBS would only contain .a
files, but that is not the case when compiling Haiku. Libroot for
example is also in NEEDLIBS (this makes sure it is linked by absolute
file path, whereas LINKLIBS would instead use -lroot and may link the
host system one).

Rewrite the rule to include catalogs from the selected target and only
its .a dependencies.

Fixes #19721.

Change-Id: I0315476030d2e6e4dea574bb5f254ce9b442f556
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10563
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-23 00:16:01 +00:00
waddlesplash 4660bcfbab Revert "ImageRules: do not include catalogs from .so in dependencies"
This reverts commit 368cac3c9d.

Actually excluded catalogs for .so in all cases, not just
dependencies.

Change-Id: I6f8997073c71a6a9fa3fa875e971242bc8487666
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10562
Reviewed-by: waddlesplash <[email protected]>
2026-03-22 02:14:02 +00:00
Augustin Cavalier cafe26877f kernel: Actually fix call_all_cpus to invoke the method with interrupts disabled.
sICIEnabled is never set if sNumCPUs == 1.

Actually fixes #19983.

Change-Id: I3c50d118bb44ba4a2289586d4305d663a3a7900a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10561
Reviewed-by: waddlesplash <[email protected]>
2026-03-22 01:48:40 +00:00
Augustin Cavalier d3c2dd6c14 kernel/vm: Commit changes missed in previous commit. 2026-03-21 13:47:13 -04:00
Augustin Cavalier e13a6e6ec2 kernel/lock: Assert that a write lock isn't held in switch_from_read_lock. 2026-03-21 13:37:13 -04:00
Augustin Cavalier 5811e4bf6f kernel/vm: Pass the kernel parameter down in transfer_area() properly. 2026-03-21 13:18:28 -04:00
Augustin Cavalier 5fffbbfc48 kernel/vm: Minor API changes for consistency in VMCache.
* Insert/Remove can't fail, so drop status_t return values.

 * "TransferAreas" is really "TakeAreasFrom", so rename it. This
   avoids confusion with the "transfer_area" API call, which moves
   an area to another address space (keeping the same cache.)
2026-03-21 12:30:02 -04:00
Augustin Cavalier 05f1182cca kernel/vm: Overhaul protection checks and fixup.
* Give arch_vm_supports_protection a team_id argument (primarily
   to allow the kernel address space to be more restricted than
   user ones.)

 * Move invocation of arch_vm_supports_protection to a static method,
   and also call fix_protection from there.

 * Consolidate protection checks.
2026-03-21 09:26:44 -04:00
John Davis 17a4eb1ef9 hyperv: Add SCSI controller support
Adds support for the Hyper-V SCSI controller as part of the hyperv_scsi
driver. This driver enables the use of Hyper-V generation 2 VMs as
the SCSI controller is the only storage method supported.

IDE hard disks can be supported in the future on generation 1 VMs by
this driver, but this will require a mechansim to prevent the ATA
bus manager from handling hard disks and conflicting with this one.

Change-Id: Iabb9c0471578caf1ef80754f39a09e1ce0eb4249
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10504
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-21 11:20:30 +00:00
cafeina d6a2ec35b9 Haiku Book: added Certificate, ProxySecureSocket, SecureSocket, Socket
Change-Id: I65a6374ff08bb7d2217bc303eb0939a6c8c7c792
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9522
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-03-21 09:10:32 +00:00
John Davis 013c5814ff kernel/generic: Query interrupt table from PCIe root bridge by default
Currently when querying ACPI for the PCI interrupt routing table,
PNP0A03 is always used. Some systems such as X99/C610 and newer
HEDT platforms have multiple PCI host bridges, including PCI and
PCIe. This may result in the incorrect PCI bridge being queried
for routing, causing a failure during IO-APIC configuration.

This change moves to query PNP0A08 first, falling back to PNP0A03
as needed for older systems. This should resolve #19981.

Change-Id: I2ac5d5e74626787fb28d4a209027e142158d1c66
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10557
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-21 08:51:25 +00:00
Autocomitter fb99fe30dc Update translations from Pootle 2026-03-21 08:14:02 +00:00
Yash Suthar 85a56fe86c WebPositive: Animate indeterminate downloads for unknown sizes
* Use BarberPole to visually indicate download activity when the
  total file size is unknown, consistent with other parts of the UI.
* Show "2 GB received, 1.2 MiB/s" in the info label instead of the
  incorrect "2 GB of 0 bytes" text that appeared previously.

Change-Id: Ia8985e03f55202dd5d55197a76464e4717779e1f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10385
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-20 21:55:00 +00:00
X512 9e7b79a90e BPicture: fix BBitmap storage
BeOS save `BBitmap` data size `int32` field before bitmap data array.

Part of #1133.

Change-Id: I5706b87ca19f2e71e242b98eea6d69bc8ec14558
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10555
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-03-20 21:50:48 +00:00
Oscar Lesta 092beb6782 ActivityMonitor: B_GET_DEVICE_NAME can fail on some acpi_thermal devices.
On such case, the device may still report temperatures just fine, so
have separate "labels" for when we can't even open the device, or when
we just don't get its proper name.

Change-Id: Ia1924030e04de39c935b9f36a25858cbb1da467b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10556
Reviewed-by: waddlesplash <[email protected]>
2026-03-20 19:26:11 +00:00
Raghav Sharma ca7f0655b1 fs_shell: add null check for std_ops
Some file systems (like exfat) can have std_ops set to NULL in file_system_module_info header, so have a null check before initializing it.

Change-Id: Icdea910c5600daca985ac4b74cae197c40b6ba89
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10542
Reviewed-by: nephele nephele <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-20 14:52:20 +00:00
Raghav Sharma 528554ac4b xfs: Add new incompatible feature flags
Change-Id: I66cf435b043888bd4230b8447a00ac6bfe3e028e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10467
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-03-20 14:51:02 +00:00
Sunset Ash c1f29f4263 SecureSocket: Fire callback as part of cert verification
This was wrongly removed in hrev54730.
Should fix #17928.

Change-Id: I53986bfc32b04405cf3564a95d47b46132e50587
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10549
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-19 18:26:55 +00:00
Sam Roberts f833d107c6 arm64/uart_samsung: Don't do anything in InitPort
* It was actually disabling the UART
* I forgot this was C++ and not Rust and put a ! instead of
  a ~, so this wasn't doing what I intended anyway

Change-Id: I0b7c3d44f3e041cc70cb933ccba886346a6a6964
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10548
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-03-19 15:33:11 +00:00