Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to compile and install Linux Nic driver

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "Linux network card driver how to compile and install", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Linux network card driver how to compile and install" bar!

Compile the module with the network card of D-Link530.

Since many Nic driver modules have been built in the default kernel of Linux, it is necessary to confirm whether the Nic chip is supported before compiling the Nic module.

The chipset of the D-Link530 network card is the famous via-rhine (sometimes written as viarhine). First find out if there is a module with this network card. If so, your network card has been supported, so you can skip the compilation process and load the module directly.

1. Check the kernel version first, because different versions of modules have different paths.

Uname-r

two。 Path of the kernel module

Cd / lib/modules/ `uname-r` / kennel/drivers/net

The above is the path of version 2.4

Cd / lib/modules/ `uname-r` / net

The above is the path of version 2.2

3. Query module

Ls-l via*

If you do not know that the Nic has been detected by Linux, you can test it with the following methods:

Dmesg | grep eth

If detected, there is no need to compile the kernel module. In case it cannot be detected, the compilation must be carried out.

1. Download the network card driver module.

two。 Make sure that the required packages exist: because the driver needs to be compiled with the kernel, kernel source or kernel header data is used, and the compiler is also needed to determine whether the following packages already exist in Linux (take Red Hat 9 as an example):

Kernel-source-2.4.20-18.9

Kernel-2.4.20-18.9

Gcc-3.2.2-5

Make-3.79.1-17

If you don't have the above packages, take out the CD and install them into Linux.

Note: since many kernel modules default to the kernel source directory / usr/src/linux to get the required information, but at present, many Linux use the / usr/src/linux-2.4 directory to link, so you will often find the error message that the file can not be found. Therefore, you can link directories in the following ways:

Cd / usr/src

Ln-s linux-2.4.20-18.9 linux

3. Compile the downloaded module

Download the complete driver source code, such as the file name: dlkfet-4.24.tar.gz

1. Place the obtained file under / tmp and extract the file

Cp dlkfet-4.24.tar.gz / tmp

Cd tmp

Tar-zxvf dlkfet-4.24.tar.gz

Cd dlkfet-4.24

two。 Start compilation

Make

A file module is generated: rhinefet.o, move it to the directory where the module is placed, and execute depmod-a.

Cp rhinefet.o / lib/modules/ `uname-r` / kennel/drivers/net

Depmod-a

4. Module testing

After the kernel module is compiled, it is necessary to test whether it can run properly, because we have already run depmod-a, so we load the module directly with modprobe.

1. Load module test

Modprobe rhinefet.o

Note that do not write the full name,. O do not need to write. Rhinefet is just compiled rhinefet.o.

Lsmod

two。 Set the boot load touch block

Is the editor / etc/modules.conf

Vi / etc/modules.conf

Add the following line to the file:

Alias eth0 rhinefet

3. Restart to see if the module starts properly

Sync;sync;reboot

Above we use the rhinefet module, if not this name, please modify it according to your actual situation. The next step is to test whether the network card is working properly.

Thank you for your reading, the above is the content of "how to compile and install the Linux network card driver". After the study of this article, I believe you have a deeper understanding of how to compile and install the Linux network card driver. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report