ndisgen.sh (148279) | ndisgen.sh (148281) |
---|---|
1#!/bin/sh 2# 3# Copyright (c) 2005 4# Bill Paul <wpaul@windriver.com>. All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: --- 16 unchanged lines hidden (view full) --- 25# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31# THE POSSIBILITY OF SUCH DAMAGE. 32# | 1#!/bin/sh 2# 3# Copyright (c) 2005 4# Bill Paul <wpaul@windriver.com>. All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: --- 16 unchanged lines hidden (view full) --- 25# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31# THE POSSIBILITY OF SUCH DAMAGE. 32# |
33# $FreeBSD: head/usr.sbin/ndiscvt/ndisgen.sh 148279 2005-07-22 05:49:41Z jkim $ | 33# $FreeBSD: head/usr.sbin/ndiscvt/ndisgen.sh 148281 2005-07-22 10:35:34Z ceri $ |
34# 35 36header () { 37clear 38echo " ==================================================================" 39echo " ------------------ Windows(r) driver converter -------------------" 40echo " ==================================================================" 41echo "" 42} 43 44mainmenu() { 45header | 34# 35 36header () { 37clear 38echo " ==================================================================" 39echo " ------------------ Windows(r) driver converter -------------------" 40echo " ==================================================================" 41echo "" 42} 43 44mainmenu() { 45header |
46echo " This is script is designed to guide you through the process" | 46echo " This script is designed to guide you through the process" |
47echo " of converting a Windows(r) binary driver module and .INF" 48echo " specification file into a FreeBSD ELF kernel module for use" 49echo " with the NDIS compatibility system." 50echo "" 51echo " The following options are available:" 52echo "" 53echo " 1] Learn about the NDIS compatibility system" 54echo " 2] Convert individual firmware files" --- 34 unchanged lines hidden (view full) --- 89echo " Where to get drivers" 90echo "" 91echo " If you purchased your network card separately from your computer," 92echo " there should have been a driver distribution CD included with the" 93echo " card which contains Windows(r) drivers. The NDIS compatibility" 94echo " system is designed to emulate the NDIS API of a couple of different" 95echo " Windows(r) releases, however it works best with drivers designed" 96echo " for NDIS 5.0 or later. Drivers distributed for Windows 2000 should" | 47echo " of converting a Windows(r) binary driver module and .INF" 48echo " specification file into a FreeBSD ELF kernel module for use" 49echo " with the NDIS compatibility system." 50echo "" 51echo " The following options are available:" 52echo "" 53echo " 1] Learn about the NDIS compatibility system" 54echo " 2] Convert individual firmware files" --- 34 unchanged lines hidden (view full) --- 89echo " Where to get drivers" 90echo "" 91echo " If you purchased your network card separately from your computer," 92echo " there should have been a driver distribution CD included with the" 93echo " card which contains Windows(r) drivers. The NDIS compatibility" 94echo " system is designed to emulate the NDIS API of a couple of different" 95echo " Windows(r) releases, however it works best with drivers designed" 96echo " for NDIS 5.0 or later. Drivers distributed for Windows 2000 should" |
97echo " work, however for best results you should use a driver designed" | 97echo " work; however, for best results you should use a driver designed" |
98echo " for Windows XP or Windows Server 2003." 99echo "" 100echo " If your card was supplied with your computer, or is a built-in device," 101echo " drivers may have been included on a special driver bundle CD shipped" 102echo " with the computer." 103echo "" 104echo " If you don't have a driver CD, you should be able to find a driver" 105echo " kit on the card or computer vendor's web site." --- 8 unchanged lines hidden (view full) --- 114echo " What files do I need?" 115echo "" 116echo " In most cases, you will need only two files: a .INF file and a .SYS" 117echo " file. The .INF file is a text file used by the Windows(r) installer to" 118echo " perform the driver installation. It contains information that tells" 119echo " the installer what devices the driver supports and what registry keys" 120echo " should be created to control driver configuration. The .SYS file" 121echo " is the actual driver executable code in Windows(r) Portable Executable" | 98echo " for Windows XP or Windows Server 2003." 99echo "" 100echo " If your card was supplied with your computer, or is a built-in device," 101echo " drivers may have been included on a special driver bundle CD shipped" 102echo " with the computer." 103echo "" 104echo " If you don't have a driver CD, you should be able to find a driver" 105echo " kit on the card or computer vendor's web site." --- 8 unchanged lines hidden (view full) --- 114echo " What files do I need?" 115echo "" 116echo " In most cases, you will need only two files: a .INF file and a .SYS" 117echo " file. The .INF file is a text file used by the Windows(r) installer to" 118echo " perform the driver installation. It contains information that tells" 119echo " the installer what devices the driver supports and what registry keys" 120echo " should be created to control driver configuration. The .SYS file" 121echo " is the actual driver executable code in Windows(r) Portable Executable" |
122echo " (PE) format. Note that sometimes the .INF file is supplied in unicode" | 122echo " (PE) format. Note that sometimes the .INF file is supplied in Unicode" |
123echo " format. Unicode .INF files must be converted to ASCII form with the" 124echo " iconv(1) utility before this installer script can use them." 125echo " Occasionally, a driver may require firmware or register setup" 126echo " files that are external to the main .SYS file. These are provided" 127echo " on the same CD with the driver itself, and sometimes have a .BIN" 128echo " extension, though they can be named almost anything. You will need" 129echo " these additional files to make your device work with the NDIS" 130echo " compatibility system as well." --- 34 unchanged lines hidden (view full) --- 165echo "" 166echo " Converting a driver requires the following utilities:" 167echo "" 168echo " - The FreeBSD C compiler, cc(1) (part of the base install)." 169echo " - The FreeBSD linker, ld(1) (part of the base install)." 170echo " - The objcopy(1) utility (part of the base install)." 171echo " - The ndiscvt(1) utility (part of the base install)." 172echo "" | 123echo " format. Unicode .INF files must be converted to ASCII form with the" 124echo " iconv(1) utility before this installer script can use them." 125echo " Occasionally, a driver may require firmware or register setup" 126echo " files that are external to the main .SYS file. These are provided" 127echo " on the same CD with the driver itself, and sometimes have a .BIN" 128echo " extension, though they can be named almost anything. You will need" 129echo " these additional files to make your device work with the NDIS" 130echo " compatibility system as well." --- 34 unchanged lines hidden (view full) --- 165echo "" 166echo " Converting a driver requires the following utilities:" 167echo "" 168echo " - The FreeBSD C compiler, cc(1) (part of the base install)." 169echo " - The FreeBSD linker, ld(1) (part of the base install)." 170echo " - The objcopy(1) utility (part of the base install)." 171echo " - The ndiscvt(1) utility (part of the base install)." 172echo "" |
173echo " If your happen to end up with a .INF file that's in unicode format," | 173echo " If you happen to end up with a .INF file that's in Unicode format," |
174echo " then you'll also need:" 175echo "" 176echo " - The iconv(1) utility." 177echo "" 178echo " If you have installed the X Window system or some sort of desktop" 179echo " environment, then iconv(1) should already be present. If not, you" 180echo " will need to install the libiconv package or port." 181echo "" --- 124 unchanged lines hidden (view full) --- 306} 307 308ndiscvt() { 309header 310echo " Driver file conversion" 311echo "" 312echo " The script will now try to convert the .INF and .SYS files" 313echo " using the ndiscvt(1) utility. This utility can handle most" | 174echo " then you'll also need:" 175echo "" 176echo " - The iconv(1) utility." 177echo "" 178echo " If you have installed the X Window system or some sort of desktop" 179echo " environment, then iconv(1) should already be present. If not, you" 180echo " will need to install the libiconv package or port." 181echo "" --- 124 unchanged lines hidden (view full) --- 306} 307 308ndiscvt() { 309header 310echo " Driver file conversion" 311echo "" 312echo " The script will now try to convert the .INF and .SYS files" 313echo " using the ndiscvt(1) utility. This utility can handle most" |
314echo " .INF files, however occasionally it can fail to parse some files" | 314echo " .INF files; however, occasionally it can fail to parse some files" |
315echo " due to subtle syntax issues: the .INF syntax is very complex," 316echo " and the Windows(r) parser will sometimes allow files with small" 317echo " syntax errors to be processed correctly which ndiscvt(1) will" 318echo " not. If the conversion fails, you may have to edit the .INF" 319echo " file by hand to remove the offending lines." 320echo "" 321echo -n " Press enter to try converting the files now: " 322read KEYPRESS --- 11 unchanged lines hidden (view full) --- 334} 335 336firmcvt() { 337 while : ; do 338header 339echo " Firmware file conversion" 340echo "" 341echo " If your driver uses additional firmware files, please list them" | 315echo " due to subtle syntax issues: the .INF syntax is very complex," 316echo " and the Windows(r) parser will sometimes allow files with small" 317echo " syntax errors to be processed correctly which ndiscvt(1) will" 318echo " not. If the conversion fails, you may have to edit the .INF" 319echo " file by hand to remove the offending lines." 320echo "" 321echo -n " Press enter to try converting the files now: " 322read KEYPRESS --- 11 unchanged lines hidden (view full) --- 334} 335 336firmcvt() { 337 while : ; do 338header 339echo " Firmware file conversion" 340echo "" 341echo " If your driver uses additional firmware files, please list them" |
342echo " below. When you're finished, just press enter to contiue. (If your" | 342echo " below. When you're finished, just press enter to continue. (If your" |
343echo " driver doesn't need any extra firmware files, just press enter" 344echo " to move to the next step.)" 345echo "" 346 echo -n " > " 347 read FIRMPATH 348 349 if [ ${FIRMPATH} ]; then 350 if [ ! -e ${FIRMPATH} ]; then --- 180 unchanged lines hidden (view full) --- 531 echo "" 532 echo " Be seeing you!" 533 echo "" 534 exit 535 ;; 536 *) 537 header 538 echo "" | 343echo " driver doesn't need any extra firmware files, just press enter" 344echo " to move to the next step.)" 345echo "" 346 echo -n " > " 347 read FIRMPATH 348 349 if [ ${FIRMPATH} ]; then 350 if [ ! -e ${FIRMPATH} ]; then --- 180 unchanged lines hidden (view full) --- 531 echo "" 532 echo " Be seeing you!" 533 echo "" 534 exit 535 ;; 536 *) 537 header 538 echo "" |
539 echo -n " Sorry, I didn't underatand that. Press enter to try again: " | 539 echo -n " Sorry, I didn't understand that. Press enter to try again: " |
540 read KEYPRESS 541 ;; 542 esac 543done 544exit | 540 read KEYPRESS 541 ;; 542 esac 543done 544exit |