This document provides instructions for creating a kernel module that makes a pseudo-file in the Linux /proc filesystem. It explains how to write a module that uses the create_proc_read_entry() and remove_proc_entry() functions to register a proc file that displays the value of the jiffies kernel variable. Sample code is provided for a minimal module template and a non-trivial example module that creates a /proc/jiffies file to read jiffies.
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.
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.
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)
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).
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.
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.
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)
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 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.
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
This is a short introduction to some basic concepts about device drivers on Linux, and does not get into the nuts and bolts of it; uses a serial driver as an example, and how does it fit within the TTY layer. Includes code walk-through.
Introduction to Linux Kernel Development
This talk will give you an insight on how the developers develop the kernel. This will also guide you through basic git principals and introduce you to how kernels work and why they are necessary in everyday work. An interesting talk that will also show you how to write and send a basic but important patch and get it accepted.
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.
A story of how we went about packaging perl and all of the dependencies that our project has.
Where we were before, the chosen path, and the end result.
The pitfalls and a view on the pros and cons of the previous state of affairs versus the pros/cons of the end result.
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 is a presentation I prepared for a local meetup. The audience is a mix of web designers and developers who have a wide range of development experience.
linux device drivers: Role of Device Drivers, Splitting The Kernel, Classes of
Devices and Modules, Security Issues, Version Numbering, Building and Running Modules
Kernel Modules Vs. Applications, Compiling and Loading, Kernel Symbol Table,
Preliminaries, Interaction and Shutdown, Module Parameters, Doing It in User Space.
Kernel vulnerabilities was commonly used to obtain admin privileges, and main rule was to stay in kernel as small time as possible! But nowdays even when you get admin / root then current operating systems are sometimes too restrictive. And that made kernel exploitation nice vector for installing to kernel mode!
In this talk we will examine steps from CPL3 to CPL0, including some nice tricks, and we end up with developing kernel mode drivers.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
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.
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
This is a short introduction to some basic concepts about device drivers on Linux, and does not get into the nuts and bolts of it; uses a serial driver as an example, and how does it fit within the TTY layer. Includes code walk-through.
Introduction to Linux Kernel Development
This talk will give you an insight on how the developers develop the kernel. This will also guide you through basic git principals and introduce you to how kernels work and why they are necessary in everyday work. An interesting talk that will also show you how to write and send a basic but important patch and get it accepted.
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.
A story of how we went about packaging perl and all of the dependencies that our project has.
Where we were before, the chosen path, and the end result.
The pitfalls and a view on the pros and cons of the previous state of affairs versus the pros/cons of the end result.
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 is a presentation I prepared for a local meetup. The audience is a mix of web designers and developers who have a wide range of development experience.
linux device drivers: Role of Device Drivers, Splitting The Kernel, Classes of
Devices and Modules, Security Issues, Version Numbering, Building and Running Modules
Kernel Modules Vs. Applications, Compiling and Loading, Kernel Symbol Table,
Preliminaries, Interaction and Shutdown, Module Parameters, Doing It in User Space.
Kernel vulnerabilities was commonly used to obtain admin privileges, and main rule was to stay in kernel as small time as possible! But nowdays even when you get admin / root then current operating systems are sometimes too restrictive. And that made kernel exploitation nice vector for installing to kernel mode!
In this talk we will examine steps from CPL3 to CPL0, including some nice tricks, and we end up with developing kernel mode drivers.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
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
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
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
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.
A Strategic Approach: GenAI in EducationPeter 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.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Pride Month Slides 2024 David Douglas School District
lesson03.ppt
1. How to make a pseudo-file
As a follow-up to our first lab, we
examine the steps needed to
create our own ‘/proc’ file
2. The ‘extensibility’ imperative
• A modern OS needs the ability to evolve
• It will need to support new devices
• It will need to allow ‘bugs’ to be repaired
• It will need to permit performance gains
• Otherwise: suffer early obsolescence!
4. ‘Open Source’
• Source text for the Linux kernel is on disk
(usual directory-location is ‘/usr/src/linux’)
• Majority of the sources are written in ‘C’
(so ‘portable’ across CPU architectures)
• Some are written in assembly languages
(for nearly twenty different architectures)
• Files are grouped into major categories
(kernel, mm, fs, net, ipc, lib, drivers, init)
• You could edit and recompile your kernel
5. Installable kernel modules
• Great mechanism for kernel ‘extensibility’
• Neat tool for studying how kernel works
• Kernel can be modified while it’s running
• Unnecessary to recompile and then reboot
• But inherently unsafe: programming bugs
in the kernel can cause system crashes!
6. Some ‘superuser’ privileges
• Since modifying a running kernel is ‘risky’,
only authorized ‘system administrators’ are
normally allowed to install kernel modules
• But our systems are specially configured
to permit you to install or remove modules
• This is purely for ‘educational’ purposes
(so you should use this privilege wisely)
7. Linux module structure
• Two ‘module administration’ functions are
mandatory components in every module
plus
• Appropriate ‘module service’ functions and
their supporting kernel data-structures are
optional components in particular modules
also
• Recent kernels require a Module License!
8. A minimal module-template
#include <linux/module.h>
int init_module( void )
{
// code here gets called during module installation
}
void cleanup_module( void )
{
// code here gets called during module removal
}
MODULE_LICENSE(“GPL”);
9. How to compile a module
• You could directly invoke the C-compiler:
$ gcc –c –O –D__KERNEL__ -DMODULE
–I/lib/modules/2.4.26/build/include mod.c
• OR: you can use the ‘make’ utility:
$ make mod.o
10. The ‘printk()’ function
• Kernel modules cannot call any functions
in the C runtime library (e.g., ‘printf()’)
• But similar kernel versions of important
functions are provided (e.g., ‘printk()’)
• Syntax and semantics are slightly different
(e.g., priority and message-destination)
• Capabilities may be somewhat restricted
(e.g., printk() can’t show floating-point)
12. How to install and remove
root# /sbin/insmod hello.o
root# /sbin/rmmod hello
13. A non-trivial module-example
• Let’s see how we can use kernel functions
to create our own ‘/proc’ file
• Easy if we use ‘create_proc_read_entry()’
during module-initialization (and then use
‘remove_proc_entry()’ during cleanup)
• Prototypes in the <linux/proc_fs.h> header
• We’ll show the current value of a volatile
kernel variable, named ‘jiffies’
14. jiffies
• unsigned long volatile jiffies;
• global kernel variable (used by scheduler)
• Initialized to zero when system reboots
• Gets incremented when timer interrupts
• So it counts ‘clock-ticks’ since cpu restart
• ‘tick-frequency’ is architecture dependent
15. Writing the ‘jiffies.c’ module
• We need to declare a name for pseudo-file
static char modname[ ] = “jiffies”;
• We need to define a ‘proc_read’ function
(see code on the following slide)
• We need to ‘register’ our filename, along
with its ‘read’ method, in ‘init_module()’
• We need to ‘unregister’ our pseudo-file in
‘cleanup_module()’
16. Our module’s ‘read’ method
static int
my_proc_read( char *buf, char **start,
off_t off, int count, int *eof, void *data )
{
return sprintf( buf, “jiffies=%lun”, jiffies );
}
19. In-class exercise #1
• Use an editor (e.g., ‘vi’) to create a source
file in C (named ‘jiffies.c’) for your module
• Use the ‘make’ command to compile your
module’s source-file into an object-file
• Use the ‘insmod’ command to install your
module object-file into the running kernel
• Use the ‘cat’ command to display ‘jiffies’
• Then use ‘rmmod’ to remove your module
20. Makefile
• We need it to automate module compiles
• Otherwise we type a VERY long command
• To compile ‘jiffies.c’ type: $ make jiffies.o
• Our Makefile defines some ‘implicit rules’
• ‘make’ works by doing pattern-matching
23. ‘Makefile’ is on class website
• You can download the ‘Makefile’ from our
website: http://cs.usfca.edu/~cruse/cs326/
• Put the ‘Makefile’ in your current working
directory (along with your module source)
• Then you can compile by typing this short
command: $ make jiffies.o
24. In-class exercise #2
• Use your knowledge of standard C library
functions (e.g., open(), read(), close() ) to
write an application-program (name it
‘showjifs.cpp’) which reads the information
from your ‘proc/jiffies’ pseudo-file and then
prints it on the screen
• Use a program-loop to re-read the pseudo
file multiple times
• How rapidly does ‘jiffies’ value increase?