This presentation gives introduction to kernel module programming with sample kernel module.
It helps to start with kernel programming and how it can be used to develop various types of device drivers.
Part 02 Linux Kernel Module ProgrammingTushar B Kute
Presentation on "Linux Kernel Module Programming".
Presented at Army Institute of Technology, Pune for FDP on "Basics of Linux Kernel Programming". by Tushar B Kute (http://tusharkute.com).
This course gets you started with writing device drivers in Linux by providing real time hardware exposure. Equip you with real-time tools, debugging techniques and industry usage in a hands-on manner. Dedicated hardware by Emertxe's device driver learning kit. Special focus on character and USB device drivers.
Part 01 Linux Kernel Compilation (Ubuntu)Tushar B Kute
Presentation on "Linux Kernel Compilation" (Ubuntu based).
Presented at Army Institute of Technology, Pune for FDP on "Basics of Linux Kernel Programming". by Tushar B Kute (http://tusharkute.com).
This is the presentation I gave on Linux kernel modules at the Linux Meetup in Austin, TX, on 2/5/2015.
http://www.meetup.com/linux-85/events/185946802/
Code referred to in the presentation: https://github.com/ereyes01/kernel-mod-prez
Part 02 Linux Kernel Module ProgrammingTushar B Kute
Presentation on "Linux Kernel Module Programming".
Presented at Army Institute of Technology, Pune for FDP on "Basics of Linux Kernel Programming". by Tushar B Kute (http://tusharkute.com).
This course gets you started with writing device drivers in Linux by providing real time hardware exposure. Equip you with real-time tools, debugging techniques and industry usage in a hands-on manner. Dedicated hardware by Emertxe's device driver learning kit. Special focus on character and USB device drivers.
Part 01 Linux Kernel Compilation (Ubuntu)Tushar B Kute
Presentation on "Linux Kernel Compilation" (Ubuntu based).
Presented at Army Institute of Technology, Pune for FDP on "Basics of Linux Kernel Programming". by Tushar B Kute (http://tusharkute.com).
This is the presentation I gave on Linux kernel modules at the Linux Meetup in Austin, TX, on 2/5/2015.
http://www.meetup.com/linux-85/events/185946802/
Code referred to in the presentation: https://github.com/ereyes01/kernel-mod-prez
Linux Kernel Booting Process (1) - For NLKBshimosawa
Describes the bootstrapping part in Linux and some related technologies.
This is the part one of the slides, and the succeeding slides will contain the errata for this slide.
This presentation briefs about the Linux Kernel Module and Character Device Driver. This also contains sample code snippets. Also briefs about character driver registration and access.
In order to understand HAL layers of Android Framework, having Linux device driver knowledge is important. Hence Day-2 of the workshop focuses on the same.
Some basic knowledges required for beginners in writing linux kernel module - with a description of linux source tree, so that the idea of where and how develops. The working of insmod and rmmod commands are described also.
LCU13: An Introduction to ARM Trusted FirmwareLinaro
Resource: LCU13
Name: An Introduction to ARM Trusted Firmware
Date: 28-10-2013
Speaker: Andrew Thoelke
Video: http://www.youtube.com/watch?v=q32BEMMxmfw
The U-Boot is an "Universal Bootloader" ("Das U-Boot") is a monitor program that is under GPL. This production quality boot-loader is used as default boot loader by several board vendors. It is easily portable and easy to port and to debug by supporting PPC, ARM, MIPS, x86,m68k, NIOS, Microblaze architectures. Here is a presentation that introduces U-Boot.
The accompanying demo (slide 15) can be found at https://vimeo.com/90534015
The presentation will cover Xen vs Xen Automotive gaps and analysis. We will elaborate technical solutions for the identified gaps:
* ARM architecture - support HW virtualization extensions for embedded systems
* Stability requirements
* RT Scheduler
* Rich virtualized peripheral support (WiFi, Gfx, MM, USB, etc.)
* Performance benchmarking
* Security
The audience is anyone interesting in building OSS based IVI systems. Attendees can expect the OSS stack detailed architecture, current status of the project, the challenges seen, road map and much more.
Linux Kernel Booting Process (1) - For NLKBshimosawa
Describes the bootstrapping part in Linux and some related technologies.
This is the part one of the slides, and the succeeding slides will contain the errata for this slide.
This presentation briefs about the Linux Kernel Module and Character Device Driver. This also contains sample code snippets. Also briefs about character driver registration and access.
In order to understand HAL layers of Android Framework, having Linux device driver knowledge is important. Hence Day-2 of the workshop focuses on the same.
Some basic knowledges required for beginners in writing linux kernel module - with a description of linux source tree, so that the idea of where and how develops. The working of insmod and rmmod commands are described also.
LCU13: An Introduction to ARM Trusted FirmwareLinaro
Resource: LCU13
Name: An Introduction to ARM Trusted Firmware
Date: 28-10-2013
Speaker: Andrew Thoelke
Video: http://www.youtube.com/watch?v=q32BEMMxmfw
The U-Boot is an "Universal Bootloader" ("Das U-Boot") is a monitor program that is under GPL. This production quality boot-loader is used as default boot loader by several board vendors. It is easily portable and easy to port and to debug by supporting PPC, ARM, MIPS, x86,m68k, NIOS, Microblaze architectures. Here is a presentation that introduces U-Boot.
The accompanying demo (slide 15) can be found at https://vimeo.com/90534015
The presentation will cover Xen vs Xen Automotive gaps and analysis. We will elaborate technical solutions for the identified gaps:
* ARM architecture - support HW virtualization extensions for embedded systems
* Stability requirements
* RT Scheduler
* Rich virtualized peripheral support (WiFi, Gfx, MM, USB, etc.)
* Performance benchmarking
* Security
The audience is anyone interesting in building OSS based IVI systems. Attendees can expect the OSS stack detailed architecture, current status of the project, the challenges seen, road map and much more.
Remote procedure call on client server computingSatya P. Joshi
Remote procedure call on client server computing, what is Remote procedure call on client server computing, Remote procedure call on java, Remote procedure call on client server computing
2010年 4月 2日(金)
FRT(Feedpath face to face Round Table)ではこれまでコラウドコンピューティングについてプラットフォームテクノロジーにフォーカスして多くのゲストスピーカーに登壇していただきました。今回のFRT Vol.5は、ビジネス視点からのクラウドにフォーカスします。Amazon Data Services Japan の小島英揮さん、ZDNet Japan編集長の冨田秀継をゲストスピーカとしてお迎えし、今年に入り多くのクラウドプレーヤーがIaaS, SaaS市場に本格的に参入してきている中でクラウドを利用したサービス、マーケティング、加えて企業におけるクラウドサービスの利用の展望を議論します。
Information on how PHP developers can implement data caching to improve performance and scalability. Presented at the West Suburban Chicago PHP Meetup on February 7, 2008.
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteTushar B Kute
Recent And Future Trends In Os
Linux Kernel Module Programming, Embedded Operating Systems: Characteristics of Embedded Systems, Embedded Linux, and Application specific OS. Basic services of NACH Operating System.
Introduction to Service Oriented Operating System (SOOS), Introduction to Ubuntu EDGE OS.
Designed By : Tushar B Kute (http://tusharkute.com)
Course 102: Lecture 25: Devices and Device Drivers Ahmed El-Arabawy
This lecture discusses the concept of Linux device Drivers and Kernel Loadable Modules in general. It shows how to handle them such as loading/unloading ,and querying for their info. It also discusses the role of device files and how it binds to device drivers in the Linux Kernel
Video for this lecture on youtube:
http://www.youtube.com/watch?v=5qhgMyPyvVE
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
Ahmed ElArabawy
- https://www.linkedin.com/in/ahmedelarabawy
This presentation is about -
embedded system programming,
What are device drivers?,
Types of device driver,
Recognizing device drivers,
Character Device Drivers,
Features of kernel programming,
Preparation assistance for Linux Device Driver. This doesn't fully provide the in and out of LDD3 book. Rather it advices outline for studying Linux Device Driver. It will be updated in the course of time if required.
Yocto Project Dev Day Prague 2017 - Advanced class - Kernel modules with eSDKMarco Cavallini
Excerpt of the lectures at Yocto Project Dev Day in Prague, 2017
During the advanced class Marco Cavallini ran this presentation about the creation of a Linux kernel module with eSDK.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Unit 8 - Information and Communication Technology (Paper I).pdf
Kernel module programming
1. Introduction to kernel modules
•
Objectives
• Understanding Kernel modules
• Writing a simple kernel module
• Compiling the kernel module
• Loading and unloading of modules
• Kernel log
• Module dependencies
• Modules vs Programs
2. Kernel modules
•
•
•
•
•
•
Linux kernel has the ability to extend at runtime the set of features
offered by the kernel.
This means that you can add functionality to the kernel while the system
is up and running.
Modules are pieces of code that can be loaded and unloaded into the
kernel upon demand.
For example, one type of module is the device driver, which allows the
kernel to access hardware connected to the system.
Without modules, we would have to build monolithic kernels and add
new functionality directly into the kernel image.
Besides having larger kernels, this has the disadvantage of requiring us to
rebuild and reboot the kernel every time we want new functionality.
3. Module utilities
•
•
•
•
•
modinfo <module_name>
• Gets information about the module: parameters, license, descriptions
and dependencies
insmod <module_name>.ko
• Load the given module. Full path of module is needed
rmmod <module_name>
• Unloads the given module
lsmod <module_name>
• Displays the list of modules loaded.
• Check /proc/modules file
modprobe
• Loads the kernel modules plus any module dependencies
4. Write simple module
#include <linux/module.h>
#include <linux/kernel.h>
static int __init hello_init(void)
{
printk(“Hello :This is my first kernel modulen");
return 0;
}
static void __exit hello_exit(void)
{
printk(“Bye, unloading the modulen");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_DESCRIPTION(“Sample module"); MODULE_AUTHOR(Vandana Salve");
MODULE_LICENSE("GPL");
5. Module explanation
•
•
Headers specific to the linux kernel <linux/xxx.h>
• No access to the usual C library
An initialization function
• Called when the module is loaded using insmod/modprobe tool
• Perform all the initialization functionality
• Returns an error code
• 0- success
• negative value on failure, errors defined in header file
• Declared by the module_init() macro
6. Module explanation
•
A cleanup function
• Called when the module is unloaded using rmmod tool
• Perform all the cleanup functionality
• Declared by the module_exit() macro.
•
Metadata information
– MODULE_DESCRIPTION
• Add description about the kernel module
– MODULE_AUTHOR
• Add the information about the author of the module
– MODULE LICENSE
• Add license for example GPL
7. Compiling a module
•
•
•
Kernel modules need to be compiled a bit differently from regular user
space apps.
To learn more on how to compile modules which are not part of the
official kernel, see file linux/Documentation/kbuild/modules.txt.
Option1: Inside the kernel tree
– Well integrated into the kernel configuration/compilation process.
– Driver can be build statistically if needed
8. Contd…
•
Option 2: Out of tree
– When the code is outside of the kernel source tree, in a different
directory.
– Advantage
• Easier to handle than modifications to the kernel itself.
– Disadvantage
• Not integrated to the kernel configuration/compilation process,
needs to be build separately
• driver cannot be built statistically if needed.
9. Compiling an out-of-tree module
•
When the kernel module code is
outside of the kernel source tree,
i.e. in a different directory.
Module source
/
path/to/module/
source
Hello.c
Hello.ko
Makefile
Kernel sources
/
path/to/kernel
/sources
Drivers
Kernel
Header files
Makefiles
10. Makefile for basic kernel module
•
KDIR := /path/to/kernel/sources
obj-m := hello.o
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make –C $(KDIR) M=$(PWD) clean
• Refer Documentation/kbuild/modules.txt for details
11. Overview of make & makefiles
•
•
•
•
•
•
The “make” program automates the building of software based on
specification of dependencies among the files.
“make” determines which pieces of a large program need to be
recompiled and issue commands to recompile them.
To use make, you must write a file called makefile.
A makefile is simple a way of associating short names, called ‘targets’,
with a series of commands to execute when the action is requested.
$make clean
– Target clean, performs actions that clean up after the compilation—
removing object files and resulting executable.
$make [all]
– Target all, performs action that compile the filesv
12. Kernel log
•
When a new module is loaded, related information is available in the
kernel log.
– The kernel keeps its messages in a circular buffer.
– Kernel log messages are available through the ‘dmesg’ command
– Kernel log messages can be seen in /var/log/messages and/or
/var/log/syslog file
13. Module dependencies
•
•
•
•
•
Some kernel module can depend on other modules, which need to be
loaded first.
Dependencies are described in
/lib/modules/<kernel-version>/modules.dep
This file is generated when you run make modules_install
sudo modprobe <module_name>
– Loads all the modules the given module depends on. Modprobe looks
into /lib/modules/<kernel-version> for the object file corresponding
to the given module
Sudo modprobe –r <module_name>
– Remove the module and all dependent modules, which are no longer
needed.
14. Applications Vs. Kernel modules
Application
• Performs single task from
beginning to end
• Application can call functions,
which it doesn’t define. The
linking stage resolves the external
references loading the
appropriate libraries. E.g libc for
‘printf’ function.
Kernel module
• Module registers itself to serve
the future request and its ‘main’
function terminates on loading.
• The module is linked only to the
kernel and it can only the
functions that are exported by
the kernel.
• No C library is linked with the
kernel.
15. Functions available to modules
•
•
•
•
In the hello world example, you might have noticed that we used a
function, printk() but didn't include a standard I/O library.
That's because modules are object files whose symbols get resolved upon
insmod'ing.
The definition for the symbols comes from the kernel itself; the only
external functions you can use are the ones provided by the kernel.
If you're curious about what symbols have been exported by your kernel,
take a look at /proc/kallsyms.
16. Passing command line arguments
•
•
•
Modules can take command line arguments, but not with the argc/argv
you might be used to.
To allow arguments to be passed to your module, declare the variables
that will take the values of the command line arguments as global and
then use the module_param() macro, to set the mechanism up.
At runtime, insmod will fill the variables with any command line
arguments that are given
17. Contd…
•
•
•
•
$insmod hello_2.ko int_param=50
The variable declarations and macros should be placed at the beginning of
the module for clarity.
The module_param() macro takes 3 arguments:
– the name of the variable,
– its type and permissions for the corresponding file in sysfs.
– Integer types can be signed as usual or unsigned.
If you'd like to use arrays of integers or strings see
– module_param_array() and
– module_param_string().
18. Advantages of modules
•
Modules make it easy to develop drivers without rebooting: load, test,
unload, rebuild & again load and so on.
•
Useful to keep the kernel size to the minimum (essential in embedded
systems). Without modules , would need to build monolithic kernel and
add new functionality directly into the kernel image.
•
Also useful to reduce boot time, you don’t need to spend time initializing
device that may not be needed at boot time.
•
Once loaded, modules have full control and privileges in the system.
That’s why only the root user can load and unload the modules.
19. Usage of modules
•
•
•
•
•
•
Character device drivers
Block device drivers
Network device drivers
File systems
Any type of device drivers handling the different types of devices such as
USB, I2C etc. etc.
Kernel modules can be used to implement any functionality needed
runtime on demand