Posts

Showing posts with the label Linux

Linux Device Drivers Part 9 - More about Symbol tables

Image
In this part we will discuss about following topics About undefined symbol error and steps to solve it Is it mandatory to export the symbols ? Location of symbol table About system.map file in Linux 1. About undefined symbol error and steps to solve it The most common and most frustrating failure in loading an LKM is unresolved symbol, like this: insmod: error inserting 'helloworld.ko': -1 Unknown symbol in module To debug this error, 1. Use nm utility 2. Know symbol definitions (in next slide) Lets say my module is helloworld.ko In order to display symbol table, we use following command. $nm helloworld.ko. Output of this command is 00000000 r ____versions 0000002c r __mod_author22 00000000 r __mod_description24 00000020 r __mod_license23 00000040 r __mod_srcversion30 00000080 r __mod_vermagic5 00000063 r __module_depends 00000000 D __this_module 00000000 r _rheldata 00000000 T cleanup_module 00000000 B g_valu

Linux Device Drivers Part - 6 : Loading Listing and Unloading Kernel Modules

Image
In this part , we are going to discuss about 1. Loading Kernel modules 2. Listing  kernel modules 3. Unloading kernel modules Before going ahead with these topics, I strongly recommend you to watch my earlier videos on Linux Device Driver Part 1 to 5. Fine, lets start with our first topic 1. Loading Kernel modules  In earlier session " Linux Device Drivers Part-5 ", we learnt how to build a sample helloworld Linux Kernel module. In this session we will see how to load that sample module into the kernel. We have two kernel utilities which does the trick of loading modules into the kernel. We have two utilities to perform this task 1. insmod 2. modprobe In following slides we will discuss about these utilities, their syntax and usage So,What is insmod and what does it do ? Insmod is a kernel utility that installs loadable Kernel modules into kernel.         It actually loads the module code and data into the kernel land, it links any unresolved sym

Linux Device Drivers Part - 5 : Building and Compiling Kernel Moduels

Image
In this part, we will discuss about 5 topics Linux Device Driver Example References Setting up Environment for compiling Kernel modules.  Implementing Helloworld Kernel module and Macros used in it. Creating Makefile to compile Helloworld Kernel module Compilation and Kernel object generation of Helloworld Kernel module 1. Linux Device Driver Example references Before proceeding further, make sure you have watched my earlier videos  on "Linux Device drivers"  Part 1 to Part 4. As mentioned in my earlier videos, most of the concepts  discussed in these sessions are  derived from famous O'Rielly Linux Device Drivers  3rd edition. To demonstrate Kernel programming concepts, I will be using the O'Reilly  sample programs which are available on below site to download. http://examples.oreilly.com/linuxdrive3 Download these files and save it to your harddrive. Compiling, loading and modifying these examples are good way to improve your under

How Linux Boots ? Linux Boot-up procedure made easy.

Image
If you are new to Linux and interested in Linux Boot process, you have reached the correct web-page.This article is for you. Linux is a Open Source Operating System  developed by many programmers around the clock. Its a dynamically evolving Operating system used in various devices like Mobiles, Personal computers, Laptops, tablets etc. If you are using a Linux PC (or a device)  in your daily life, it’s important to know how it boots and what steps are involved in its boot up process. The moment you switch on a Linux device, you may notice various screen displayed during the initial stage of Linux Boot-up. Finally you will end up with a log-in prompt. Are you curious to know what exactly happens between the power-up and the display of Login prompt ?  If you are, then lets see how Linux boots. Linux Boot-up process involves mainly 4 steps: 1.    BIOS 2.    MBR (First Stage Bootloader) 3.    Kernel Loader (Second Stage Boot loader) 4.    Kernel 1. BIOS (Basic Input/Output

Installing Oracle VirtualBox Applicaiton on Windows 7

Image
Before starting this tutorial, please take backup of your valuable data. MrTechpathi-Tutorials takes no repsonsibility for any damage or loss of your valuable data. Many wish to install Linux operating system on PC or laptop. First we think about installing as a secondary operating system along with Windows 7. Later, we feel difficult to switch between Linux and Windows because we need to reboot PC for doing this. How to overcome this issue ? Cant we install Linux in Windows 7 ? Yes we can. But we need an application which will allow us to complete this task. There are many such applications available in market. I have chosen Oracle VM VirtualBox Manager. What exactly is a VirtualBox ? VirtualBox is a general-purpose full virtualizer for x86 hardware, targeted at server, desktop and embedded use. Lets see how to install .. First,open your favourite web-brower and copy past this url in address bar of your web-browser. https://www.virtualbox.org/wiki/Downloads

Linux Device Drivers Part - 1 : What is Linux Device Driver ?

Image
From today, we  will be discussing about Linux Device Drivers which are very useful for Device Driver programmers. Linux has more future and those who learn more on Linux Kernel and Device drivers will benefit a lot. Linux is one of the best open source operating system which is available to everyone. It is majorly used operating system in smart phones and Embedded Systems these days. Yes all, Android phones have Open source Linux Operating system in it which is customized according to Smartphone vendor needs. So, lets start with Linux Device Driver Programming.. Scope of this Tutorial To gain in depth knowledge on Linux Device Driver. From now on, for your convenience, we will be discussing this topic part by part. In this part we will know about What is a Linux Device Driver ? So What is a Linux Device Driver ? Linux Device drivers are distinct “black boxes” that make a particular piece of hardware respond to a well-defined internal programming interface.They c