Commit Graph

61162 Commits

Author SHA1 Message Date
Augustin Cavalier
9c878a9a89 nvme_disk: Use addr_t for pointer arithmetic.
No functional change (intended).
2020-03-22 20:52:01 -04:00
Augustin Cavalier
515ec47340 ArchitectureRules: Make HAIKU_KERNEL_PIC_CCFLAGS empty by default.
This makes it entirely up to the per-architecture setup as to
what to put into it.

No functional change.
2020-03-22 20:49:55 -04:00
Augustin Cavalier
625dc38a28 libnvme: Rework qpairs to lock themselves.
They were theoretically guarded by the controller lock, but it appears
nvme_ns bypassed that, meaning that if ns_read was executed at the
same time as qpair_poll, unpredictable races could occur. This solves
that by making the qpairs guarded by their own mutex, which also
has the advantage of poll() being executable on more than one qpair
at a time.

Seems to fix the KDLs in #15123 (and maybe other NVMe tickets),
though the I/O corruptions remain.
2020-03-22 17:36:31 -04:00
Leorize
f1e5a6c914 Installer: supports installing .hpkg-based optional packages
Most of Installer was designed for old-style optional packages (files in
a folder that's copied to the target volume). This commit modifies
Installer so that it can process and install .hpkg packages.

Change-Id: Ib7d69a04ccb7879b956b5c3f0df1241c56e4987d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2400
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-22 20:40:21 +00:00
Leorize
bf551d3889 installer/CopyEngine: now only exposes a Copy() method
Previously this class exposes two methods:
- CopyFile(): only copy the file data, nothing else.
- CopyFolder(): copy files & directories between two folders, while
                preserving the attributes as well as symlinks.

With this commit, everything is unified into one method: Copy(). This
method can handle files, directories, symlinks and optionally also copy
attributes. Since most of the logic was just moved around, we can be
rather certain that this won't disrupt CopyEngine behaviors by much.

In the future we should look into using BCopyEngine to replace the
copying part of CopyEngine, as they seems to be compatible.

This change allows the Installer to make use of CopyEngine as a
general-purpose copier, in preparation for optional .hpkg installation
support.

Change-Id: Iad5ba2ebc9f34b7822e550b415308fd2b43eed47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2399
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-22 20:40:21 +00:00
Leorize
fd09d551e1 installer/CopyEngine: _CollectCopyInfo now works with all file types
CollectCopyInfo was designed to process directories only. This commit
makes it more versatile and works with everything instead.

Change-Id: Ifa74db3815411f7348e3bcc230842710058b1111
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2398
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-22 20:40:21 +00:00
PulkoMandy
18da5c3042 Bootloader log: check for buffer overflow
We could overflow the in-memory log. The bounds check was there for BIOS
already but was missing in EFI and openfirmware. Could fix some crashes
when there is lots of loging.
2020-03-21 18:30:25 +01:00
PulkoMandy
99195e3c36 bootloader ethernet: fix tracing 2020-03-21 18:30:25 +01:00
Jérôme Duval
6d72c4188e virtio_net: add VIRTIO_NET_F_MTU support
Change-Id: Ie61fa0e0fe13a63d5b0ebde08303a1df836b1b52
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2384
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-21 17:16:45 +00:00
Jérôme Duval
d8e1fd6eda virtio: add clear_feature hook.
Change-Id: I282ffc65a7bd692145626ab4272c5df4a792e9d4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2383
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-21 17:16:45 +00:00
Autocomitter
58b3e18891 Update translations from Pootle 2020-03-21 08:48:09 +00:00
John Scipione
b5c9fb399a Deskbar: Increase MenuBar width by 1px
... so that you can click it on the screen edge in vertical mode on
the right side. The BarMenuBar was 1px too narrow and didn't take up
the last pixel of its parent BarView container and therefore wouldn't
open the menu on click on the last pixel.

MenuBar width is increased by 1px in all modes but you probably won't
be able to notice the difference in other modes.

NULL comparison style fix and floorf call to prevent non-integer width
are included.

Fixes #15813

Change-Id: Ic5ebef5a63846a397a55358a111e33987538c455
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2377
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2020-03-20 07:58:15 +00:00
Augustin Cavalier
cbb517abfd kernel/vfs: Replace the mount mutex with a rw_lock.
Since the entry_cache operations go through the mount lock,
this may considerably speed up parallel entry cache operations.

Change-Id: Ib2f841e288eb593ee3f795922103459c77764c22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2362
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-18 21:54:38 +00:00
Niels Sascha Reedijk
dba1e7423b HaikuBook: add documentation for various deprecated layout builders
The goal of this documentation is to help people that find code that uses these
classes, understand that the code is outdated and to refer them to the newer
template-based layout builder classes.

Change-Id: I4ba632be989686749181bdbc4e7f8a29adf01a5e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2353
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-17 22:29:36 +00:00
PulkoMandy
a207d7b35b bootloader: reduce verbosity
- Disable tracing where it's not needed by default
- Convert some drpintf to TRACE statements
- Comment some dprintf out completely in files that don't have a TRACE
  macro.

Change-Id: I1f6062bce74bcf1dbf77bf7bccadeeb12a4df46c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2370
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-16 22:33:13 +00:00
PulkoMandy
ae5a068f62 openfirmware: implement the in-memory log
We should probably make this code more platform-generic, the
implementation is very similar to the EFI one.

Change-Id: I17c9db933bfc2a81c96816dd6348d2d0c9627951
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2369
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-16 22:33:13 +00:00
PulkoMandy
442a131da7 bootloader: additional keyboard commands
In the boot menu, tab cycles between the menu items.

In the pager for logs, j and k allow to scroll the log (vim style keys).

These allow using the pager and menu on Sun machines, where Openboot
does not manage the keyboard arrow keys. It may be possible to get more
low-level input from the keyboard openboot device, but I think it is not
worth the effort for now, especially as we would need different handling
for the local keyboard and for serial ports.

Change-Id: I5fe74eb9f7a952ae49ae3c8a6bfae6ba4a16ae07
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2368
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-16 22:33:13 +00:00
PulkoMandy
9ebce09880 openfirmware: alternate implementation for console
If I understand the openboot specification correctly, we should not call
the forth words directly. Instead, we should rely on the
terminal-emulator package to parse ANSI escape sequences and manage the
display for us.

Unfortunately, the ANSI parser is very limited, many sequences don't
work, including the ones for colors. But we can at least have inverse
video, which is good enough to let the menu show.

I think the PowerPC console can be modified to use the same code, at
least partially. So for now I'm keeping this code in a cross-plaform
file.

Change-Id: Ie77b9ddcc18acb735c0d77cb574e28fbabd266e6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1989
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-16 22:33:13 +00:00
Augustin Cavalier
65920cacc0 kernel/vm: Validate user addresses do not cross the kernel/user boundary.
This protects against malicious programs trying to steal/overwrite
kernel memory by overflowing user buffers.

Note that this constitutes a behavioral change to user_strlcpy:
previously, address overflows on the "source" side would either
copy less data, or copy some data and fail anyway. Now, address
overflows on either side will always fail before any data is
copied at all.

Change-Id: I01d8b22672ab3758a9dd87b521af6fedd0487417
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2361
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-16 13:11:45 +00:00
Adrien Destugues
4f44282c3b Move source and development packages out of /system/packages on release images
Activating all these packages on live boot (especially live DVD where we
also have the write overlay eating up RAM) significantly increases
memory requirements for running Haiku, to the point that Installer may
fail to run. Move them outside the packages/ directory so they are not
activated.

Installer already skips the _sources_ directory when installing, and
lists the contents of _packages_ with checkbox to decide what to include
in the install (they are put in system/packages on the target disk).

Fix from previous version: the Haiku package was installed to /system
instead of /system/packages.

Fixes #15621.
2020-03-16 10:32:00 +01:00
PulkoMandy
e3952a44cd sparc: notes on network booting 2020-03-16 09:53:14 +01:00
Jérôme Duval
56bb1bd5c9 kernel: load cpu microcode update if loaded by the bootloader
add optional fields for microcode in kernel_args.

Change-Id: Ic5fb54cf6c9f489a2d1cdda00f63980c11dcdaeb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2264
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-16 06:41:16 +00:00
Leorize
4657aba9da freebsd_network/malloc: include kernel/heap.h
This header was not included when Haiku is built with KDEBUG_LEVEL=0,
causing build failures.

Change-Id: I690064f7c1a9818056a394e2655811775c4cc554
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2360
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-15 23:31:27 +00:00
Augustin Cavalier
c31d8dad23 Revert "Move source and development packages out of /system/packages on release images"
This reverts commit 0ab9c3c538.

It broke booting.
2020-03-15 19:30:08 -04:00
Augustin Cavalier
d3571a6f55 Cortex: Remove missed includes of debug_tools.h. 2020-03-15 18:00:25 -04:00
Augustin Cavalier
01a7f81291 Cortex: Remove debug_tools.
Not used by anything, so not needed.
2020-03-15 17:47:10 -04:00
Augustin Cavalier
6a84844ddf Icon-O-Matic: Disable printing statistics.
Not really needed, and for now triggers a lot of deprecation warnings.
2020-03-15 17:47:09 -04:00
Augustin Cavalier
c207330527 registrar: Replace the deprecated std::hash_set with our HashSet. 2020-03-15 17:47:09 -04:00
Augustin Cavalier
5c31a5242c kernel_cpp: Dynamic exception specifications were deprecated in C++11. 2020-03-15 17:47:09 -04:00
Murai Takashi
9a333ed1fc GIFTranslator: Fix offset free
Re-offset red_error, green_error and blue_error when deleted,
since they are offseted at line 99, 109 and 120
after they are allocated.
Pointed out by Clang Static Analyzer

Change-Id: Ic12a754dff7049fc4fbfd25ababafd8243db6baa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2354
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-15 19:54:36 +00:00
PulkoMandy
edfce7b327 openfirmware: fix dma-alloc for sparc
The dma-alloc method is in the parent node (the PCI bus), not directly
in the network device.

Change-Id: I18f6a9333f3afa78033042e75a86b00872515f2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2359
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-15 19:54:01 +00:00
PulkoMandy
0f33dfcce5 openfirmware: fail if IP address can't be found
Sending packets from 0.0.0.0 doesn't work quite right, so better admit
we failed.

Change-Id: Iddece4a7269abbdd8e93f0cbbc9a9e43fcbe8a69
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2358
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-15 19:54:01 +00:00
PulkoMandy
9a515368b7 openfirmware: another way to find the MAC address
Of course Sun and Apple didn't put it at the same place...

Change-Id: I974caff7335bb25a0e8dd4f7da8bdb9a737d011e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2357
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-15 19:54:01 +00:00
PulkoMandy
4e134b546a openfirmware: remove real_time_clock.
It is used only in the TCP loader to initialize a random TCP source port.
Since the RTC device does not exist on sparc, this is not portable. A
simple solution is to use a non-random source port, maybe based on the
powercycle count or something like that. For now, I don't need the TCP
loader, so I'll just disable this.

Change-Id: I6e279a77bb90a8b8b989f06dd9fb256156f71635
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1988
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-15 19:54:01 +00:00
PulkoMandy
5424c3a22e sparc: workaround for Netra T1 105
The address-size property is missing, but we don't really need it.

Change-Id: Iff3de89c811d16a263eadf796a0e6eb157dbe18b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2356
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-15 19:54:01 +00:00
PulkoMandy
6d929a001e sparc: fix boot MMU code
Apparently it worked by luck only on the Ultra60. Physical addresses for
openfirmware are on two cells (128 bits!) and we were passing only one
cell, of course this wouldn't go well. On the Ultra5 it ended up having
the heap point to unused space besides the RAM, so it was mostly reading
random data from there.

Change-Id: I4f9010013fe91a582e5daa83e6bf458703adba2b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2350
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-15 19:54:01 +00:00
PulkoMandy
5f86d837c0 openfirmware: fix of_seek for 64bit systems
The position is on 2 cells even on 64bit systems.

Change-Id: I97f4e3fc02734c548ed23445a917a894ff548379
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2351
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-14 19:37:59 +00:00
Augustin Cavalier
ed7329a890 file_systems/cdda: Use standard kernel mutexes instead of a custom lock.
No behavioral change (intended.)
2020-03-14 15:34:25 -04:00
Augustin Cavalier
74592da9a0 headers: Remove libroot_lock.h.
Not used (the one file that included it did not actually use it),
and no longer needed with the introduction of user_mutex.
2020-03-14 15:18:01 -04:00
Adrien Destugues
0ab9c3c538 Move source and development packages out of /system/packages on release images
Activating all these packages on live boot (especially live DVD where we
also have the write overlay eating up RAM) significantly increases
memory requirements for running Haiku, to the point that Installer may
fail to run. Move them outside the packages/ directory so they are not
activated.

Installer already skips the _sources_ directory when installing, and
lists the contents of _packages_ with checkbox to decide what to include
in the install (they are put in system/packages on the target disk).

Fixes #15621.

Change-Id: Ibfac14c43dbe708316a0d82ca1c9d49b5cba2aef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2157
Reviewed-by: Sergei Reznikov <diver@gelios.net>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-14 18:31:23 +00:00
CodeforEvolution
86950f4e76 MediaPlayer: Add Retrieving Track Number through Scripting
Also fix some backend logic

Change-Id: I4b24786ece4be1e9007686d46f6541d39df7a33b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/319
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-14 18:29:12 +00:00
Adrien Destugues
768f6b3bc4 Fix build for non-EFI architectures.
Change-Id: Ic2c8a9a64e63f4b844e964eb1066291d2edda7b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2343
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-14 18:28:24 +00:00
Adrien Destugues
228006ea74 package_daemon: fix path of activated-package files
Until now the activated-packages file was not used for anything, because
it was not looked for in the correct place.

Change-Id: Ib38f28b52e85af6900c0e2b61a9621734428ad25
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2341
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-03-14 18:27:35 +00:00
Autocomitter
1757f197bd Update translations from Pootle 2020-03-14 08:53:08 +00:00
Niels Sascha Reedijk
0e6f95726d HaikuBook: Add documentation for Password and Key Storage API
The current implementation of the keystore_server is not perfect. While the
source has many seeds for a future of having keyrings encrypted, and having
more fine grained permissions, it is far from complete.

The main arguments for adding documentation about this new but incomplete
functionality is that while it is incomplete, the API is part of the public
headers, and there are some legitimate use cases for developers.

The documentation aims to give the proper amount of caution to any developer
that is considering using this API.

Change-Id: I154a3f8374b22dc6929758cba7ba810833bcfe9d
2020-03-13 21:32:38 +00:00
Adrien Destugues
6a30d84f3c add some docs for agp_gart and intel_extreme drivers
Not a lot of info there yet, but it's a start.
2020-03-13 15:42:03 +01:00
Adrien Destugues
22ec64553f intel_extreme: some minor fixes
- Cleanup HEAD_MODE constants. These should be completely removed, now
  that we have a proper notion of pipes and displays. But the DPMS code
  still uses them, for now.
- Fix the ie_pipe command where width and height were swapped and
  missing a +1 to show the actual videomode values
2020-03-13 15:42:03 +01:00
John Scipione
2e99f0e1fe Appearance Prefs: Remember saved Decorator and ControlLook setting
... and make the Defaults and Revert buttons revert back to the
default/saved decorator and control look.

Add private _SetControlLook() method to set the control look which is
the equivalent of _SetDecor() but for control looks.

The person who implemented the ControlLook menu field made it so that
it would truncate the trailing "ControlLook" from the control look name,
do the same for Decorators so that BeDecorator is listed as simply "Be"
in the menu field. This is an alteration to the menu item label only and
does not affect the name of the decorator or control look.

Add private _DecorLabel() and _ControlLookLabel() methods to build
the truncated Decorator and ControlLook menu item labels respectively.

Set the current and saved decorator and control look in the constructor
and get rid of some private setter methods _AdoptToCurrentDecor() and
_AdoptInterfaceToCurrentDecor() that are no longer needed. These actions
are now done exclusively in the constructor and _SetDecor() respectively.

Remove unused knob style message constants (for now...)

Update copyright year to 2020

Change-Id: I0444a6198116d7699a84487cf97e9d826b14d1cb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2315
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-13 12:40:35 +00:00
John Scipione
cfdf08e8ba Appearance Prefs: style fixes to LookAndFeelSettings only
msg => message
pointer style
80 char limit fixes
Rename variable newControlLook => controlLook
Add #pragma descriptor comments.
Replace for (; condition;) loop with a while loop
Initialize count outside a different for loop
Change iterator variable i type from int => int32 (not purely style.)
2 lines of whitespace before ending header guard
Alphabetize (my) author name below Ryan Leavengood in header top comment

No functional change intended in this commit except for int => int32.

Change-Id: Ic78e3b0c85207ba07a3a71696d741344e148ac9d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2317
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-13 12:40:35 +00:00
Augustin Cavalier
8eaf4427f0 Tracker: Refactor IconCache to use BOpenHashTable.
This removes the last usage of the old OpenTracker OpenHashTable,
and so it can now be removed.

Change-Id: I7a7bceef1d3fc74c7fdfa7b079e53576452703dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2339
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-03-13 12:39:43 +00:00