Commit Graph

64628 Commits

Author SHA1 Message Date
Jessica Hamilton
23cc5401d1 build: copy new Terminal theme data files into the image.
Change-Id: I949d91e93e53f3551f46d06f4b720041b2f9ccc1
2022-12-18 16:24:45 +13:00
Jessica Hamilton
a7678d33db Terminal: make data files for the built-in themes.
Change-Id: Ib1444ebbb329ae9f2b14a33487cd21ce7b5dc37b
2022-12-18 16:03:19 +13:00
Jérôme Duval
6333726b2e setvolume: add options to mute, increment, decrement the master volume
also set the background flag

Change-Id: Ie198476d666a0cd290520d15534afa3a73cf8a1f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5936
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-17 15:19:26 +00:00
Dale Cieslak
85b82f8524 BFont: allow loading of user fonts from disk or memory
This patch adds an API call to BFont, called LoadFont, that
takes a string path to a font file. The user fonts are managed
via a new class called AppFontManager that inherits from the base
class FontManagerBase but adds the methods to add and remove user
fonts from disk or memory. There is also a new method called UnloadFont
to remove a user font, but on exit of an app all user fonts should be
automatically cleaned up.

Global/system fonts are managed by the GlobalFontManager, which is
a new class that also inherits from the base class FontManagerBase,
replacing the old "FontManager" class.

A maximum of 128 user fonts may be loaded, and memory fonts
may not exceed 20MB.

There's also an overloaded version of LoadFont that accepts
an area_id and loads the font from memory. A size and offset may
optionally be provided to allow for an area that contains more
than just a font.

Change-Id: I6add42bdf0c0cefc0e2e2a4984fd848c3e7269e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4790
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-17 12:32:09 +00:00
Zelenoviy
65f096fd08 USB: node unregistering returning B_BUSY is not a error in this case
Change-Id: Id9a1eccd47daef490d5ab2cba46ea97386ea0a89
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5870
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-12-17 08:59:00 +00:00
Oscar Lesta
f34d1d77f9 Shortcuts: detect keypresses even when the lock keys are set
Shortcuts was a bit overzealous while filtering out modifiers on
B_KEY_DOWN message handling.

This allows to enter keys regardless of the state of caps, scroll, or
num-lock modifiers.

Change-Id: Ie204f8e7938214ca68f45404026c7959216e0fc7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5943
Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2022-12-17 03:27:47 +00:00
Augustin Cavalier
3d6c6ac7f5 HaikuPorts: Synchronize. 2022-12-16 16:27:53 -05:00
Augustin Cavalier
9bcf5c9ce3 HaikuPorts/x86_gcc2: Synchronize. 2022-12-15 00:31:23 -05:00
Augustin Cavalier
5f50bcdfe2 HaikuPorts/x86_64: Synchronize. 2022-12-14 23:57:09 -05:00
Jérôme Duval
7fb137c2b2 efi/x86_64: skip reserved memory blocks when finding out the memory top
fix #16712

Change-Id: Ib2ae08bc47008098a6b0c231a759d5e91f88fd33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5912
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-15 04:11:35 +00:00
Oscar Lesta
1cae9edcc7 ramfs: add B_FS_IS_REMOVABLE as a workaround for #18137
This work-arounds the issue of the VirtualMemory preflet showing
RAM FS volumes as valid storage options for the swap file.

Removing B_FS_IS_PERSISTENT didn't work as I originally expected,
causing problems when attempting to write/delete entries on RAMFS
mounts after that.

Kudos to waddlesplash for the B_FS_IS_REMOVABLE alternative.

Change-Id: Id5ba1fa192b63b944cf59413a7f580ebb608e50d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5911
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-14 18:36:48 +00:00
Niels Sascha Reedijk
b70a0efa9e NetServices: Notify any async listeners when a request completes early.
The API allows a user to end parsing responses earlier if the response has a
client (4xx) or server (5xx) error code. The end user should still be notified
of this result, so that they can act.

Change-Id: I11f2ab296658f767b5b34e10badb54de27aab494
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5910
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-14 16:53:40 +00:00
Jérôme Duval
76ddb69a3a usb_raw: abort transfers cleanly on kill, fix use-after-free
* aborted transfers will release the notify semaphore when the cancel is notified.
* the allocated buffer would be freed on return, while the usb stack eventually copied
data in the buffer in our back, leading to KDL crashes, because the freed buffer would
be right reallocated for some kernel team structures.
* regression introduced by hrev55806, the transfers didn't need to be cancelled before.

Change-Id: Ifb6e941f71d05c37c36f878059c33883bb72a67c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5905
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-14 04:53:09 +00:00
X512
215b685f7f kernel: Drop non-standard GNU inline assignment syntax
* We needed this previously due to our gcc2 compiled kernel.
* Now that our kernel is always latest gcc, we can move to the
  c++20 syntax for inline assignment.
* Improves compatibility with clang, less GNU-specific stuff

Change-Id: Ib7272a0a52554a31e9a0e788fd3f031db9049795
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5898
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-13 20:49:53 +00:00
Alexander von Gluck IV
67d20a5856 ahci: drop failure to obtain pci x86 module error
* Contributes a lot of spam to syslog on non-x86

Change-Id: Ia22a1f6d167b9a9576cca6694dca99d853dad2d0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5902
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-13 20:28:13 +00:00
X512
54fb2560ae bus_managers/fdt: register multiple fdt/compatible attrs
Change-Id: I71efa8051d104d4b6a627071cd231c887271eb2e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5901
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-13 01:55:44 +00:00
Adrien Destugues
b358c4c49f hoard2: make block header size a multiple of 16 bytes
On 32bit x86 gcc11, allocations should be aligned to 16 bytes, but the
block header (which is stored before the allocations) contains two
pointers, which on a 32bit system results in 8 bytes. Add some padding
to make this header 16 bytes, guaranteeing that the data area is
actually aligned.

Fixes #18111.

Change-Id: Id23f8c0272d75090710f872b728852cd0fcb19ac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5885
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-13 01:55:04 +00:00
Oscar Lesta
3af8011358 env vars: move XDG Base Dirs variable exports to SetupEnvironment
This makes sure that apps get access to these variables regardless if
they are started from a shell or from GUI (double-click from Tracker,
desklink, etc).

Fixes #18130.

Change-Id: I82e2884e460fad7d6ec16e7b624c5cd2fcf807df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5897
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-12-13 01:49:55 +00:00
X512
36fa4b7e7d debug_server: improve stack trace
Change-Id: I94fc9e9e547f0191484cad8e7dc6e8b233b981db
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4299
Reviewed-by: David Karoly <karolyd577@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-12 15:49:12 +00:00
PulkoMandy
6e8c897e21 Tracker: Always use thumb attr when there is one
... even when the "Generate image thumbnails" setting is off.

This allows applications to generate thumbnails for 'non-media' files.
For example I use this in the ACE Amstrad CPC Emulator, to add a
thumbnail to emulator savestates (snapshots) with a screen capture of
the machine.

Change-Id: I95b0e4c64f5b1ffa779512755f70cfd9c1881661
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5768
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: nephele <nep@packageloss.eu>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-12 10:26:58 +00:00
X512
fa557843f2 riscv: use atomic CSR bit set/clear operations, refactor
Fix race conditions that cause broken timer interrupts.

Change-Id: I78e13a18d394b1566977e894a1def16a66c9ca5f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5883
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-11 18:43:15 +00:00
Murai Takashi
09b2fc9e11 libnetservices2: Fix Use-after-move
Pointed out by Clang Static Analyzer.

Change-Id: Ifbf5bd5e02825e60f7b70b7f99093b6b9740f81d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5896
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2022-12-11 12:50:05 +00:00
Humdinger
d3811d0036 Thumbnail: fix off-by-one of Height/Width attribute
Fixes #18128

Change-Id: I3abe72552657517acece101a1653b2f013b4f23f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5881
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-08 20:38:57 +00:00
Augustin Cavalier
140013f27a libroot: Fix open flags in shm_open.
We need O_CLOEXEC here, not FD_CLOEXEC (which is equal to 0x1, which
in openflags is O_WRONLY and thus leads to the conflicts caught by
the previous commit.)

Fixes haikuports/haikuports#7524.
(cherry picked from commit 59e09f7beb)

Change-Id: I5751822ac48ae7a865755494da241e4bfd34c45f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5853
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-07 22:59:58 +00:00
Augustin Cavalier
7cc1c1af2e kernel/vfs: Validate that only one of O_RDWR or O_WRONLY is used, if any.
Otherwise we will have open modes that could have both and lead to
confusion in code that presumes only one will be set.

This catches the cause of some ported software (e.g. Wayland layer)
misbehaving with ramfs mounted in /var/shared_memory: the ramfs does not
properly handle both flags set, and due to another bug, they are for
shm_open'ed files.
(cherry picked from commit 9bc250e28d)

Change-Id: I9e98be89b6d4a2da90f74c048b4f762ca9cf8738
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5852
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-07 22:59:58 +00:00
xoblite
6dd06f66d0 Updated the PCI and USB ID lists to the latest versions.
From their respective GitHub repositories:
https://raw.githubusercontent.com/usbids/usbids/master/usb.ids (version 2022.05.20)
https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids (version 2022.12.04)
Change-Id: I9348da6c4dca920e85ea607e8e6c4cf5c2cc41b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5874
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-12-07 22:47:29 +00:00
X512
bf2786efae kernel: enable ramfs build and automount to shared_memory directory
This will allow proper operation of POSIX SHM API (shm_open etc.).
Now memory files are stored fully in memory and do not affect disk
storage (except swap if enabled).

Change-Id: Iae3ce1afa968df72e82198e598a273cbf7cb0269
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5802
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-12-01 02:09:21 +00:00
Augustin Cavalier
05b654c67c ramfs: Fix SMAP violations in DataContainer. 2022-11-30 21:07:23 -05:00
Augustin Cavalier
396e3dfb9c ramfs: Switch from an embedded to a separately allocated small buffer.
This saves 16 bytes in the class vs. the old size, but more importantly
allows us to avoid allocating VMCaches and wasting an entire page for
any attribute larger than 32 bytes; instead, attributes can be up to
1024 bytes before we allocate a full page for them.

Unfortunately small files cannot take advantage of this optimization
right now as the cache is always used for them. I added a TODO about
this.
2022-11-30 20:27:17 -05:00
X512
f0e187c3fd kernel: follow-up to hrev56619: use new(std::nothrow)
to handle allocation failures.

Change-Id: I15d84b24dcea17741382b1d5285acf6219a39811
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5868
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-30 23:48:17 +00:00
Zelenoviy
07ca9bce14 termios: fix raw mode initialization
Change-Id: Ibdf0b84fd3ef47c091a670b1cdd00edf2cde196d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5869
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-11-30 23:47:12 +00:00
Jérôme Duval
fb69e06195 kernel: load cpu amd microcode update if loaded by the bootloader
we detect basically the cpu info before loading the microcode,
to be able to detect the vendor, and avoid any update on hypervisor.

I couldn't test because my cpu doesn't have any update available.

Change-Id: I6aea830158423b3ee13b640be8a788fc9041e23c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5859
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-30 08:50:59 +00:00
Jérôme Duval
616edea7fb boot_loader: load amd microcode update data file
switched to non-packaged paths

Change-Id: I331d4d6ed1af1ce6fa68109c9c6baf4a92bdc7b9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5858
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-30 08:50:59 +00:00
Augustin Cavalier
4e742d81ab ramfs: Volume->WriteLock but do not unlock in unmount.
As, of course, we are deleting it. This problem was obscured by the
one fixed by the previous commit.
2022-11-30 00:24:36 -05:00
Augustin Cavalier
605ecac1ee ramfs: Correct "reference" (link) counting of Node objects.
* RemoveReference() could delete us immediately, thus we must do
   all important work before invoking it.

 * Add assertions about fRefCount and remove a spurious add.

 * Do not use Link but PublishVNode on the root, as we manually manage
   when this object is published/deleted.

Fixes #18032.
2022-11-30 00:24:24 -05:00
Augustin Cavalier
6a8bb0562e ramfs: Correct usage of Nodes in Entry.
* We do not want to set fNode in the constructor but let the invocation
   of Link() take care of doing so instead.

 * Link/Unlink manipulate linked-lists. Thus it is dangerous to use them
   in tandem on the same Node object. Add a check for this.

 * Minor cleanup.
2022-11-30 00:17:58 -05:00
X512
8426404f97 pch_i2c: move to its own directory
Prepare for more i2c host controller drivers.

Change-Id: I85a4faf8376ffb501994a2bd89e0903bd89ed8cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5856
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-11-30 05:11:51 +00:00
Augustin Cavalier
80ae26e14b kernel/legacy_drivers: Use new/delete instead of malloc/free. 2022-11-29 22:36:08 -05:00
Augustin Cavalier
8f75eaafd0 VMAnonymousCache: Use new/delete instead of malloc/free. 2022-11-29 22:34:43 -05:00
Augustin Cavalier
549abba75f kernel/low_resource_manager: Use new/delete instead of malloc/free.
No functional change as-is, but this is necessary with some experimental
patches I am testing which add a lot more assertions to DoublyLinkedList,
which thus require it to have constructors/destructors for the Link class.
2022-11-29 22:34:26 -05:00
Augustin Cavalier
f6166140a1 build: Define _BOOT_MODE once and for all in ArchitectureRules+BootRules.
Previously it was spread all around the tree, and was not defined
consistently for all boot objects (there were a number of boot modules
which did not define it, but did include headers which checked for it.)

Now, as it is handled in SetupBoot which is invoked for all boot objects,
it will be applied consistently throughout. We can thus drop the manual
additions of it from all Jamfiles.
2022-11-29 20:18:12 -05:00
Augustin Cavalier
d48f4fd05f ramfs: Prevent creating files or directories named "." and "..".
Fixes #18031.
2022-11-29 19:08:16 -05:00
Augustin Cavalier
05fdda96b7 ramfs: Acquire write lock before unmounting.
Might help with #18032.
2022-11-29 19:06:56 -05:00
Augustin Cavalier
d5c130a3f9 ramfs: Whitespace fixes, no functional change. 2022-11-29 19:05:23 -05:00
Augustin Cavalier
9d679d7f5a debug_server: Restore <algorithm> include to appease GCC2. 2022-11-29 18:04:46 -05:00
Augustin Cavalier
f2dd9acf72 nvme_disk: Use a recursive lock instead of a mutex.
It appears on some controllers we can wind up in cases that are
a double-lock, otherwise.

Should fix #18093.
2022-11-29 17:51:31 -05:00
Augustin Cavalier
b85db63d2b debug_server: Make use of BControlLook::ComposeIconSize.
Change-Id: Ic5298f9fff3c0d9c4b3733fa99c43781edfabad7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5842
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-29 21:27:52 +00:00
Augustin Cavalier
5f40b96c35 libroot: Adjust malloc_hoard2 to use max_align_t when available.
Spotted while investigating #18111, but likely does not fix it.
This matches the existing behavior of the runtime_loader heap.
2022-11-29 16:14:13 -05:00
Augustin Cavalier
7255d28854 Tracker: Do not try to change to an invalid or unset icon size.
This can happen if we are already at the largest or smallest size.

Fixes #18066.

Change-Id: Icf68627ea51a054dac806ec0c9258bc80c869483
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5840
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-28 22:28:59 +00:00
Máximo Castañeda
753349fb2e WebPositive: save the cookie jar in the user settings directory also for the curl backend
The files and formats are different for libnetservices and curl
backends, but now they are under the same directory whatever the
installed haikuwebkit version uses.

Change-Id: Iab87d5fd27ebea1fa0a8967a9802dfa2fb11240a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5835
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-28 19:49:07 +00:00