60185 Commits

Author SHA1 Message Date
Augustin Cavalier
e8b2085d87 busses/usb: Print the PCI ID of the device with an invalid IRQ. 2019-04-18 14:01:13 -04:00
Jessica Hamilton
ce624c696f loader: load all available file/partitioning system modules.
* This fixes booting on virtualbox with UEFI, where it
  fails to identify CDs as BOOT_METHOD_CD, such that the
  write_overlay driver doesn't get loaded, causing a
  panic in the kernel trying to mount the boot device.

Change-Id: I63046d976661500227604bf01cc1631f1ae2b608
Reviewed-on: https://review.haiku-os.org/c/1406
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev53082
2019-04-18 16:40:01 +00:00
Jérôme Duval
3a75ef9ad1 runtime_loader: call preinit_array before initializing dependencies.
Change-Id: Ieed1af8ede83692d583d8e84bae92b1be29ddd1e
Reviewed-on: https://review.haiku-os.org/c/1187
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev53081
2019-04-18 04:54:01 +00:00
Augustin Cavalier
96e7ae6c4c nvme_disk: Fix build under GCC7. hrev53080 2019-04-18 00:00:03 -04:00
Augustin Cavalier
2bd1323ab8 nvme_disk: Respect the maximum transfer size by segmenting I/O.
On VirtualBox, the reported maximum transfer size is 2MB; but all
I/O >= 753KB fails in an identical way to the "maximum size" failures.
In other news, there are multiple open tickets in the VirtualBox
tracker about Linux systems failing to boot off NVMe...

I tested with a hacked-in maximum segment size of 752KB and everything
seemed to work just fine. Writing a HPKG to a FAT partition on NVMe,
rebooting, and then reading back the HPKG showed it had the same
sha256sum as the one stored in /system did. So this is working!
hrev53079
2019-04-17 23:15:06 -04:00
Augustin Cavalier
a3fa1e70f6 nvme_disk: Implement write support.
Tested only lightly. Please use caution when trying it!
2019-04-17 22:06:59 -04:00
Augustin Cavalier
872c8209b0 nvme_disk: Allocate up to 8 qpairs and round-robin them for I/O.
Before this commit, only one qpair was allocated and it was
locked for the duration of the transfer. Now we allocate more
qpairs if the device supports it and lock only when actually
calling read(), enabling multiple reads to both be queued
and execute simultaneously.

This is probably a significant performance improvement,
even more so than it is/would be for SCSI, as SSDs
can actually read from as many sectors as bandwidth
allows at once.
2019-04-17 19:44:23 -04:00
Alexander von Gluck IV
16525505c6 network/tun: install-tun target for rapid tun testing hrev53078 2019-04-17 21:18:18 +00:00
Alexander von Gluck IV
f8a5dd0828 network/tunconfig: Initial work on a tool to manage tunnels
* Modeled after pppconfig to some degree.
* Normally various VPN and other services will create / manage
  tunnels directly, however this gives us a good way to
  test / play with things initially.
2019-04-17 21:16:21 +00:00
Alexander von Gluck IV
e60aa2b8f9 network/tun: Fix incorrect module var name 2019-04-17 21:14:58 +00:00
Alexander von Gluck IV
612c05bd76 network/tun: Style fixes; no functional change hrev53077 2019-04-17 19:24:19 +00:00
Alexander von Gluck IV
64948daae8 tun/tap: Build fixes for tun add-on hrev53076 2019-04-17 14:12:59 +00:00
François Revol
23901a75de Stub out a tun/tap module from the loopback code
Not functional yet.

Change-Id: I6f7427c5fa176595927d73dd3b11b04945f66d84
2019-04-17 14:12:59 +00:00
François Revol
b110fce124 Add sources for my original BeOS BONE tun/tap config driver
as a starting point.

Change-Id: I9c3b1027a7fda4ab1eaced486eb2455a19571fee
2019-04-17 14:12:59 +00:00
Augustin Cavalier
b5d2337330 kernel/x86: Move the add_memory_type_range tracing to level "2".
We usually set level "1" by default, so this will hide it.
It's not really that useful when debugging problems in general
at this point.

OK'ed by tqh.
hrev53075
2019-04-15 12:26:30 -04:00
Jérôme Duval
02f7c69828 TranslationErrors.h: document as deprecated.
TranslationDefs.h: SupportDefs.h already includes Errors.h, remove TranslationErrors.h.
hrev53074
2019-04-15 20:45:19 +02:00
Alexander von Gluck IV
d214cb5e13 3rdparty/docker/bootstrap: Fix repo urls that don't work anymore
Change-Id: I91b324984b1abc69bb015117a9505be0e6541294
hrev53073
2019-04-15 13:25:55 -05:00
Augustin Cavalier
351575e0e4 kernel/vm: Do not invoke the low_resource monitor in map_backing_store.
As the comment implies, we don't want to wait here, but low_resource()
waits forever when timeout=0. It doesn't seem to do anything with the
"size" argument at all, so not calling it is just as effective, and so
replace the comment there altogether.

The case where this was most often hit, causing a full system deadlock
in anything relating to memory management, was when the passed "size"
was 0. So now we check for this case explicity at the beginning and
panic() on KDEBUG kernels for it.
hrev53072
2019-04-15 11:14:59 -04:00
Augustin Cavalier
716ccf0492 XHCI: If the capability parameters are invalid, bail.
This is the cause of #14557. It seems that OpenBSD does the same thing.
I didn't read the spec yet to determine precisely what this means,
so for now, just do what OpenBSD does and bail.

This only seems to happen with a secondary XHCI controller on that
device, so hopefully most USB ports will still work.
hrev53071
2019-04-14 22:05:47 -04:00
Augustin Cavalier
fa84c61a81 nvme_disk: Round the length to the proper offset for partial reads.
Following this commit, Haiku boots successfully in VMware from a
NVMe device!
hrev53070
2019-04-14 21:21:26 -04:00
Augustin Cavalier
0c26c6f155 build: Add the NVMe driver to the image. hrev53069 2019-04-14 20:16:36 -04:00
Augustin Cavalier
a3dc2dfa70 nvme_disk: Disable tracing. 2019-04-14 20:16:14 -04:00
Augustin Cavalier
c9ba44b70a nvme_disk: Properly implement partial reads.
The previous version did not account for the position not being a
multiple of the block size, among other problems.

Tested by hand with DiskProbe and then "dd skip=..." to read single
bytes from partial blocks, and validated as correct.
2019-04-14 20:14:53 -04:00
Augustin Cavalier
6ed6023d01 nvme_disk: Add more error checks in read(). 2019-04-14 19:02:30 -04:00
Augustin Cavalier
067b0d08b2 kernel: Add NVMe to the device manager. 2019-04-14 18:59:23 -04:00
Augustin Cavalier
ace6654618 nvme_disk: Get the correct PCI information struct.
We want the one of the parent object, not the parent's parent.
2019-04-14 18:50:10 -04:00
Augustin Cavalier
26657c395d nvme: Fix the build with GCC2. 2019-04-14 15:48:07 -04:00
Augustin Cavalier
2338299bcb nvme: Import the driver code.
Only one qpair is used for reading, which is rather inefficient.
We currently allocate a bounce buffer for every allocation, which is
also inefficient, due to the fact that we must read an integer multiple
of LBAs.

But it does work, and it is actually reasonably fast, even on an emulated
machine using a spinning-disk-backed NVMe device (88MB/s.)

I wasn't able to get it working in non-packaged, though; the device manager
called supports_device() on a number of PCI devices, but not the NVMe
device, so I have a different version with a hack that grabs the PCI info
manually. I didn't test inside haiku.hpkg yet; perhaps it will work in there.
hrev53068
2019-04-14 15:07:31 -04:00
Augustin Cavalier
4b88e72350 nvme: Import glue code to our PCI and VM APIs.
Largely simple and painless, thanks to libnvme's abstractions.
2019-04-14 15:02:47 -04:00
Augustin Cavalier
af4a03df24 libnvme: Import.
Minor modifications for Haiku included, and for the most part marked
as such.
2019-04-14 15:00:38 -04:00
Augustin Cavalier
6be5438599 busses/usb: Handle getting/putting the PCI modules properly.
Previously it was possible that we put() them twice, leading to
assert-failure panics as their ref-counts would go below 0.
Now we get() them once for every bus object that we create, as
the destructors put() them.

Should fix the panic in #15004.
hrev53067
2019-04-13 13:22:47 -04:00
John Scipione
75504052d6 DefaultWindowBehavior: Emulate right click and middle click
... based on mouse type setting in Mouse Preferences.

for (default) 3 button mouse, nothing changes. #important

for 1 button mouse,
	emulate right click by ctrl+click. This replicates Tracker
	behavior everwhere

for 2 button mouse,
	add todo to emulate middle click by pushing both buttons at
	the same time. Unfortunately I was unsucessful getting this
	feature to work.

Change-Id: I5377ed5b4967483096f7f185f434bced3f86cdb9
Reviewed-on: https://review.haiku-os.org/c/303
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
hrev53066
2019-04-13 16:57:41 +00:00
Augustin Cavalier
67b05100d2 busses/usb: Don't reject devices with "invalid" IRQs immediately.
We may be able to allocate an MSI for them. This was done for XHCI
already in hrev52742.

Probably fixes #15004.
hrev53065
2019-04-12 16:14:26 -04:00
Augustin Cavalier
5c6d92d72f busses/usb: Move ::AddTo to be above the class constructors.
It is called before them (and is responsible for calling them),
so having it in the middle of the file does not make a lot of sense.

Already done for XHCI. Only one functional change -- removing the
set_dprintf_enabled call. Drivers probably shouldn't spuriously
re-enable that if it was specifically disabled.
2019-04-12 16:05:35 -04:00
Humdinger
5dcd02dff2 Change button label in DriveSetup' format dialog
Some time back the menu item 'Partition | Initilize' changed to 'Format'.
The format dialog's button label still says 'Initialize'.
Change to 'Format' for consistency.

Change-Id: I6f1e84187a2d4b7c55843f9cd5cf0691f40c11fc
Reviewed-on: https://review.haiku-os.org/c/1405
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev53064
2019-04-12 19:42:09 +00:00
Augustin Cavalier
f1fafe317f kernel/OS.h: Include sys/types.h instead of pthread.h.
This avoids polluting the namespace significantly. Also adjust
all files which depended on this behavior to include pthread.h
directly.
hrev53063
2019-04-12 15:26:25 -04:00
Adrien Destugues
53830ab75a DriveSetup: disable 'Open with diskprobe' when no partition selected
This was part of the original DriveSetup patch but I missed it when
splitting it in smaller parts.
hrev53062
2019-04-11 18:03:14 +02:00
Alexander von Gluck IV
5599a1a3bb freebsd_network: Make riscv64 aware
Change-Id: I7199a28738ad8411cb62a858fb7da1bcc0de134a
hrev53061
2019-04-10 12:45:33 -05:00
Alexander von Gluck IV
51ab221fc7 glibc: Hack and slash in riscv64
* This isn't perfect, but should be a solid start.

Change-Id: Icb3f8c57b2bc4148d2ac14a71375d3f36c15e13b
Reviewed-on: https://review.haiku-os.org/c/1403
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
hrev53060
2019-04-10 17:35:13 +00:00
Alexander von Gluck IV
f481aba1a6 libroot/syscall: Add riscv64, improve error handling
* Add generic riscv64 support.
* Previously, missing architecture syscall.inc's would
  result in obsecure unrecognized opcode messages.
* The logic should be identical, but with a friendly error.

Change-Id: I8f4878e99faf0f64465d2a27c3da2dd1e43c4ba5
Reviewed-on: https://review.haiku-os.org/c/1402
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
hrev53059
2019-04-10 14:54:30 +00:00
Alexander von Gluck IV
d5ee99bbd7 riscv64: Ensure kernel is medany code model
Change-Id: I1b3386a072811bd068ab44190d16697dc7aad028
hrev53058
2019-04-09 20:25:04 -05:00
Alexander von Gluck IV
8672576c1e system/kernel: Add kernel linker script for riscv64
Change-Id: I9a8fcd8efdf6f728ee0938d10a4b0e7dfbf2ca7e
Reviewed-on: https://review.haiku-os.org/c/1401
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
hrev53057
2019-04-10 00:37:54 +00:00
Augustin Cavalier
77b171dc0d XHCI: Rename fields of xhci_trb to match their actual purposes.
FreeBSD has the names we used before this commit; OpenBSD has names
more similar to the ones used in this commit (though following their
conventions of course.)

This makes the code significantly more readable.
hrev53056
2019-04-09 17:10:15 -04:00
Augustin Cavalier
c05742c8d4 XHCI: Do all endianness conversion of TRBs in LinkDescriptorForPipe. 2019-04-09 17:06:13 -04:00
Dancsó Róbert
a075ce979e DriveSetup: add "open with DiskProbe" menu
Change-Id: I8ea9fe904eea2433e9c70403d554fc6160e0b059
Reviewed-on: https://review.haiku-os.org/c/1398
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev53055
2019-04-09 18:23:44 +00:00
Dancsó Róbert
510138aadf DriveSetup: automatically select single disk
When there is only one disk, automatically select it.
Otherwise, do not select anything to make sure the user does not
accidentally do things to the wrong disk.

Change-Id: I834415bda6bc43692697bdfa9030f35ffc94048f
Reviewed-on: https://review.haiku-os.org/c/1397
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-09 18:23:44 +00:00
PulkoMandy
8586b74cfc sparc: fix versions mismatches in HaikuPortsCross
Change-Id: Id733ccb211ca7eb47a104727be8045497190d551
Reviewed-on: https://review.haiku-os.org/c/1400
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev53054
2019-04-09 18:20:44 +00:00
Les De Ridder
e982a0b217 btrfs: make file system name consistent
Change-Id: I5276be636875809f78201cb6274d64499252de73
Reviewed-on: https://review.haiku-os.org/c/1394
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
hrev53053
2019-04-09 12:03:12 +00:00
François Revol
80934b8395 runtime_loader: Fix handling of #!/usr/bin/* introduced in hrev53048
Code was comparing "/usr/bin/" with "/usr/bin/env" of whatever was
passed. We now only compare the substring.

Change-Id: I0d09589fa83227d88fc8ba458eaf4293e86a041b
hrev53052
2019-04-08 23:50:33 +02:00
Calvin Hill
4e8ff93e77 wacom: Add Product ID for Wacom Bamboo Pen/Connect.
This enables the Wacom Bamboo Pen/Connect (CTL-470 Model) to be
recognised by the wacom driver. Pen support and pressure-sensitivity
is also working fine.

Tested on hrev53021.

Change-Id: I165a03e4a60f4cad8537122fdc2992ff291b9889
Reviewed-on: https://review.haiku-os.org/c/1392
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev53051
2019-04-08 15:14:11 +00:00