Realtek : Default kernel ethernet module compilation

  • In this section, you are going to learn

  • How to load ethernet driver

  • Terminology

#

Version

Freebsd

14.1.0

  • Architecture

test:~$
test:~$

Source path :

c1

Bin path :

c2

List of C files

c3

NM output :

c4

Load file :

c5

re0@pci0:43:0:0:        class=0x020000 rev=0x15 hdr=0x00 vendor=0x10ec device=0x8168 subvendor=0x17aa subdevice=0x38f4
vendor     = 'Realtek Semiconductor Co., Ltd.'
device     = 'RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller'
class      = network
subclass   = ethernet
  • Build the Ethernet module(if_re) as a separate module by modifying the GENERIC kernel configuration file

test:~$ #device re
  • Source code path

test:~$ cd /usr/src/sys/dev/re/
  • Add prints in if_re.c file

test:~$ cd /usr/src/sys/dev/re/

test:~$ vim if_re.c
  • Build it and install it

test:~$ make -j4 -DNO_CLEAN kernelbuild KERNCONF=MYKERNEL

test:~$ make -j4 installkernel KERNCONF=MYKERNEL

test:~$ reboot
  • Check prints in dmesg log

test:~$ vim  /var/log/messages
test:~$
test:~$
test:~$
test:~$
test:~$
test:~$
test:~$
test:~$
test:~$
test:~$
test:~$
test:~$