Embedded-Linux-Device-Driver/C2/Installation-of-Linux-kernel-packages/English
Visual cue | Narration |
Slide 1:
Welcome slide: |
Welcome to the spoken tutorial on Installation of Linux kernel packages. |
Slide 2:
Learning objectives:
|
In this tutorial, we will learn how to
|
Slide 3:
System Requirements:
|
To record this tutorial, I am using,
|
Slide 4:
Prerequisites: To follow this tutorial, you should be familiar with
|
To follow this tutorial, you should be familiar with
If not, then go through the C/C++ and Linux spoken tutorials on this website. |
Slide 5:
VirtualBox Installation
|
|
slide 6:
What is Linux kernel? |
|
slide 7:
Kernel Modules |
|
Click on ubuntu_18.04_LTS
Type the password |
Start your Ubuntu 18.04 LTS virtual system.
Type the system password to login. |
Press Alt+Ctrl+T
Type gcc -version Press Enter Highlight Command ‘gcc’ not found. |
Open the terminal by pressing Alt+Ctrl+T keys simultaneously.
We require the gcc compiler to compile the kernel’s module. Let us check whether the gcc compiler is installed or not. Type gcc space hyphen hyphen version and press Enter. As it is not installed, you will see an error as shown here. Otherwise you will see the gcc version that has been installed. |
Type >> clear
Press Enter |
Clear the screen. |
Type sudo apt update
Press Enter Type the password Press Enter |
Let us install the gcc compiler,
Type sudo space apt space update and press Enter. If asked for the password, type the administrative password. This command will update Ubuntu's default repositories. |
Type sudo apt install build-essential
Highlight the command Press Enter |
Next, type sudo space apt space install space build hyphen essential.
This package is used to install GCC/g++ compilers, libraries and utilities such as make. Press Enter. |
Show the output.
Type y Press Enter |
We can see the installation process has begun.
Press 'Y' whenever there is a prompt during installation, to confirm the configuration. And press Enter. Now the installation of gcc compiler is completed. |
Type clear
Press Enter |
Clear the screen. |
Type gcc --version
Press Enter Highlight 7.4.0 |
Let us check the version of the installed gcc compiler.
Type gcc space hyphen hyphen version and press Enter. Here, you can see the installed gcc compiler version. |
Type clear
Press Enter |
Clear the screen |
Type uname -r
Press Enter. Highlight 5.0.0-27-generic Highlight 5 Highlight 0 Highlight 0 Highlight -31 Highlight generic |
Let us now check the kernel version of the system.
Type uname space hyphen r and press Enter. Here, you can see the kernel version of the system. Five indicates the kernel version. Zero indicates the kernel major revision. Zero indicates the kernel minor revision. Thirty one indicates the number of fixed bugs. generic means general usage kernel. It is used for Desktop installation. You may get a different version depending upon your Linux OS. |
Type clear
Press Enter |
Clear the screen. |
Type sudo su
Press Enter Type password Press Enter Highlight the prompt |
Type sudo space su.
su command stands for superuser or root user. Linux allows only the superuser to run some commands. Press Enter. If asked for the password, type the system password and press Enter. We can see the command prompt changed to root user. |
Type >> apt install linux-headers-$(uname -r)
Press Enter |
To compile the Linux device driver, we need to have kernel header files installed in the system.
Let us install the kernel header files. Type apt space install space linux hyphen headers hyphen dollar in brackets uname hyphen r. And press Enter |
Point to linux-headers
Highlight 0-upgraded Highlight 0-newly installed |
The files are already installed on the system.
So, you can see the output as linux-headers-5.0.0-31-generic is already the newest version. zero upgraded, zero newly installed. |
Type >> clear
Press Enter |
Clear the screen. |
Type >> dpkg-query -s linux-headers-$(uname -r)
Press Enter |
Let us see the details of the kernel headers.
Type dpkg hyphen query space hyphen s space linux hyphen headers hyphen dollar in brackets uname space hyphen r. And press Enter. |
Highlight package
Highlight status Highlight Installed-size |
This field shows the package of header files.
The status field indicates that the header files are installed or not. The Installed-size field contains the size of installed kernel header files in bytes. |
Highlight Architecture
Highlight version |
This field shows the architecture of our system.
The Version field shows the version of the header files. |
Type uname -r
Press Enter |
As already learnt, to see the kernel version, type uname space hyphen r and press Enter. |
Highlight version
Highlight 5.0.0-27-generic Highlight version: 5.0.0-27 |
Here, you can see that the kernel header files version and the kernel version are the same.
Make sure that both versions are the same in your system. |
Type >> clear
Press Enter |
Clear the screen. |
Type lsmod.
Press Enter Show the output Highlight lsmod |
Let us see the command that shows the kernel’s modules.
Type lsmod and press Enter. This command shows the modules currently loaded in the kernel. These modules extend the kernel’s functionality. |
Type clear
Press Enter |
Clear the screen |
Type ls -l /dev
press Enter Show the output Highlight /dev |
Type ls space hyphen l space slash dev and press Enter.
This command displays the list of files located under the dev directory. All the devices are located in the dev directory. |
Highlight c
Highlight b Highlight oct 16 08:47 |
c indicates that it is a character device.
And block devices are indicated by b. The last two entries shows the last modification date and time of a file. |
Type clear
Press Enter |
Clear the screen |
Type ls -l/dev/tty
Press Enter Highlight tty Point to root, tty Highlight rw-rw-rw- |
Type ls space hyphen l space slash dev slash tty and press Enter.
The tty is a character device for the first uart serial port. Here, the owner is root, and the group is tty. It indicates that the owner, the group and others have read and write permissions. Another example of a character device is a keyboard device. |
Type ls -l /dev/sda
Press Enter Highlight b Point to root, disk Highlight rw-rw- |
Type ls space hyphen l space slash dev slash sda and press Enter.
It is a block device indicated by b. All mass storage devices such as sda are block devices. Here, the owner is root, and the group is disk It indicates that the owner and the group have read and write permissions. These devices support random access. |
Type clear
Press Enter |
Clear the screen. |
Type ls -l /sys/class/net
Press Enter Show the output |
Type ls space hyphen l space slash sys slash class slash net and press Enter.
Here, you can see the list of network devices located in this directory. |
Highlight output | Network devices are also known as packet devices.
Network devices simply transmit or receive the packets. This is normally a physical device like ethernet card. |
Type clear
Press Enter |
Clear the screen. |
Type exit
Press Enter |
Type exit and press Enter.
You can see the command prompt changed to regular user. |
Type exit
Press Enter |
To go back to user login, type exit and press Enter. |
With this, we come to the end of this tutorial. Let us summarize. | |
Slide 6:
Summary:
|
In this tutorial, we learnt to
|
Assignment:
|
As an assignment,
|
Slide 7:
About Spoken Tutorial Project: |
|
Slide 8:
Spoken Tutorial workshops: |
The Spoken Tutorial Project Team conducts workshops and gives certificates.
For more details, please write to us. |
Slide 9:
Forum questions: |
|
Slide 10:
Forum for specific questions: |
|
Slide 11:
|
|
Slide 12:
Acknowledgment: |
Spoken Tutorial Project is supported by MHRD, Government of India. |
Slide 13:
Thank you slide: |
This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay.
This is Mayuri Panchakshari signing off. Thanks for watching. |