003 File Manager
Current Path:
/usr/sbin
usr
/
sbin
/
📁
..
📄
ac
(10.36 KB)
📄
accton
(5.66 KB)
📄
acpiconf
(9.14 KB)
📄
acpidb
(496.75 KB)
📄
acpidump
(39.86 KB)
📄
adduser
(23.38 KB)
📄
ancontrol
(34.19 KB)
📄
apm
(13.1 KB)
📄
arp
(17.88 KB)
📄
ath3kfw
(14.51 KB)
📄
audit
(5.98 KB)
📄
auditd
(21.79 KB)
📄
auditdistd
(127.49 KB)
📄
auditreduce
(15.34 KB)
📄
authpf
(20.57 KB)
📄
authpf-noip
(20.57 KB)
📄
automount
(50.65 KB)
📄
automountd
(50.65 KB)
📄
autounmountd
(50.65 KB)
📄
bcmfw
(8.68 KB)
📄
bhyve
(374.03 KB)
📄
bhyvectl
(41.55 KB)
📄
bhyveload
(16.41 KB)
📄
binmiscctl
(14.12 KB)
📄
blacklistctl
(33.88 KB)
📄
blacklistd
(41.85 KB)
📄
bluetooth-config
(9.71 KB)
📄
boot0cfg
(15.09 KB)
📄
bootparamd
(15.81 KB)
📄
bootpef
(38.09 KB)
📄
bootptest
(17.37 KB)
📄
bsdconfig
(11.98 KB)
📄
bsdinstall
(3.44 KB)
📄
bsnmpd
(136.55 KB)
📄
bthidcontrol
(36.06 KB)
📄
bthidd
(55.51 KB)
📄
btpand
(32.42 KB)
📄
btxld
(13.49 KB)
📄
callbootd
(9.26 KB)
📄
camdd
(37.59 KB)
📄
cdcontrol
(22.45 KB)
📄
certctl
(7.74 KB)
📄
chkgrp
(9.04 KB)
📄
chkprintcap
(18.22 KB)
📄
chown
(10.23 KB)
📄
chroot
(8.31 KB)
📄
ckdist
(16.18 KB)
📄
clear_locks
(6.23 KB)
📄
config
(56.23 KB)
📄
cpucontrol
(20.03 KB)
📄
crashinfo
(8.21 KB)
📄
cron
(44.9 KB)
📄
ctladm
(66.98 KB)
📄
ctld
(123.97 KB)
📄
cxgbetool
(2.86 MB)
📄
daemon
(15.76 KB)
📄
dconschat
(22.84 KB)
📄
devctl
(11.83 KB)
📄
devinfo
(8.68 KB)
📄
diskinfo
(19.2 KB)
📄
dtrace
(35.91 KB)
📄
dumpcis
(26.69 KB)
📄
dwatch
(36.59 KB)
📄
editmap
(84.02 KB)
📄
edquota
(22.9 KB)
📄
efibootmgr
(22.04 KB)
📄
efidp
(9.79 KB)
📄
efivar
(14.77 KB)
📄
etcupdate
(43.94 KB)
📄
extattrctl
(16.63 KB)
📄
fdcontrol
(14.94 KB)
📄
fdformat
(18.52 KB)
📄
fdread
(17.14 KB)
📄
fdwrite
(10.19 KB)
📄
fifolog_create
(9.03 KB)
📄
fifolog_reader
(31.19 KB)
📄
fifolog_writer
(15.57 KB)
📄
flowctl
(12.19 KB)
📄
fmtree
(36.11 KB)
📄
freebsd-update
(91.6 KB)
📄
fstyp
(19.38 KB)
📄
ftp-proxy
(28.19 KB)
📄
fwcontrol
(32.87 KB)
📄
gensnmptree
(29.26 KB)
📄
getextattr
(11.24 KB)
📄
getfmac
(6.78 KB)
📄
getpmac
(6.9 KB)
📄
gpioctl
(11.71 KB)
📄
gssd
(34.37 KB)
📄
gstat
(23.22 KB)
📄
hccontrol
(174.81 KB)
📄
hcsecd
(30.18 KB)
📄
hcseriald
(10.12 KB)
📄
hostapd
(876.65 KB)
📄
hostapd_cli
(79.18 KB)
📄
hoststat
(8.41 KB)
📄
hv_kvp_daemon
(21.99 KB)
📄
hv_vss_daemon
(9.45 KB)
📄
i2c
(14.99 KB)
📄
iasl
(1.34 MB)
📄
idprio
(7.61 KB)
📄
ifmcstat
(12.74 KB)
📄
inetd
(47.88 KB)
📄
iostat
(19.66 KB)
📄
iovctl
(19.91 KB)
📄
ip6addrctl
(12.2 KB)
📄
ipfwpcap
(10.79 KB)
📄
iprop-log
(24.89 KB)
📄
iscsid
(37.38 KB)
📄
iwmbtfw
(19.09 KB)
📄
jail
(68.96 KB)
📄
jexec
(8.85 KB)
📄
jls
(15.11 KB)
📄
kbdcontrol
(39.62 KB)
📄
kbdmap
(16.16 KB)
📄
keyserv
(24.67 KB)
📄
kgmon
(13.02 KB)
📄
kldxref
(29.59 KB)
📄
kstash
(9.68 KB)
📄
ktutil
(38.81 KB)
📄
l2control
(12.84 KB)
📄
l2ping
(10.6 KB)
📄
lastlogin
(8.5 KB)
📄
local-unbound
(148.45 KB)
📄
local-unbound-anchor
(38.63 KB)
📄
local-unbound-checkconf
(29.43 KB)
📄
local-unbound-control
(33.32 KB)
📄
local-unbound-setup
(11.7 KB)
📄
lockstat
(49.98 KB)
📄
lpc
(55.95 KB)
📄
lpd
(82.2 KB)
📄
lptcontrol
(6.48 KB)
📄
lptest
(6.03 KB)
📄
lsextattr
(11.24 KB)
📄
mailstats
(73.28 KB)
📄
mailwrapper
(8.41 KB)
📄
makefs
(183.64 KB)
📄
makemap
(89.47 KB)
📄
manctl
(7.75 KB)
📄
memcontrol
(11.88 KB)
📄
mergemaster
(43.59 KB)
📄
mfiutil
(75.3 KB)
📄
mixer
(12.14 KB)
📄
mld6query
(10.53 KB)
📄
mlx5tool
(11.54 KB)
📄
mlxcontrol
(19.72 KB)
📄
mount_smbfs
(15.29 KB)
📄
mountd
(54.05 KB)
📄
moused
(40.59 KB)
📄
mprutil
(33.95 KB)
📄
mpsutil
(33.95 KB)
📄
mptable
(15.74 KB)
📄
mptutil
(46.35 KB)
📄
mtest
(17.24 KB)
📄
mtree
(60.94 KB)
📄
ndis_events
(9.19 KB)
📄
ndiscvt
(39.78 KB)
📄
ndisgen
(15.83 KB)
📄
ndp
(24.03 KB)
📄
newsyslog
(46.39 KB)
📄
nfscbd
(10.15 KB)
📄
nfsd
(22.62 KB)
📄
nfsdumpstate
(8.02 KB)
📄
nfsrevoke
(6.08 KB)
📄
nfsuserd
(16.87 KB)
📄
ngctl
(29.15 KB)
📄
nghook
(10.09 KB)
📄
nmtree
(60.94 KB)
📄
nologin
(625.77 KB)
📄
nscd
(87.91 KB)
📄
ntp-keygen
(205.75 KB)
📄
ntpd
(842.26 KB)
📄
ntpdate
(126.85 KB)
📄
ntpdc
(268.29 KB)
📄
ntptime
(83.42 KB)
📄
pac
(28.74 KB)
📄
pciconf
(37.38 KB)
📄
periodic
(4.19 KB)
📄
pkg
(32.22 KB)
📄
plockstat
(22.91 KB)
📄
pmc
(167.45 KB)
📄
pmcannotate
(15.8 KB)
📄
pmccontrol
(11.81 KB)
📄
pmcstat
(77.77 KB)
📄
pnfsdscopymr
(9.09 KB)
📄
pnfsdsfile
(10.01 KB)
📄
pnfsdskill
(6.26 KB)
📄
portsnap
(29.86 KB)
📄
powerd
(15.97 KB)
📄
ppp
(427.13 KB)
📄
pppctl
(15.77 KB)
📄
praliases
(86.38 KB)
📄
praudit
(9.13 KB)
📄
prometheus_sysctl_exporter
(13.91 KB)
📄
pstat
(14.47 KB)
📄
purgestat
(8.41 KB)
📄
pw
(74.28 KB)
📄
pwd_mkdb
(16.71 KB)
📄
pwm
(10.45 KB)
📄
quot
(14.92 KB)
📄
quotaoff
(8.29 KB)
📄
quotaon
(8.29 KB)
📄
rarpd
(16.11 KB)
📄
repquota
(11.14 KB)
📄
rfcomm_pppd
(13.8 KB)
📄
rip6query
(7.69 KB)
📄
rmextattr
(11.24 KB)
📄
rmt
(9.48 KB)
📄
rmuser
(8.96 KB)
📄
route6d
(46.17 KB)
📄
rpc.lockd
(64.46 KB)
📄
rpc.statd
(22.27 KB)
📄
rpc.umntall
(12.3 KB)
📄
rpc.yppasswdd
(41.08 KB)
📄
rpc.ypupdated
(18.19 KB)
📄
rpc.ypxfrd
(16.12 KB)
📄
rpcbind
(43.91 KB)
📄
rrenumd
(34.28 KB)
📄
rtadvctl
(31.52 KB)
📄
rtadvd
(70.95 KB)
📄
rtprio
(7.61 KB)
📄
rtsold
(40.09 KB)
📄
rwhod
(17.15 KB)
📄
sa
(23.57 KB)
📄
sade
(48.1 KB)
📄
sdpcontrol
(15.98 KB)
📄
sdpd
(38.07 KB)
📄
sendmail
(8.41 KB)
📄
service
(4.84 KB)
📄
services_mkdb
(14.02 KB)
📄
sesutil
(20.83 KB)
📄
setextattr
(11.24 KB)
📄
setfib
(7.2 KB)
📄
setfmac
(14.27 KB)
📄
setfsmac
(14.27 KB)
📄
setpmac
(6.11 KB)
📄
smbmsg
(10.09 KB)
📄
snapinfo
(7.46 KB)
📄
sntp
(324.31 KB)
📄
spi
(15.59 KB)
📄
spkrtest
(3.62 KB)
📄
spray
(7.8 KB)
📄
sshd
(302.45 KB)
📄
swapinfo
(14.47 KB)
📄
syslogd
(53.15 KB)
📄
sysrc
(22.64 KB)
📄
tcpdchk
(19.85 KB)
📄
tcpdmatch
(16.88 KB)
📄
tcpdrop
(10.25 KB)
📄
tcpdump
(936.43 KB)
📄
traceroute
(33.23 KB)
📄
traceroute6
(30.32 KB)
📄
trim
(9.41 KB)
📄
trpt
(11.45 KB)
📄
tzsetup
(20.19 KB)
📄
uathload
(9.28 KB)
📄
uefisign
(20.87 KB)
📄
ugidfw
(8.57 KB)
📄
uhsoctl
(26.11 KB)
📄
usbconfig
(26.59 KB)
📄
usbdump
(16.42 KB)
📄
utx
(7.81 KB)
📄
valectl
(12.23 KB)
📄
vidcontrol
(27.79 KB)
📄
vidfont
(16.16 KB)
📄
vigr
(2.42 KB)
📄
vipw
(7.2 KB)
📄
wake
(7.33 KB)
📄
watch
(12.79 KB)
📄
watchdog
(15.37 KB)
📄
watchdogd
(15.37 KB)
📄
wlandebug
(16.26 KB)
📄
wpa_cli
(529.82 KB)
📄
wpa_passphrase
(37.72 KB)
📄
wpa_supplicant
(926.5 KB)
📄
yp_mkdb
(11.82 KB)
📄
ypbind
(20.45 KB)
📄
ypinit
(8.8 KB)
📄
ypldap
(93.28 KB)
📄
yppoll
(7.91 KB)
📄
yppush
(23.81 KB)
📄
ypserv
(43.55 KB)
📄
ypset
(7.36 KB)
📄
zdb
(164.94 KB)
📄
zdump
(13.48 KB)
📄
zfsd
(102.01 KB)
📄
zhack
(16.02 KB)
📄
zic
(42.48 KB)
📄
zonectl
(13.94 KB)
📄
zzz
(1.23 KB)
Editing: ndisgen
#!/bin/sh # # SPDX-License-Identifier: BSD-4-Clause # # Copyright (c) 2005 # Bill Paul <wpaul@windriver.com>. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by Bill Paul. # 4. Neither the name of the author nor the names of any co-contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # THE POSSIBILITY OF SUCH DAMAGE. # # $FreeBSD$ # header () { clear echo " ==================================================================" echo " ------------------ Windows(r) driver converter -------------------" echo " ==================================================================" echo "" } mainmenu() { header echo " This script is designed to guide you through the process" echo " of converting a Windows(r) binary driver module and .INF" echo " specification file into a FreeBSD ELF kernel module for use" echo " with the NDIS compatibility system." echo "" echo " The following options are available:" echo "" echo " 1] Learn about the NDIS compatibility system" echo " 2] Convert individual firmware files" echo " 3] Convert driver" echo " 4] Exit" echo "" echo -n " Enter your selection here and press return: " read KEYPRESS return } help1 () { header echo " General information" echo "" echo " The NDIS compatibility system is designed to let you use Windows(r)" echo " binary drivers for networking devices with FreeBSD, in cases where" echo " a native FreeBSD driver is not available due to hardware manufacturer" echo " oversight or stupidity. NDIS stands for Network Driver Interface" echo " Standard, and refers to the programming model used to write Windows(r)" echo " network drivers. (These are often called \"NDIS miniport\" drivers.)" echo "" echo " In order to use your network device in NDIS compatibility mode," echo " you need the Windows(r) driver that goes with it. Also, the driver" echo " must be compiled for the same architecture as the release of FreeBSD" echo " you have installed. At this time, the i386 and amd64 architectures" echo " are both supported. Note that you cannot use a Windows/i386 driver" echo " with FreeBSD/amd64: you must obtain a Windows/amd64 driver." echo "" echo -n " Press return to continue... " read KEYPRESS return } help2() { header echo " Where to get drivers" echo "" echo " If you purchased your network card separately from your computer," echo " there should have been a driver distribution CD included with the" echo " card which contains Windows(r) drivers. The NDIS compatibility" echo " system is designed to emulate the NDIS API of a couple of different" echo " Windows(r) releases, however it works best with drivers designed" echo " for NDIS 5.0 or later. Drivers distributed for Windows 2000 should" echo " work; however, for best results you should use a driver designed" echo " for Windows XP or Windows Server 2003." echo "" echo " If your card was supplied with your computer, or is a built-in device," echo " drivers may have been included on a special driver bundle CD shipped" echo " with the computer." echo "" echo " If you don't have a driver CD, you should be able to find a driver" echo " kit on the card or computer vendor's web site." echo "" echo -n " Press return to continue... " read KEYPRESS return } help3 () { header echo " What files do I need?" echo "" echo " In most cases, you will need only two files: a .INF file and a .SYS" echo " file. The .INF file is a text file used by the Windows(r) installer to" echo " perform the driver installation. It contains information that tells" echo " the installer what devices the driver supports and what registry keys" echo " should be created to control driver configuration. The .SYS file" echo " is the actual driver executable code in Windows(r) Portable Executable" echo " (PE) format. Note that sometimes the .INF file is supplied in Unicode" echo " format. Unicode .INF files must be converted to ASCII form with the" echo " iconv(1) utility before this installer script can use them." echo " Occasionally, a driver may require firmware or register setup" echo " files that are external to the main .SYS file. These are provided" echo " on the same CD with the driver itself, and sometimes have a .BIN" echo " extension, though they can be named almost anything. You will need" echo " these additional files to make your device work with the NDIS" echo " compatibility system as well." echo "" echo -n " Press return to continue... " read KEYPRESS return } help4 () { header echo " How does it all work?" echo "" echo " The installer script uses the ndiscvt(1) utility to convert the .INF," echo " .SYS and optional firmware files into a FreeBSD kernel loadable module" echo " (.ko) file. This module can be loaded via the kldload(8) utility or" echo " loaded automatically via the /boot/loader.conf file. The ndiscvt(1)" echo " utility extracts the device ID information and registry key data" echo " from the .INF file and converts it into a C header file. It also uses" echo " the objcopy(1) utility to convert the .SYS file and optional firmware" echo " files into ELF objects. The header file is compiled into a small C" echo " stub file which contains a small amount of code to interface with" echo " the FreeBSD module system. This stub is linked together with the" echo " converted ELF objects to form a FreeBSD kernel module. A static ELF" echo " object (.o) file is also created. This file can be linked into a" echo " static kernel image for those who want/need a fully linked kernel" echo " image (possibly for embedded bootstrap purposes, or just plain old" echo " experimentation)." echo "" echo -n " Press return to continue... " read KEYPRESS return } help5 () { header echo " Prerequisites" echo "" echo " Converting a driver requires the following utilities:" echo "" echo " - The FreeBSD C compiler, cc(1) (part of the base install)." echo " - The FreeBSD linker, ld(1) (part of the base install)." echo " - The objcopy(1) utility (part of the base install)." echo " - The ndiscvt(1) utility (part of the base install)." echo "" echo " If you happen to end up with a .INF file that's in Unicode format," echo " then you'll also need:" echo "" echo " - The iconv(1) utility." echo "" echo " If you have installed the X Window system or some sort of desktop" echo " environment, then iconv(1) should already be present. If not, you" echo " will need to install the libiconv package or port." echo "" echo -n " Press return to continue... " read KEYPRESS return } infconv () { header echo " INF file validation" if [ -z "$INFPATH" ]; then echo "" echo "" echo " A .INF file is most often provided as an ASCII file, however" echo " files with multilanguage support are provided in Unicode format." echo " Please type in the path to your .INF file now." echo "" echo -n " > " read INFPATH fi if [ ${INFPATH} ] && [ -e ${INFPATH} ]; then INFTYPE=`${EGREP} -i -c "Signature|.S.i.g.n.a.t.u.r.e" ${INFPATH}` if [ ${INFTYPE} -le 0 ]; then echo "" echo " I don't recognize this file format. It may not be a valid .INF file." echo "" echo -n " Press enter to try again, or ^C to quit. " read KEYPRESS INFPATH="" return fi INFTYPE=`${EGREP} -i -c "Class.*=.*Net" ${INFPATH}` if [ ${INFTYPE} -gt 0 ]; then echo "" echo " This .INF file appears to be ASCII." echo "" echo -n " Press return to continue... " read KEYPRESS return fi INFTYPE=`${EGREP} -i -c ".C.l.a.s.s.*=.*N.e.t" ${INFPATH}` if [ ${INFTYPE} -gt 0 ]; then echo "" echo " This .INF file appears to be Unicode." if [ -e ${ICONVPATH} ]; then echo " Trying to convert to ASCII..." ${ICONVPATH} -f utf-16 -t utf-8 ${INFPATH} > ${INFFILE} INFPATH=${INFFILE} echo " Done." echo "" echo -n " Press return to continue... " read KEYPRESS else echo " The iconv(1) utility does not appear to be installed." echo " Please install this utility or convert the .INF file" echo " to ASCII and run this utility again." echo "" exit fi return fi echo "" echo " I don't recognize this file format. It may not be a valid .INF file." echo "" echo -n " Press enter to try again, or ^C to quit. " read KEYPRESS INFPATH="" else echo "" echo " The file '${INFPATH}' was not found." echo "" echo -n " Press enter to try again, or ^C to quit. " read KEYPRESS INFPATH="" fi return } sysconv() { header echo " Driver file validation" if [ ! -r "$SYSPATH" ]; then echo "" echo "" echo " Now you need to specify the name of the Windows(r) driver .SYS" echo " file for your device. Note that if you are running FreeBSD/amd64," echo " then you must provide a driver that has been compiled for the" echo " 64-bit Windows(r) platform. If a 64-bit driver is not available" echo " for your device, you must install FreeBSD/i386 and use the" echo " 32-bit driver instead." echo "" echo " Please type in the path to the Windows(r) driver .SYS file now." echo "" echo -n " > " read SYSPATH fi if [ ${SYSPATH} ] && [ -e ${SYSPATH} ]; then SYSTYPE=`${FILE} ${SYSPATH}` case ${SYSTYPE} in *Windows*) echo "" echo " This .SYS file appears to be in Windows(r) PE format." echo "" echo -n " Press return to continue... " read KEYPRESS SYSBASE=`${BASENAME} ${SYSPATH} | ${TR} '.' '_'` ;; *) echo "" echo " I don't recognize this file format. It may not be a valid .SYS file." echo "" echo -n " Press enter to try again, or ^C to quit. " read KEYPRESS SYSPATH="" ;; esac else echo "" echo " The file '${SYSPATH}' was not found." echo "" echo -n " Press enter to try again, or ^C to quit. " read KEYPRESS SYSPATH="" fi return } ndiscvt() { header echo " Driver file conversion" echo "" echo " The script will now try to convert the .INF and .SYS files" echo " using the ndiscvt(1) utility. This utility can handle most" echo " .INF files; however, occasionally it can fail to parse some files" echo " due to subtle syntax issues: the .INF syntax is very complex," echo " and the Windows(r) parser will sometimes allow files with small" echo " syntax errors to be processed correctly which ndiscvt(1) will" echo " not. If the conversion fails, you may have to edit the .INF" echo " file by hand to remove the offending lines." echo "" echo -n " Press enter to try converting the files now: " read KEYPRESS if ! ${NDISCVT} -i ${INFPATH} -s ${SYSPATH} -O -o ${DNAME}.h > /dev/null; then echo "CONVERSION FAILED" exit else echo "" echo " Conversion was successful." echo "" echo -n " Press enter to continue... " read KEYPRESS fi return } firmcvt() { while : ; do header echo " Firmware file conversion" echo "" echo " If your driver uses additional firmware files, please list them" echo " below. When you're finished, just press enter to continue. (If your" echo " driver doesn't need any extra firmware files, just press enter" echo " to move to the next step.)" echo "" echo -n " > " read FIRMPATH if [ ${FIRMPATH} ]; then if [ ! -e ${FIRMPATH} ]; then echo "" echo " The file '${FIRMPATH}' was not found" echo "" echo -n " Press enter to try again, or ^C to quit. " read KEYPRESS continue fi if ! ${NDISCVT} -f ${FIRMPATH} > /dev/null; then echo "" echo "CONVERSION FAILED" else echo "" echo " Conversion was successful." echo "" FRMBASE=`${BASENAME} ${FIRMPATH}` FRMBASE="${FRMBASE}.o" FRMLIST="${FRMLIST} ${FRMBASE}" fi echo -n " Press enter to continue... " read KEYPRESS else break fi done header echo "" echo " List of files converted firmware files:" echo "" for i in ${FRMLIST} do echo " "$i done echo "" echo -n " Press enter to continue... " read KEYPRESS return } drvgen () { header echo " Kernel module generation" echo "" echo "" echo " The script will now try to generate the kernel driver module." echo " This is the last step. Once this module is generated, you should" echo " be able to load it just like any other FreeBSD driver module." echo "" echo " Press enter to compile the stub module and generate the driver" echo -n " module now: " read KEYPRESS echo "" echo -n " Generating Makefile... " echo ".PATH: ${PWD} ${STUBPATH}" > ${MAKEFILE} echo "KMOD= ${SYSBASE}" >> ${MAKEFILE} echo "SRCS+= ${STUBFILE} ${DNAME}.h bus_if.h device_if.h" >> ${MAKEFILE} echo "OBJS+=${FRMLIST} ${DNAME}.o" >> ${MAKEFILE} echo "CFLAGS+= \\" >> ${MAKEFILE} echo " -DDRV_DATA_START=ndis_${SYSBASE}_drv_data_start \\" >> ${MAKEFILE} echo " -DDRV_NAME=ndis_${SYSBASE} \\" >> ${MAKEFILE} echo " -DDRV_DATA_END=ndis_${SYSBASE}_drv_data_end" >> ${MAKEFILE} echo "CLEANFILES+= \\" >> ${MAKEFILE} echo " ${INFFILE} \\" >> ${MAKEFILE} echo " ${DNAME}.h \\" >> ${MAKEFILE} echo " ${DNAME}.o" >> ${MAKEFILE} echo ".include <bsd.kmod.mk>" >> ${MAKEFILE} if [ -f ${MAKEFILE} ]; then echo "done." else echo "generating Makefile failed. Exiting." echo "" exit fi echo -n " Building kernel module... " echo "" > bus_if.h echo "" > device_if.h if ! ${MAKE} -f ${MAKEFILE} all > /dev/null; then echo "build failed. Exiting." echo "" exit else if [ -f ${SYSBASE}.ko ]; then ${MV} ${SYSBASE}.ko ${SYSBASE}.kmod echo "done." else echo "build failed. Exiting." echo "" exit fi fi echo -n " Cleaning up... " if ! ${MAKE} -f ${MAKEFILE} clean cleandepend > /dev/null; then echo "cleanup failed. Exiting." echo "" exit else echo "done." fi ${RM} ${MAKEFILE} ${MV} ${SYSBASE}.kmod ${SYSBASE}.ko echo "" echo " The file ${SYSBASE}.ko has been successfully generated." echo " You can kldload this module to get started." echo "" echo -n " Press return to exit. " read KEYPRESS echo "" echo "" return } convert_driver () { while : ; do infconv if [ ${INFPATH} ]; then break fi done while : ; do sysconv if [ ${SYSPATH} ]; then break fi done ndiscvt firmcvt drvgen return } ICONVPATH=/usr/bin/iconv NDISCVT=/usr/sbin/ndiscvt STUBPATH=/usr/share/misc STUBFILE=windrv_stub.c DNAME=windrv CP=/bin/cp MV=/bin/mv RM=/bin/rm TR=/usr/bin/tr FILE=/usr/bin/file EGREP=/usr/bin/egrep MAKE=/usr/bin/make BASENAME=/usr/bin/basename TOUCH=/usr/bin/touch MKTEMP=/usr/bin/mktemp MAKEFILE=`${MKTEMP} /tmp/Makefile.XXXXXX` INFFILE=`${MKTEMP} /tmp/ascii_inf.XXXXXX` INFPATH="" FRMLIST="" SYSPATH="" SYSBASE="" FRMBASE="" if [ -r "$1" -a -r "$2" ]; then # Looks like the user supplied .INF and .SYS files on the command line INFPATH=$1 SYSPATH=$2 convert_driver && exit 0 fi while : ; do mainmenu case ${KEYPRESS} in 1) help1 help2 help3 help4 help5 ;; 2) firmcvt ;; 3) convert_driver ;; 4) header echo "" echo " Be seeing you!" echo "" exit ;; *) header echo "" echo -n " Sorry, I didn't understand that. Press enter to try again: " read KEYPRESS ;; esac done exit
Upload File
Create Folder