Commit Graph
68048 Commits
Author SHA1 Message Date
Jérôme Duval 59a481a049 Terminal: support for overlined text
Change-Id: I7444acb1da4c225b4af5a527fb5b0cd2d5ac2b5d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9635
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-10 11:06:52 +00:00
Jérôme Duval 2858af6540 Terminal: CSI REP min value is 1
Change-Id: I73666750b92ed64affb975dcba207c972567ea88
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9634
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-09-10 11:06:52 +00:00
Jérôme Duval 6ec9699bb5 Terminal: add support for DECRQM
* report mouse state, report cursor blink, report bracketed state
* introduce modes for flags to simplify the code
* keep modes in TerminalBuffer, TermParse can then write responses.

Change-Id: Id9961e90a96420ee63aca17375bd7f0a748d083a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9633
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-10 11:06:52 +00:00
Augustin Cavalier 368d09fdac freebsd_network: Clean up attach logic and separate USB logic.
USB code now goes in a separate static library.

This also paves the way for supporting more busses than PCI
and USB in the compat layer.

Tested with realtekwifi, still works.
2025-09-09 19:05:57 -04:00
Augustin Cavalier a1b4eeff4d freebsd_network: Overhaul MII attach code.
* Move ukphy ("unknown phy") code into the compat layer rather
   than duplicating it across many drivers.

 * Move MIIbus related code to a separate static library.

 * Genericize most attach methods that touched the MII bus directly
   to not need the code that's now in the static library.

Tested with rtl81xx, still works.
2025-09-09 16:59:21 -04:00
Augustin Cavalier 2aab5f5f14 FlatControlLook: Pull in color tinting changes.
This partially synchronizes to "upstream" commit 3c144bdfe53c61e2589e209d419f28f94ac77151.
Some of the more functional changes and new features I didn't import,
but mostly just the color tinting changes to match the new control colors.
2025-09-09 13:23:28 -04:00
Augustin Cavalier b9438b95f5 kernel/slab: Alter behavior of the ObjectDepot under PARANOID_KERNEL_FREE.
Instead of reusing objects as fast as possible, use two magazines per
CPU, and allocate and free objects from separate magazines, always
exchanging full and empty ones with the depot. Furthermore, reverse
the ordering of objects in full magazines, to get FIFO rather than
LIFO behavior.

sys time on "git status" and "compile HaikuDepot" benchmarks in
a 4-core VM seems increased by about 5% at most (e.g. 8.2s -> 8.6s.)
This may help with further catching use-after-free and other like
problems, so it seems worth it to leave enabled on KDEBUG.
2025-09-08 17:21:38 -04:00
PulkoMandy 902a3c1292 Devices: actually use isapnp_devids to show known ACPI node names
- Update the file with the latest version (from
  https://uefi.org/sites/default/files/resources/devids%20%285%29.txt)
- Tweak the Jamfile and awk script a bit to fix conflicts with acpi
  device IDs structures, add missing const, allow tabs in the input file
  instead of spaces (it is not formatted consistently)
- Match the hid or cid of ACPI devices to show well known names from the
  file if available and we have nothing better.

Change-Id: Iea11ca44c8fef245d044a7535e7e7a13230be848
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9632
Reviewed-by: waddlesplash <[email protected]>
2025-09-08 21:16:13 +00:00
Augustin Cavalier e3d01e53a2 kernel/slab: Use FIFO queuing for PARANOID_KERNEL_FREE only.
FIFO does seem to be a slight performance hit, and the security benefits
are probably not too large in the end. So just use LIFO otherwise.
2025-09-08 14:06:51 -04:00
Augustin Cavalier cac7959664 openbsd_network: Increment the OPACKETS counter in ifq_dequeue.
Otherwise it's never incremented, and the number of transmitted
packets in ifconfig would stay 0.
2025-09-08 13:12:27 -04:00
X512 508ff7e831 app_server: consolidate BRegion sending format
Change-Id: I6ba33fb3583f1292af7119c16964f7bec16aef54
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9629
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-09-08 16:42:25 +00:00
X512 647aba7574 ServerLink: move Read*/Attach* method implementations to LinkSender/Receiver
Change-Id: Ib4dec3348b1438bbdfbaf18146d8aebb1978c39c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9631
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-08 16:42:25 +00:00
Jim906 0f9d0e5cda nfs4: Improve debug output
* Make more info available from Dump functions.
* Allow locking to fail in Dump functions to avoid deadlocks caused by
  debug output.
* Make corrections to the nfs4_unlink() changes in hrev59023.

Change-Id: I8e5431baacb3cfa0baaedd2695c597549e746d2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9628
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-09-08 15:58:36 +00:00
PulkoMandy 7270c1788f Missing NULL check for CurrentWebView()
Should fix #19722

Change-Id: Ie3ff6ee15559a2726ca88eabdb8dbab2a81447e5
2025-09-07 11:29:27 +02:00
Augustin Cavalier 01f5b3146f kernel/fs: Add some missing descriptor open_mode checks. 2025-09-04 12:48:04 -04:00
Andrew Lindesay 5b41bc0066 HaikuDepot: Fix scrollbar position on row removal
Resolves #19728

Change-Id: Ie480bbd05eee84b417a83fc2ab5e822431ee7233
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9627
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-09-04 15:42:27 +00:00
Augustin Cavalier 01d48fcd27 Rename "tty" driver to "pty".
It was already that way in the source tree.
2025-09-03 19:21:03 -04:00
Augustin Cavalier c04a71fb41 Change a number of B_FILE_ERROR into B_IO_ERROR.
B_FILE_ERROR == EBADF == "Bad file descriptor". It's used
when there's no valid file descriptor, or when attempting
a read or write operation on a file descriptor not opened
with that mode. All other places should use B_IO_ERROR or
some other like value, instead.
2025-09-03 19:16:06 -04:00
Augustin Cavalier 64322ea7d0 ramfs: Remove open-mode checks in read and write hooks.
The VFS already does this for us, other filesystems don't
check this either.
2025-09-03 18:57:02 -04:00
Augustin Cavalier f7c3fa972c tty: Notify disconnections properly, and with B_SELECT_DISCONNECTED.
The tty_notify_select_event() at the end of tty_close_cookie()
checked if the other_tty's open_count was > 0 before notifying.
But in the case where the master is closing all children,
it will drop to 0 and leave things still in the select pool.
So we should notify unconditionally here.

Additionally, use B_SELECT_DISCONNECTED (i.e. POLLHUP). This matches
what Linux seems to do.

Fixes #19714.
2025-09-03 18:37:47 -04:00
Augustin Cavalier 5da70510b3 kernel/fs: Fallback in vfs_request_io if read_pages/write_pages aren't available.
Add a comment indicating why we don't call them unconditionally.

Fixes #19642.
2025-09-03 17:02:56 -04:00
Augustin Cavalier 2199532364 file_systems: Overlay layers only support being mounted with super volumes.
Fixes #16669.
2025-09-03 16:39:34 -04:00
Augustin Cavalier 92209b9023 kernel/slab: Add checks to object_cache_alloc for 0xdeadbeef.
We should always find it if PARANOID_KERNEL_FREE is enabled
and the object size is at least 2 pointers.
2025-09-03 15:43:04 -04:00
Augustin Cavalier bc50ada648 kernel/slab: Use FIFO instead of LIFO queueing for the object cache.
This should make use-after-frees more likely to be caught by the
standard paranoia facilities (and make them less likely to be
exploitable as memory will take longer to be reused.)
2025-09-03 15:41:58 -04:00
Jérôme Duval 0937305b84 gnu/sched.h: fix CPU_COUNT on gcc2 C89
Change-Id: Ia193e342d2bbac8060189f062e35aca47426444e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9626
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-03 15:10:23 +00:00
Joachim Mairböck b54f586058 sys/wait.h: add WCOREDUMP as alternative to WIFCORED
As this is part of POSIX since 2024, WCOREDUMP is the new default name.
WIFCORED is retained under _DEFAULT_SOURCE.

Fixes #19735.

Change-Id: Ic3f65e47b436bae92fe82ef73c3094be6bc9f29d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9622
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-01 16:33:57 +00:00
Jim906 53930893f4 nfs4: Improve compliance with VFS policy
* Eliminate the use of acquire_vnode as a probe to see whether a node
  has been constructed on the client side.
* Put the root node in unmount.
* In DirectoryCache::_LoadSnapshot(), don't mark a node removed unless
  certain that no other hard links exist.  The old logic might cause
  problems if, after marking a node removed, the client found another
  link to the file in another server directory.

The reason for removing the asserts from FileSystem::GetInode() is
that, with get_vnode calls replacing acquire_vnode calls, this may be
called earlier in the process of file creation, before
FileSystem::fInoIdMap contains an entry for the new file.

The changed logic in _LoadSnapshot isn't directly related to the new
VFS asserts.  It is meant to correct a problem that I noticed
incidentally when making the other changes.

Change-Id: I075485bc68ea9443be899add948116f0a0bca047
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9624
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-09-01 15:59:09 +00:00
Jérôme Duval e1e1c75a1f gnu/sched.h: fix CPU_* definitions to match glibc
add CPU_COUNT and cpu_set_t

Change-Id: I9b92cab27a8bb4fda71a99721801013647e02588
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9618
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-01 08:00:26 +00:00
Augustin Cavalier ff9a75a6f5 kernel/EntryCache: Always resize if needed in _AddEntryToCurrentGeneration.
Otherwise, the only place we resize the table is Remove(), and if
that doesn't get called (because no files are being deleted) then
we will rarely, if ever, resize the table, leading to performance
issues.

Fixes a performance regression easily seen by running "grep -R".
2025-08-30 12:36:35 -04:00
Augustin Cavalier 23f75d5229 BFS: Don't acquire/put the indices node in BPlusTree.
Fixes #19733.
2025-08-30 12:26:34 -04:00
Augustin Cavalier 6a3146aad9 kernel/timer: Slightly optimize spin().
Move the math operation out of the loop.
2025-08-30 11:28:19 -04:00
Augustin Cavalier 13e97a61cc kernel/x86: Use rdtsc in the fallback arch_debug_snooze case.
This allows us to avoid extra calculations and read barriers
in spin() from system_time(), and it should be easier to detect
as an "idle loop" if emulators want to do that.
2025-08-30 11:28:19 -04:00
Joachim Mairböck b0c4061d51 bindfs: Put the root node in unmount.
Now required.

Fixes #19734.

Change-Id: I13dd5ea1f7e90c7e22ebfa072fe2e413742aab67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9620
Reviewed-by: waddlesplash <[email protected]>
2025-08-30 15:20:49 +00:00
Joachim Mairböck e62a065081 packagefs: Put the root node in unmount.
Now required.

Part of #19734.

Change-Id: I6e438b2d018480a5a63ab3ba0a43838e4d019c8d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9619
Reviewed-by: waddlesplash <[email protected]>
2025-08-30 15:20:49 +00:00
Autocomitter 07613144d8 Update translations from Pootle 2025-08-30 08:10:55 +00:00
Augustin Cavalier 45f8b627d5 ext2: Put the root node in unmount.
This reverts commit 2df6cc0b3b.

Now required (again).
2025-08-29 15:04:04 -04:00
Augustin Cavalier 670620af72 NTFS: Put the root node in unmount.
Now required.
2025-08-29 15:04:03 -04:00
Augustin Cavalier 37563c2a01 FAT: Put the root node in unmount().
Now required.
2025-08-29 15:04:03 -04:00
Augustin Cavalier 6b86bc6ea3 kernel/fs: Handle root vnode ownership correctly and add more assertions.
In 5b14757a30 (2005), a change was made
to have root nodes be owned by filesystems, rather than
by the VFS (as BeOS did.) However, later on,
in fe5928847a (2011),
the adding of covered vnodes broke that.

As put_vnode's error was silently ignored, this went unnoticed
until this week, when the new asserts started firing.

So, to fix this, increment the reference count of the root when
setting its covering vnode, and handle the root specially.
Assert in ~fs_mount that there are no vnodes left; if the
filesystem failed to free it, this assert will trip.

Fixes the new assert seen in #19642.
2025-08-29 15:04:03 -04:00
Jérôme Duval ad49acb949 null: merge /dev/zero and add a /dev/full
present on both FreeBSD and Linux.
useful to test a "disk full" condition.

Change-Id: Ibac6b50e8063c90e3e324ec04ac136c34298cc7f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9617
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-29 06:57:40 +00:00
Augustin Cavalier effc4f4704 ramfs: Optimize Volume::NodeAttributeRemoved() slightly.
Use the pointer to the Index stored with the Attribute
rather than doing an unnecessary lookup.

Also clean up code style.
2025-08-28 19:39:40 -04:00
Augustin Cavalier 8aae7e134a ramfs: Miscellaneous code cleanups.
No behavioral change intended.
2025-08-28 19:38:40 -04:00
Augustin Cavalier 2d6a1945f0 ramfs: Put key length in the type in Attribute::GetKey.
Many of the callers of this method didn't initialize
the length parameter properly, which led to uninitialized
memory being used as part of the min() calculation, which
caused all sorts of problems.

Now we don't require them to pass in anything, and use the
constant directly.

Fixes #19252.
2025-08-28 19:38:12 -04:00
Augustin Cavalier 8f7bb51e20 ramfs: Properly update indexes when attribute sizes change.
Otherwise we'll have incorrect data in the index.

Part of #19252.
2025-08-28 19:35:06 -04:00
Augustin Cavalier 4e09216c77 ramfs: Keep track of attribute indexed state better and add assertions.
The "ASSERT(!fInIndex || fInIndex != inIndex);" one, tracking
state transitions, catches the underlying cause of #19252.
2025-08-28 16:57:13 -04:00
Augustin Cavalier 6818591003 kernel/fs: Add assertions to acquire_vnode and put_vnode.
* panic under KDEBUG if the node does not exist.

 * panic always if the node reference count was 0.
   We don't handle 0 -> 1 transitions here, and it doesn't make
   sense to acquire "another" reference to a node you
   haven't referenced.

Would have caught the ext2 use-after-free fixed in an earlier
commit.
2025-08-28 13:57:11 -04:00
Augustin Cavalier 4390b6b5c2 BFS: Don't try to acquire/put the indices node.
It's not published, so we will just get errors, or
(starting with the next commit) assertions.
2025-08-28 13:55:24 -04:00
Augustin Cavalier 0bb8848f51 freebsd_network: Use endpoint max packet size for USB xfer data length if unset.
This is what FreeBSD does. Needed for the upstream FreeBSD
version of the "pegasus" driver.
2025-08-28 13:44:30 -04:00
Augustin Cavalier dd90a96b5f freebsd_network: Fix assertion in usbd_xfer_set_frame_len.
Setting the length of a frame outside the current xfer frame count
(but less than the maximum count) is allowed on FreeBSD.

Fixes a KDL encountered with the FreeBSD version of the ASIX
USB ethernet driver.
2025-08-28 13:42:54 -04:00
Jérôme Duval 843f2bcce4 ext2: fix inode blocks count after enlarge or shrink
Change-Id: I6ac6253b761f25d567b969d8303fbf0858e47221
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9616
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-28 13:12:23 +00:00