FreeBSD src
Go to file
wpaul 4da746aa2f Commit the first cut of Project Evil, also known as the NDISulator.
Yes, it's what you think it is. Yes, you should run away now.

This is a special compatibility module for allowing Windows NDIS
miniport network drivers to be used with FreeBSD/x86. This provides
_binary_ NDIS compatibility (not source): you can run NDIS driver
code, but you can't build it. There are three main parts:

sys/compat/ndis: the NDIS compat API, which provides binary
compatibility functions for many routines in NDIS.SYS, HAL.dll
and ntoskrnl.exe in Windows (these are the three modules that
most NDIS miniport drivers use). The compat module also contains
a small PE relocator/dynalinker which relocates the Windows .SYS
image and then patches in our native routines.

sys/dev/if_ndis: the if_ndis driver wrapper. This module makes
use of the ndis compat API and can be compiled with a specially
prepared binary image file (ndis_driver_data.h) containing the
Windows .SYS image and registry key information parsed out of the
accompanying .INF file. Once if_ndis.ko is built, it can be loaded
and unloaded just like a native FreeBSD kenrel module.

usr.sbin/ndiscvt: a special utility that converts foo.sys and foo.inf
into an ndis_driver_data.h file that can be compiled into if_ndis.o.
Contains an .inf file parser graciously provided by Matt Dodd (and
mercilessly hacked upon by me) that strips out device ID info and
registry key info from a .INF file and packages it up with a binary
image array. The ndiscvt(8) utility also does some manipulation of
the segments within the .sys file to make life easier for the kernel
loader. (Doing the manipulation here saves the kernel code from having
to move things around later, which would waste memory.)

ndiscvt is only built for the i386 arch. Only files.i386 has been
updated, and none of this is turned on in GENERIC. It should probably
work on pc98. I have no idea about amd64 or ia64 at this point.

This is still a work in progress. I estimate it's about %85 done, but
I want it under CVS control so I can track subsequent changes. It has
been tested with exactly three drivers: the LinkSys LNE100TX v4 driver
(Lne100v4.sys), the sample Intel 82559 driver from the Windows DDK
(e100bex.sys) and the Broadcom BCM43xx wireless driver (bcmwl5.sys). It
still needs to have a net80211 stuff added to it. To use it, you would
do something like this:

# cd /sys/modules/ndis
# make; make load
# cd /sys/modules/if_ndis
# ndiscvt -i /path/to/foo.inf -s /path/to/foo.sys -o ndis_driver_data.h
# make; make load
# sysctl -a | grep ndis

All registry keys are mapped to sysctl nodes. Sometimes drivers refer
to registry keys that aren't mentioned in foo.inf. If this happens,
the NDIS API module creates sysctl nodes for these keys on the fly so
you can tweak them.

An example usage of the Broadcom wireless driver would be:

# sysctl hw.ndis0.EnableAutoConnect=1
# sysctl hw.ndis0.SSID="MY_SSID"
# sysctl hw.ndis0.NetworkType=0 (0 for bss, 1 for adhoc)
# ifconfig ndis0 <my ipaddr> netmask 0xffffff00 up

Things to be done:

- get rid of debug messages
- add in ndis80211 support
- defer transmissions until after a status update with
  NDIS_STATUS_CONNECTED occurs
- Create smarter lookaside list support
- Split off if_ndis_pci.c and if_ndis_pccard.c attachments
- Make sure PCMCIA support works
- Fix ndiscvt to properly parse PCMCIA device IDs from INF files
- write ndisapi.9 man page

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
2003-12-11 22:34:36 +00:00
bin The uuidgen(1) program is WARNS=6 clean, so flag it as such. 2003-12-07 21:34:56 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r123394, 2003-12-10 16:46:08 +00:00
crypto Add a missing word. 2003-10-31 21:49:47 +00:00
etc Change rc.d/syscons to not need /usr/sbin/ispcvt to exist. This should 2003-12-10 15:48:49 +00:00
games Use WARNS level 2 instead of setting CFLAGS explicitly to -Wall. 2003-12-07 17:34:52 +00:00
gnu Add two additional headers for amd64 and x86. 2003-12-09 16:31:30 +00:00
include Move the bktr(4) <arch>/include/ioctl_{bt848,meteor}.h files to dev/bktr 2003-12-08 07:22:42 +00:00
kerberos5 No need for two copies of this file; there is already a distribution 2003-11-17 14:59:06 +00:00
lib Fix a strict aliasing issue. Also remove an unnecessary pam_get_item() 2003-12-11 15:51:03 +00:00
libexec Revert last change. ../rtld.c uses CACHE_LINE_SIZE too. 2003-12-11 18:42:51 +00:00
release Add hints about nForce3 issues 2003-12-08 22:38:39 +00:00
rescue Remove cxconfig and add sconfig 2003-12-03 17:12:35 +00:00
sbin Try to catch up with device name changes due to GEOM'ification. Remove 2003-12-08 10:50:36 +00:00
secure Explicitly add libz and libcrypto to LDADD for any ssh utilities missing 2003-08-19 07:45:03 +00:00
share Grammar. 2003-12-11 21:54:26 +00:00
sys Properly fix a typo that the previous revision made even worse. 2003-12-11 20:40:12 +00:00
tools Don't pass -P option to make(1) as it confuses the error detection logic. 2003-12-11 16:54:42 +00:00
usr.bin Fixed misplacement of __FBSDID(). Backed out editing of vendor id lines. 2003-12-11 10:58:29 +00:00
usr.sbin Commit the first cut of Project Evil, also known as the NDISulator. 2003-12-11 22:34:36 +00:00
COPYRIGHT
MAINTAINERS I'll maintain dhclient from now on. 2003-08-01 17:54:11 +00:00
Makefile Put on some factor 30+ bikeshed repellent and export the internal 2003-12-09 02:08:19 +00:00
Makefile.inc1 Fix a problem where 'make installworld' will fail and leave the 2003-12-09 00:42:44 +00:00
README
UPDATING Add a note about MPTABLE_FORCE_HTT. 2003-12-10 15:59:20 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The
``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html