Commit Graph

234 Commits

Author SHA1 Message Date
brad 77871fbede gpioirq(4) version 2
This update makes this driver more than just an example and allows for:

o More than one pin to be attached to a gpioirq instance.  That is,
  the mask parameter can be greater than 0x01 now.

o A /dev/gpioirqN device that allows GPIO pin interrupts to be
  transported into userland.  This is a device that can be opened for
  reading with a simple fixed output indicating the device unit, pin
  number and current pin state.


This update was used as part of a physical intrusion detection system
where multiple switches (i.e. window magnetic reed switches and etc.)
are tied to a bunch of GPIO inputs with userland software that reacts
to the pins changing state.
2023-11-06 00:35:05 +00:00
jakllsch 2dc6cd3a66 fix hexprint function 2022-12-28 19:23:02 +00:00
wiz 6e5a4bb545 MAKEDEV: make nvmm node group-writable (was readable only; group nvmm)
Needed by qemu
2022-09-21 18:55:21 +00:00
riastradh cc725e3507 viocon(4): New virtio tty driver imported from OpenBSD.
viocon* at virtio?

/dev/ttyVI??

Tested under qemu with:

qemu-system-aarch64 ... \
  -device virtio-serial \
  -chardev socket,path=/tmp/ttyVI00,server=on,wait=off,id=ttyVI00 \
  -device virtconsole,chardev=ttyVI00,name=org.NetBSD.dev.ttyVI00 \
  ...

I updated MAKEDEV.conf to create /dev/ttyVI?? on all ports where it
looks likely to work based on:
(a) having pci or a non-pci virtio attachment,
(b) `qemu-system-$ARCH -M ?' mentioned something resembling the port,
    and
(c) `qemu-system-$ARCH -device virtio-serial' launched without
    complaining about the virtio-serial device.

(Criterion (c) excluded sparc and sparc64.)
2022-08-12 11:15:40 +00:00
uwe 069a423686 MAKEDEV.tmpl: make /dev/wsfont world-readable
Now that we have WSDISPLAYIO_LISTFONTS we want users to be able to use it.

NB: older kernels didn't check that WSDISPLAYIO_LDFONT was performed
on wsfont(4) device opened for writing and relied on its restrictive
root-only permissions to restrict who can load fonts.
2022-05-17 11:41:41 +00:00
andvar 2fa7e14158 fix various typos, mainly in comments, but also log messages, docs, game text. 2022-04-08 10:17:52 +00:00
brad bf53d44167 A driver and user land utility for the Sparkfun Serial Controlled Motor
Driver module as illustrated here:

https://www.sparkfun.com/products/13911

A SCMD module is a ARM SOC simular to a Arduino in front of a motor
driver chip.  The single SCMD module can control two motors and up to
16 additional modules can be chained together using an internal I2C
bus.  One can interface with the SCMD using tty uart commands, SPI or
I2C.  The driver in this commit adds a kernel driver for the I2C and
SPI interfaces.  The command line utility provides a set of
convenience commands that support most of the functions of the SCMD
and is able to use the tty uart mode, SPI user land or the included
kernel driver in a uniform manor.

The use of the SCMD module is mostly for small robots and the like,
but it can control anything that is controllable by voltage.
2021-12-07 17:39:53 +00:00
brad 1f3d8cb8fe Driver for the Sensirion SHT30/SHT31/SHT35 temperature and humidity
sensor such as:

https://www.adafruit.com/product/2857

This is a higher priced sensor with a lot of features, including the
ability to do sub-second periodic updates.  The driver supports
everything about the sensor except for the alert pin.
2021-11-06 13:34:39 +00:00
christos da1070e967 PR/56452: RVP: MAKEDEV should also create /dev/dri/renderD* devices 2021-10-12 17:19:20 +00:00
jmcneill c3146444be efi: Add /dev/efi character device
Introduce a /dev/efi character device that provides a means for accessing
UEFI RT variable services from userland. Compatible with the FreeBSD ioctl
interface for ease of porting their libefivar and associated tools.

The ioctl interface is defined in sys/efiio.h.

To enable support for this on an arch, the kernel needs `pseudo-device efi`
and the MD EFI implementation needs to register its backend by calling
efi_ops_register(). This commit includes an implementation for Arm.
2021-10-10 13:03:08 +00:00
jmcneill 065fe7e8c6 smbios: Add character device for accessing SMBIOS tables
The /dev/smbios character device gives an aperture into physical memory
that allows read-only access to the SMBIOS header and tables.
2021-07-24 11:39:18 +00:00
nia f3c68eb2b0 Remove uscanner(4) driver
This exists for compatibility with a Linux interface which was apparently
deprecated in Linux 2.6. There are various mailing list threads going
back to 2004 where the usefulness of this driver is discussed, but
the conclusion is that scanner software has all moved to using ugen(4)
instead, and enabling this driver will not help you scan things.
2021-06-29 10:22:33 +00:00
jmcneill 161b30af53 acpi: add character device for accessing ACPI tables
The /dev/acpi character device gives an aperture into physical memory
that allows only read access to known ACPI tables: RSDP, XSDT/RSDT, and
the root tables. Adapt acpidump(8) to use this interface by default,
falling back to the old /dev/mem method if it is not available or if
ACPIDUMP_USE_DEVMEM=1 is set in the environment. The user visible benefit
of this change is that "options INSECURE" is no longer required to
dump ACPI tables.
2020-12-06 02:57:29 +00:00
jdolecek b763920b00 add support for wwanc(4) device nodes (xmm[0-9]) 2020-07-26 15:47:27 +00:00
maxv 857941dbf5 Add fault(4). 2020-06-07 09:45:19 +00:00
maxv 9259199775 Register eight vHCI buses, and use separate KCOV mailboxes for them. 2020-06-05 17:20:56 +00:00
jdolecek 30f38bbb3f remove nsmb(4) 2020-04-04 16:04:36 +00:00
gson eacfd1aef9 Create the qemufwcfg device as part of "all". Discussed with jmcneill.
Also, include it in the list of special purpose devices.
2020-04-01 15:32:21 +00:00
riastradh db3a54e6ae Create /dev/ipmi0 in `MAKEDEV all'.
Works on my machine with sysutils/ipmitool if the latter is built
with CONFIGURE_ARGS+= --enable-intf-open.
2020-03-02 15:49:30 +00:00
riastradh ca00c5f3fd Create some more cgd device nodes. 2020-02-27 16:59:23 +00:00
maya 5e031685d6 remove urio(4), a driver for the Rio500 MP3 player.
At this point it is highly unlikely this 1999 device still has users,
but it still comes up in the context of maxv's USB-fuzzing (and any device
could pretend to be a urio(4)), so it's best to get rid of it.

Renamed all major entries to obsolete, as was done in previous removals.

This still requires an update to sanitizers, but they're located in
"external", perhaps it should be first committed upstream?

Proposed on tech-kern a month ago.
2020-01-29 18:39:00 +00:00
riastradh 08a157de6e Remove filemon(4).
Discussed on tech-kern:
https://mail-index.NetBSD.org/tech-kern/2020/01/13/msg025938.html

This was never (intentionally) enabled by default, and the design has
some shortcomings.  You can get mostly the same results with ktrace,
as in usr.bin/make/filemon/filemon_ktrace.c which is now used instead
of filemon for make's meta mode.

If applications require higher performance than ktrace, or nesting
that ktrace doesn't support, we might consider adding something back
into the vfs system calls themselves, without hijacking the syscall
table.  (Might want a more reliable output format too, e.g. one that
can handle newlines in file names.)
2020-01-19 20:41:17 +00:00
maxv 87107185b5 Revert the removal of filemon. 2019-12-23 06:45:36 +00:00
maxv e67f51b8f7 Retire filemon, discussed on tech-kern@. 2019-12-18 07:37:17 +00:00
ozaki-r 9dfe0beae9 MAKEDEV: add entry for vio9p(4) 2019-11-01 02:58:50 +00:00
maxv a6418236ed Add the "nvmm" group, and make nvmm_init() public. Sent to tech-kern@ a few
days ago.
2019-10-27 07:08:15 +00:00
thorpej f4659c41ae Create the character device for spiflash, in addition to the block device.
This is needed for getdiskrawname() to DTRT (for installboot(8)).

XXX pullup-9
2019-09-19 01:44:48 +00:00
ryoon 2fe677174a Replace major number in MAKEDEV for vhci 2019-09-15 12:54:21 +00:00
maxv 250ccf12c0 Add vHCI, a driver which allows to send and receive USB packets directly
from userland via /dev/vhci. Using this, it becomes possible to test and
fuzz the USB stack and all the USB drivers without having the associated
hardware.

The vHCI device has four ports independently addressable.

For each xfer on each port, we create two packets: a setup packet (which
indicates mostly the type of request) and a data packet (which contains
the raw data). These packets are processed by read and write operations
on /dev/vhci: userland poll-reads it to fetch usb_device_request_t
structures, and dispatches the requests depending on bRequest and
bmRequestType.

A few ioctls are available:

	VHCI_IOC_GET_INFO   - Get the current status
	VHCI_IOC_SET_PORT   - Choose a vHCI port
	VHCI_IOC_USB_ATTACH - Attach a USB device on the current port
	VHCI_IOC_USB_DETACH - Detach the USB device on the current port

vHCI has already allowed me to automatically find several bugs in the USB
stack and its drivers.
2019-09-14 06:57:51 +00:00
gdt e08f564969 MAKEDEV.tmpl: Create nodes for 16 USB hubs
As proposed on current-users, but with better formatting.
2019-07-29 17:53:20 +00:00
nia de9162c0be Raise the number of uhid nodes from 4 to 16.
My keyboard and mouse use multiple device nodes each. I can't use
any other devices once they're attached. With my keyboard, mouse,
and two game controllers attached, a total of 9 nodes are required.

Particularly, high-end keyboards with N-key rollover support require
more device nodes, since they pretend to be multiple keyboards to work
around limitations in the uhid compat spec.

My original intention was to raise it from 4 to 12, but martin
suggested increasing it to 16.

"somewhat insane, but so is reality" - mlelstv
2019-05-31 13:15:00 +00:00
mlelstv b1f23fc946 Add experimental userland interface to IPMI driver. Currently, transactions
(like sensor readout) are locked, so that a userland program may interfere with
envsys operation.

To use this you need a program like ipmitool built with OpenIPMI support.
2019-05-18 08:38:00 +00:00
martin 926b978a87 Double the number of wedge device nodes 2019-04-01 13:08:24 +00:00
mlelstv bdeb5b75c5 Actually use unit number for iscsi device. 2019-03-27 06:55:09 +00:00
pgoyette b23bf74cc4 Add srt(4) to /etc/MAKEDEV and corresponding update to MAKEDEV.8 man page. 2019-03-26 09:13:55 +00:00
mlelstv 975ce0ba8d Add userland driver to spi framework.
Previously spi would configure the controller to use the lowest speed of
all connected devices since the kernel started and to fail attempted mode
changes. This is now improved to keep individual modes and speeds for each
slave and to reconfigure the controller as necessary for each transfer.

Added man page for spi(9).
2019-02-23 10:43:25 +00:00
kamil 0fe7e51662 Add KCOV - kernel code coverage tracing device
The KCOV driver implements collection of code coverage inside the kernel.
It can be enabled on a per process basis from userland, allowing the kernel
program counter to be collected during syscalls triggered by the same
process.

The device is oriented towards kernel fuzzers, in particular syzkaller.

Currently the only supported coverage type is -fsanitize-coverage=trace-pc.

The KCOV driver was initially developed in Linux. A driver based on the
same concept was then implemented in FreeBSD and OpenBSD.

Documentation is borrowed from OpenBSD and ATF tests from FreeBSD.

This patch has been prepared by Siddharth Muralee, improved by <maxv>
and polished by myself before importing into the mainline tree.

All ATF tests pass.
2019-02-23 03:10:05 +00:00
maxv 65d06f3f0e Remove the satlink driver. It was disabled everywhere, had no man page and
no use either. Spotted by thorpej in PR/21345, ok christos.
2019-01-27 08:53:28 +00:00
maxv f3a4baf748 Add NVMM - for NetBSD Virtual Machine Monitor -, a kernel driver that
provides support for hardware-accelerated virtualization on NetBSD.

It is made of an MI frontend, to which MD backends can be plugged. One
MD backend is implemented, x86-SVM, for x86 AMD CPUs.

We install

	/usr/include/dev/nvmm/nvmm.h
	/usr/include/dev/nvmm/nvmm_ioctl.h
	/usr/include/dev/nvmm/{arch}/nvmm_{arch}.h

And the kernel module. For now, the only architecture where we do that
is amd64 (arch=x86).

NVMM is not enabled by default in amd64-GENERIC, but is instead easily
modloadable.

Sent to tech-kern@ a month ago. Validated with kASan, and optimized
with tprof.
2018-11-07 07:43:07 +00:00
maxv 8f30df5465 Add tprof in MAKEDEV.tmpl, and regen MAKEDEV.8. 2018-11-04 12:48:01 +00:00
maxv ebec90347e Remove ISDN from the kernel. It has remained unmaintained for a long time,
is of poor quality, and is now an obstacle to MP-ification. It was removed
ten years ago from FreeBSD for the same reason.

This retires a big user of the mbuf API, and will ease maintenance of the
kernel.
2018-09-23 09:20:57 +00:00
kre f8f3c1e1aa Avoid use of test -o for when this is used as part of an INSTALL system
and the SMALL test does not support -o
2018-09-22 13:48:22 +00:00
sevan e01538f90d Create fw(4) & fwmem(4) device nodes by default so fwctl(8) works out of the
box.
2018-07-28 14:13:13 +00:00
maxv b6a911a673 Create /dev/ksyms as "440 $g_kmem". This prevents unprivileged users from
reading the kernel symbols. Discussed in January 2018 on tech-kern@,
reported by maya@, tested by tih@.
2018-07-21 07:46:56 +00:00
thorpej 266bca89c9 Add a 1PPS-over-GPIO driver, originally by Brad Spencer, with changes by
me to adapt to the new GPIO interrupt interface and support a wider variety
of GPIO pin configuations.

PR kern/51676
2018-05-20 14:08:32 +00:00
christos b985414b8f Merge autofs support from: Tomohiro Kusumi
XXX: Does not work yet
2018-01-09 03:31:12 +00:00
jmcneill 2dbf225c9a make a few more drm nodes 2017-12-05 19:17:11 +00:00
jmcneill fb651b612c Add driver for QEMU Firmware Configuration device.
This interface allows the host to pass various data items and files to
the guest OS.
2017-11-25 16:31:03 +00:00
sevan eb0a13ec2a veriexec is enabled by default in most kernel configs but the lack of device
node results in a non working config, despite following manual to get setup.
Remove a step for the user by creating a device node for veriexec by default.


ok mrg jakllsch
2017-08-28 01:34:52 +00:00
jmcneill 40fab7550d add dial-out device node for plcom 2017-08-12 11:41:21 +00:00