Commit Graph

60352 Commits

Author SHA1 Message Date
Jérôme Duval
471e44c962 <driver>mem: use user_memcpy instead of memcpy.
Change-Id: Id37e0e48a936de2e9fcfc5b9e16aad22b6dd0901
Reviewed-on: https://review.haiku-os.org/c/1414
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-26 15:48:40 +00:00
Jessica Hamilton
785877e9c0 loader: remove unused function.
No longer required due to bab060e.

Change-Id: I5d931ecfa615d2982a22256ba7d1f8aa1679a576
2019-04-26 04:27:11 +00:00
Jessica Hamilton
bab060e9dd 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: I1f23b4c4195668752357735368f4668b73f75980
2019-04-25 05:08:22 +00:00
Jessica Hamilton
0f00993773 Revert "loader: load all available file/partitioning system modules."
This reverts commit ce624c696f.
2019-04-25 05:05:19 +00:00
Jérôme Duval
0e4b529df5 pthread: pthread_getattr_np must call pthread_attr_init().
Fix #15025

Change-Id: Ie0b91714d375d75170b54e81cb31cf18b106ecc1
Reviewed-on: https://review.haiku-os.org/c/1413
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-24 18:43:37 +00:00
Zoltán Mizsei
c9ac7e4a9e Add audio/x-mptm to the mime db
Change-Id: Ib529b18eeedd9b1d0de0f254fb96e97d9d04df44
Reviewed-on: https://review.haiku-os.org/c/1412
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-23 02:44:24 +00:00
Zoltán Mizsei
66e077c644 Add MPTM to the MediaPlayer known mediatype list
Change-Id: I44140272a6cc8515f5583680cd4d182064192ca8
Reviewed-on: https://review.haiku-os.org/c/1411
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-04-23 02:44:24 +00:00
Augustin Cavalier
1cb376132e bootloader packagefs: Implement PrintErrorVarArgs.
The package kit calls this function to print errors it hits
when reading packages. We should never hit this in "normal
operation", but it should help with debugging #14993.
2019-04-22 19:41:04 -04:00
Augustin Cavalier
5c1e072463 bootloader packagefs: Remove unused classes from the build. 2019-04-22 19:31:47 -04:00
Augustin Cavalier
f62a92ae05 network/stack: Fix a race condition in device interface teardown.
Inside the device_consumer thread, the sequence of operations was this:
  1. Call fifo_dequeue_buffer()
  2. If it returned B_INTERRUPTED, exit the thread. Otherwise, process
     the buffer it returned as normal.
  3. Loop.

Thus, if the FIFO was destroyed not during a call to
fifo_dequeue_buffer, the next loop, fifo_dequeue_buffer would
be called on a destroyed FIFO. It would then try to lock the mutex
in the FIFO which had been destroyed, causing an assertion failure
and thus a panic.

Now, we check the ref_count on every loop, and set it to 0 before
calling uninit_fifo(). Thus, even if we are in the middle of a loop
inside the FIFO thread, the loop iteration condition will fail
and thus the thread will exit, avoiding the race.

Probably this was not an issue before because the timing required
to hit this is incredibly unlikely. With the new ipro1000 driver
(or kallisti5's WIP TUN/TAP driver), the timing makes this much
more likely.

Should fix #15024.
2019-04-22 18:41:25 -04:00
Alexander von Gluck IV
d117379205 posix/if_types.h: Remove IFT_IEEE1394, breaks build
* Sneaky ifdef in libnetwork/netresolv/irs
* Sorry for spam.

Change-Id: I241d65b63d0bb8b281e3db0adcad2814b1476c7e
2019-04-22 13:21:50 -05:00
Alexander von Gluck IV
db3b4a3caf posix/if_types.h: Fix tun id, add a few more
* Oops, there's a standard for these. Stick to the standard.
* Add a few that could be useful someday.
* Mention iana spec.

Change-Id: I4cf75e8c1e4b25f65d10921c7075fbd53f44e14e
2019-04-22 13:06:04 -05:00
Les De Ridder
aa08671d9c btrfs: partially implement filesystem initialization
Change-Id: I7fb3340dc39b3331d30e5113b5860d936efab253
Reviewed-on: https://review.haiku-os.org/c/1395
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-21 13:39:46 +00:00
Augustin Cavalier
9d6d044fdd ipro1000: Merge changes from FreeBSD's master branch.
Includes some crucial fixes for interrupt routing on certain hardware.
2019-04-20 12:30:34 -04:00
Augustin Cavalier
e86136cf87 freebsd_iflib: Merge changes from FreeBSD's master branch. 2019-04-20 12:28:11 -04:00
Preetpal Kaur
5012906434 Disable Touchpad preferences.
Show warning in the touchpad preference dialog box when user is not connected and also disable touchpad preferences except touchpad view.

Change-Id: I52b80e834ee3bb37d568aa065942eae405001343
Reviewed-on: https://review.haiku-os.org/c/1344
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-04-19 08:26:40 +00:00
Augustin Cavalier
9f7fb0e5c9 EHCI: Destroy the cleanup semaphore on teardown.
Otherwise, the wait_for_thread() of the fCleanupThread will block
forever, stalling the boot process.

Fixes another part of #15004.
2019-04-18 14:06:46 -04:00
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>
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>
2019-04-18 04:54:01 +00:00
Augustin Cavalier
96e7ae6c4c nvme_disk: Fix build under GCC7. 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!
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 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 2019-04-17 19:24:19 +00:00
Alexander von Gluck IV
64948daae8 tun/tap: Build fixes for tun add-on 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.
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.
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
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.
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.
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!
2019-04-14 21:21:26 -04:00
Augustin Cavalier
0c26c6f155 build: Add the NVMe driver to the image. 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.
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.
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>
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.
2019-04-12 16:14:26 -04:00