forked from rumpkernel/pci-userspace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support for rump kernel pci drivers in Linux userspace
- Loading branch information
0 parents
commit b0bf7b0
Showing
8 changed files
with
456 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
This repository contains support for running NetBSD PCI device drivers | ||
in rump kernels in Linux userspace. Access to the devices is provided | ||
by the _uio_pci_generic_ Linux kernel module. | ||
|
||
See [the wiki](http://wiki.rumpkernel.org/Repo:-pci-userspace-linux) | ||
for information on building and using. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SUBDIR+= if_iwn if_wm | ||
|
||
.include <bsd.subdir.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PROG= example | ||
NOMAN= man, no man | ||
|
||
# components we need | ||
LDADD+= -lrumpdev_pci_if_iwn -lrumpnet_net80211 -lrumpdev_pci -lrumpdev | ||
LDADD+= -lrumpvfs -lrumpnet_netinet -lrumpnet_net -lrumpnet -lrump | ||
|
||
.include <bsd.prog.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include <sys/types.h> | ||
#include <sys/stat.h> | ||
|
||
#include <err.h> | ||
#include <fcntl.h> | ||
#include <inttypes.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
#include <rump/rump.h> | ||
|
||
int | ||
main() | ||
{ | ||
|
||
/* make sure we see dmesg */ | ||
setenv("RUMP_VERBOSE", "1", 1); | ||
|
||
/* bootstrap rump kernel */ | ||
rump_init(); | ||
|
||
/* | ||
* The iwn driver needs to load a firmware before anything | ||
* can happen with the device. We assume that the user will | ||
* copy the correct file into this directory, and we will | ||
* expose it under the firmware directory to the rump kernel. | ||
*/ | ||
if (rump_pub_etfs_register( | ||
"/libdata/firmware/if_iwn/iwlwifi-5000-2.ucode", | ||
"./iwlwifi-5000-2.ucode", RUMP_ETFS_REG) != 0) | ||
err(1, "etfs"); | ||
|
||
/* make sure old control suckets are not there */ | ||
unlink("/tmp/wmtest"); | ||
|
||
/* start listening to remote requests */ | ||
rump_init_server("unix:///tmp/wmtest"); | ||
|
||
/* | ||
* we are (most likely) running as root, just make sure | ||
* non-root clients can access us. | ||
*/ | ||
chmod("/tmp/wmtest", 0666); | ||
|
||
/* wait for remote clients commands until the bitter end */ | ||
pause(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PROG= example | ||
NOMAN= man, no man | ||
|
||
# components we need | ||
LDADD+= -lrumpdev_pci_if_wm -lrumpdev_miiphy -lrumpdev_pci -lrumpdev | ||
LDADD+= -lrumpvfs -lrumpnet_netinet -lrumpnet_net -lrumpnet -lrump | ||
|
||
.include <bsd.prog.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <sys/types.h> | ||
#include <sys/stat.h> | ||
|
||
#include <err.h> | ||
#include <fcntl.h> | ||
#include <inttypes.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
|
||
#include <rump/rump.h> | ||
|
||
int | ||
main() | ||
{ | ||
|
||
/* make sure we see dmesg */ | ||
setenv("RUMP_VERBOSE", "1", 1); | ||
|
||
/* bootstrap rump kernel */ | ||
rump_init(); | ||
|
||
/* make sure old control suckets are not there */ | ||
unlink("/tmp/wmtest"); | ||
|
||
/* start listening to remote requests */ | ||
rump_init_server("unix:///tmp/wmtest"); | ||
|
||
/* | ||
* we are (most likely) running as root, just make sure | ||
* non-root clients can access us. | ||
*/ | ||
chmod("/tmp/wmtest", 0666); | ||
|
||
/* wait for remote clients commands until the bitter end */ | ||
pause(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
RUMPTOP= ${TOPRUMP} | ||
|
||
RUMP_PCI_USER:= ${.PARSEDIR}/pci_user-uio_linux.c | ||
.export RUMP_PCI_USER | ||
|
||
.include "${RUMPTOP}/dev/Makefile.rumpdevcomp" | ||
|
||
.for pcidev in ${RUMPPCIDEVS} | ||
SUBDIR+= ${RUMPTOP}/dev/lib/lib${pcidev} | ||
.endfor | ||
|
||
.include <bsd.subdir.mk> |
Oops, something went wrong.