ndiswrapper invalid driver

Asked by Kẏra

So i'm trying to install the drivers for my D-Link DWL-G520Mand this is what happened:

danny@danny-desktop:~$ ndiswrapper -l
danny@danny-desktop:~$ ndiswrapper -i /media/hda3/danny/net5513.inf
couldn't create /etc/ndiswrapper/net5513: Permission denied at /usr/sbin/ndiswrapper-1.9 line 152.
danny@danny-desktop:~$ sudo ndiswrapper -i /media/hda3/danny/net5513.inf
[sudo] password for danny:
installing net5513 ...
forcing parameter MapRegisters from 256 to 64
forcing parameter MapRegisters from 256 to 64
forcing parameter MapRegisters from 256 to 64
forcing parameter MapRegisters from 256 to 64
danny@danny-desktop:~$ ndiswrapper -i /media/hda3/danny/ar5513.sys
couldn't create /etc/ndiswrapper/ar5513.sys: Permission denied at /usr/sbin/ndiswrapper-1.9 line 152.
danny@danny-desktop:~$ sudo ndiswrapper -i /media/hda3/danny/ar5513.sys
installing ar5513.sys ...
couldn't find SourceDisksFiles section - continuing anyway...
couldn't get manufacturer section - installation may be incomplete
danny@danny-desktop:~$ ndiswrapper -l
ar5513.sys : invalid driver!
net5513 : driver installed
        device (168C:0020) present

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Rouben
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Rouben (rouben) said :
#1

It looks like ndiswrapper didn't like the INF file you gave it. INF files are extremely important for ndiswrapper; using the wrong INF file may even cause your system to crash (happened to me several times). It's strongly recommended to download Windows XP drivers directly from the manufacturer's website.

By the way, have you tried the open source madwifi driver?
sudo modprobe ath_pci

Revision history for this message
Kẏra (thekyriarchy) said :
#2

Yes. My card is not supported by madwifi. I downloaded the drivers directly from the companies website and if you'll notice the inf file worked just fien, the sys file was the one giving me trouble.

Revision history for this message
Rouben (rouben) said :
#3

I was actually referring to the message "couldn't find SourceDisksFiles section - continuing anyway...". The "SourceDisksFiles" section should be in the INF file, and the INF file is just a text file.

By the way, are there any other INF files in the driver package?

Another suggestion: have you tried the subversion (development) version of madwifi? It may work for you and may be easier to set up than ndiswrapper... Try following the instrictions under the heading "Install Wireless" on this page: https://wiki.ubuntu.com/MacBookPro/SantaRosa

Note that you can't run both madwifi and ndiswrapper at the same time. I suggest removing ndiswrapper before trying to build madwifi from source.

Revision history for this message
Kẏra (thekyriarchy) said :
#4

Nope, that's the only INF file.

Madwifi does not support it yet http://madwifi.org/wiki/Compatibility/D-Link#DWL-G650M

Revision history for this message
Rouben (rouben) said :
#5

Hmm, OK, well in that case let's ignore this error and hope for the best... :)

1. Install ndiswrapper if it's not already installed. Make sure the ndiswrapper kernel module isn't loaded. "sudo rmmod ndiswrapper"

2. Check the currently installed drivers with "sudo ndiswrapper -l" and make sure that there are no drivers install. If there is a driver installed, remove it by running the command "sudo ndiswrapper -e <driver>", for example "sudo ndiswrapper -e net5513"

3. Reinstall the Windows driver under ndiswrapper. Please make sure to give ndiswrapper the INF file, and not the SYS file. In other words, do NOT run "ndiswrapper -i net5513.sys", instead you need to specify the INF file that this driver came with. For example if the INF file is called net5513.inf, then you need to run this command "sudo ndiswrapper -i net5513.inf".

4. If all goes well in this step, try "sudo modprobe ndiswrapper" to load the kernel module. This will either result in a crash or will make your wireless card work.

Hopefully you will not get any errors, since the last time you tried this you referenced the SYS file, and not the INF file. Also note that sometimes ndiswrapper works fairly slow. Nothing much can be done about that, other than trying to download other drivers for different manufacturers that use the same wireless chip. Either way, please let me know how this goes and good luck!

Revision history for this message
Kẏra (thekyriarchy) said :
#6

Wow it worked! Thank you so much! I'd still like to know though, why i had to do "sudo modprobe ndiswrapper" and also why i didn't need to install the .sys file after the .inf file like other instructions tell me to.

Again, thank you so much!

Revision history for this message
Rouben (rouben) said :
#7

OK, I'm glad it's working. Hopefully it will be stable on your computer. Glad to be of assistance! :)

The command "sudo modprobe ndiswrapper" is the one that actually activates the ndiswrapper driver. Linux drivers are known as kernel modules, or just modules. What ndiswrapper does, is that it sort of works like WINE, where it takes a Windows driver and makes it work under Linux, just like WINE takes Windows programs (EXE and DLL files) and makes them run under Linux... so ndiswrapper acts like a translator between the Linux OS and the Windows driver. In fact that's the reason why it's called ndiswrapper. NDIS is the driver file standard used for network drivers in Windows, and the word "wrapper" is used to describe software that translates one set of standards to another, in this case NDIS to Linux. The INF file that comes with the driver tells ndiswrapper how to use the actual driver, which is the SYS file. This is why getting the correct INF file is so important, because it tells ndiswrapper what to do with the SYS file, which is the actual driver.

I hope this makes sense and answers some of your questions. Enjoy your wireless connection (hopefully it will be stable) and feel free to ask more questions if you have any!

Take care!

Revision history for this message
Kẏra (thekyriarchy) said :
#8

Thanks, this stuff is really great to know. but how can the INF file tell ndiswrapper how to use the SYS file is we never installed the SYS file?

Also, i think i keep losing the connection every time i restart my computer... I'm not sure because this might be because of other issue but since we got my wireless working i've restarted my computer twice and each time i've lost the connection and had to go through the steps you gave me all over again

Revision history for this message
Best Rouben (rouben) said :
#9

Oh, you definitely shouldn't have to go through all the steps on every reboot... Just the last one, "sudo modprobe ndiswrapper". If you don't feel like doing this manually every time you reboot, edit the file /etc/modules and add ndiswrapper to the bottom of the file.

1. Make sure that ndiswrapper is properly configured using the INF file. The best way to check is to try "sudo modprobe ndiswrapper" and making sure that the wireless card works.
2. Run "sudo gedit /etc/modules" (you don't have to use gedit, any other text editor, such as nano will do). If you're not running the GUI (Gnome or KDE), then you can't use gedit, because it's a GUI editor. Use nano instead: "sudo nano /etc/modules".
3. Add the word "ndiswrapper" (without the quotes) to the bottom of the list... Let's say this is the file before you edit it: http://pastebin.com/m74865da0 and this is the file after you edit it: http://pastebin.com/d6461142a

That's it! Now when you reboot, ndiswrapper should load automatically and you should be able to use your wireless card.

The INF file is essentially an installer for SYS (driver) files. It's too complicated to explain here, but Wikipedia has a nice article, and some links to documentation on INF files from Microsoft and other websites: http://en.wikipedia.org/wiki/INF_file

Revision history for this message
Kẏra (thekyriarchy) said :
#10

Thanks Rouben Tchakhmakhtchian, that solved my question.