Most of this session will focus on Kernel Module Programming. We will briefly talk about the interaction of different layers of operating system from userspace to kernel space. Starting from simple Hello World kernel modules, we will learn the development of more sophisticated modules related to device drivers and interrupt handlers. We will also briefly touch upon the shell scripts and how they can be used to extract system level information. Since, this will be a hands on session, attendees are expected to try the examples on their machines. Basic understanding of operating systems and C programming is expected for the tutorial.
The document provides an introduction to Linux kernel modules. It discusses that kernel modules extend the capabilities of the Linux kernel by executing code as part of the kernel. It then describes the anatomy of a kernel module, including initialization and cleanup functions. The document demonstrates a simple "hello world" kernel module example and how to build, load and unload kernel modules. It also introduces the idea of character device drivers as a more advanced kernel module example.
This document provides an overview of Linux internals and networking concepts covered in 3 sentences or less:
It introduces Linux internals topics like processes, memory management, and virtual file systems. It also discusses networking concepts and provides a brief history of operating systems development. The document contains various sections on Linux components, kernel subsystems, virtual file systems, and transitioning to systems programming.
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).
Getting started with setting up embedded platform requires audience to understand some of the key aspects of Linux. This presentation deals with basics of Linux as an OS, Linux commands, vi editor, Shell features like redirection, pipes and shell scripting
Arm device tree and linux device driversHoucheng Lin
This document discusses how the Linux kernel supports different ARM boards using a common source code base. It describes how device tree is used to describe hardware in a board-agnostic way. The kernel initializes machine-specific code via the device tree and initializes drivers by matching compatible strings. This allows a single kernel binary to support multiple boards by abstracting low-level hardware details into the device tree rather than the kernel source. The document also contrasts the ARM approach to the x86 approach, where BIOS abstraction and standardized buses allow one kernel to support most x86 hardware.
Linux is an operating system or a kernel. It is distributed under an open source license. Its functionality list is quite like UNIX. Linux is an operating system or a kernel which germinated as an idea in the mind of young and bright Linus Torvalds when he was a computer science student. The main advantage of Linux was that programmers were able to use the Linux Kernel to design their own custom operating systems. With time, a new range of user-friendly OS's stormed the computer world. Now, Linux is one of the most popular and widely used Kernel, and it is the backbone of popular operating systems like Debian, Knoppix, Ubuntu, and Fedora.
The Linux booting process begins when the user turns on the computer. The BIOS loads and runs a power-on self-test before finding the bootable devices and loading the boot sector from the master boot record (MBR). The MBR then loads the boot loader, such as GRUB or LILO, which loads the Linux kernel into memory and passes control to it. The kernel initializes essential system components and starts the init process, which launches other processes according to the runlevel configuration to complete the system startup.
The document provides an introduction to Linux kernel modules. It discusses that kernel modules extend the capabilities of the Linux kernel by executing code as part of the kernel. It then describes the anatomy of a kernel module, including initialization and cleanup functions. The document demonstrates a simple "hello world" kernel module example and how to build, load and unload kernel modules. It also introduces the idea of character device drivers as a more advanced kernel module example.
This document provides an overview of Linux internals and networking concepts covered in 3 sentences or less:
It introduces Linux internals topics like processes, memory management, and virtual file systems. It also discusses networking concepts and provides a brief history of operating systems development. The document contains various sections on Linux components, kernel subsystems, virtual file systems, and transitioning to systems programming.
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).
Getting started with setting up embedded platform requires audience to understand some of the key aspects of Linux. This presentation deals with basics of Linux as an OS, Linux commands, vi editor, Shell features like redirection, pipes and shell scripting
Arm device tree and linux device driversHoucheng Lin
This document discusses how the Linux kernel supports different ARM boards using a common source code base. It describes how device tree is used to describe hardware in a board-agnostic way. The kernel initializes machine-specific code via the device tree and initializes drivers by matching compatible strings. This allows a single kernel binary to support multiple boards by abstracting low-level hardware details into the device tree rather than the kernel source. The document also contrasts the ARM approach to the x86 approach, where BIOS abstraction and standardized buses allow one kernel to support most x86 hardware.
Linux is an operating system or a kernel. It is distributed under an open source license. Its functionality list is quite like UNIX. Linux is an operating system or a kernel which germinated as an idea in the mind of young and bright Linus Torvalds when he was a computer science student. The main advantage of Linux was that programmers were able to use the Linux Kernel to design their own custom operating systems. With time, a new range of user-friendly OS's stormed the computer world. Now, Linux is one of the most popular and widely used Kernel, and it is the backbone of popular operating systems like Debian, Knoppix, Ubuntu, and Fedora.
The Linux booting process begins when the user turns on the computer. The BIOS loads and runs a power-on self-test before finding the bootable devices and loading the boot sector from the master boot record (MBR). The MBR then loads the boot loader, such as GRUB or LILO, which loads the Linux kernel into memory and passes control to it. The kernel initializes essential system components and starts the init process, which launches other processes according to the runlevel configuration to complete the system startup.
Systemd: the modern Linux init system you will learn to loveAlison Chaiken
The talk combines a design overview of systemd with some tutorial incofrmation about how to configure it. Systemd's features and pitfalls are illustrated by short demos and real-life examples. Files used in the demos are listed under "Presentations" at http://she-devel.com/
Video of the live presentation will appear here:
http://www.meetup.com/Silicon-Valley-Linux-Technology/events/208133972/
Vmlinux: anatomy of bzimage and how x86 64 processor is bootedAdrian Huang
This slide deck describes the Linux booting flow for x86_64 processors.
Note: When you view the the slide deck via web browser, the screenshots may be blurred. You can download and view them offline (Screenshots are clear).
Linux Kernel Booting Process (2) - For NLKBshimosawa
Describes the bootstrapping part in Linux, and related architectural mechanisms and technologies.
This is the part two of the slides, and the succeeding slides may contain the errata for this slide.
The document provides an overview of the initialization phase of the Linux kernel. It discusses how the kernel enables paging to transition from physical to virtual memory addresses. It then describes the various initialization functions that are called by start_kernel to initialize kernel features and architecture-specific code. Some key initialization tasks discussed include creating an identity page table, clearing BSS, and reserving BIOS memory.
Decompressed vmlinux: linux kernel initialization from page table configurati...Adrian Huang
Talk about how Linux kernel initializes the page table.
Note: When you view the the slide deck via web browser, the screenshots may be blurred. You can download and view them offline (Screenshots are clear).
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.
This document provides an introduction to Linux drivers. It discusses the ecosystem of Linux drivers, types of Linux drivers, driver layering, related commands and configurations. It also guides the reader in creating their first Linux driver, covering basics like the module constructor, destructor, printk function and building the driver module.
The document provides an overview of Das U-Boot, a universal boot loader used to load operating systems and applications into memory on embedded systems. It discusses U-Boot's features such as its command line interface, ability to load images from different sources, and support for various architectures and boards. It also covers compiling and configuring U-Boot, as well as its basic command set and image support capabilities.
Android boot time optimization involves measuring boot times, analyzing the results, and reducing times. Key areas of focus include the bootloader, kernel initialization, zygote class preloading, and system service startup. Hibernation technologies like QuickBoot and Fast-On can improve resume speeds by saving a system image to flash. The "R-Loader" concept aims to minimize hardware re-initialization on resume by directly loading a suspended kernel image.
An unique module combining various previous modules you have learnt by combing Linux administration, Hardware knowledge, Linux as OS, C/Computer programming areas. This is a complete module on Embedded OS, as of now no books are written on this with such practical aspects. Here is a consolidated material to get real hands-on perspective about building custom Embedded Linux distribution in ARM.
Linux uses memory management to partition memory between kernel and application spaces, organize memory using virtual addresses, and swap memory between primary and secondary storage. It divides memory using paging into equal-sized pages, creates virtual address spaces, and uses an MMU to translate between virtual and physical addresses. This allows processes to run independently with their own logical view of memory while the physical memory is shared.
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.
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 document summarizes a presentation on static partitioning virtualization for RISC-V. It discusses the motivation for embedded virtualization, an overview of static partitioning hypervisors like Jailhouse and Xen, and the Bao hypervisor. It then provides an overview of the RISC-V hypervisor specification and extensions, including implemented features. It evaluates the performance overhead and interrupt latency of a prototype RISC-V hypervisor implementation with and without interference mitigations like cache partitioning.
The document summarizes how to write a character device driver in Linux. It covers the anatomy of a device driver including the user interface via device files, and kernel interfaces via file operations and major/minor numbers. It describes registering a character driver by defining file operations, reserving major/minor numbers, and associating them. Open and release functions handle initialization and cleanup. Read/write functions transfer data between userspace and hardware. Ioctl allows extending functionality.
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...Adrian Huang
This document describes setting up a QEMU virtual machine with Ubuntu 20.04.1 to debug Linux kernel code using gdb. It has a 2-socket CPU configuration with 16GB of memory and disabled KASAN and ASLR. The QEMU VM can be used to run sample code and observe Linux kernel behavior under gdb, such as setting conditional breakpoints to analyze page fault behavior for mmap addresses by referencing a gdb debugging text file.
The document provides an introduction to ARMv8 Aarch64, a 64-bit instruction set introduced in ARMv8. Some key points:
- It uses 64-bit pointers and registers, with 32-bit fixed length instructions. It has 31 general purpose 64-bit registers.
- Many traditional ARM features are removed or modified, such as conditional execution, immediate shifts, load/store multiple. New features are added like large PC-relative addressing and branching.
- It has a load-acquire/store-release memory model and supports atomic operations. Advanced SIMD and floating point are now mandatory.
How to use KASAN to debug memory corruption in OpenStack environment- (2)Gavin Guo
KASan is a kernel address sanitizer that detects memory corruption bugs like use-after-free and out-of-bounds memory accesses. It allocates shadow memory to track the state of kernel virtual memory and instruments memory accesses to check the shadow memory. KASan maps shadow memory during early boot and when modules are loaded. It poisons and unpoisons shadow memory for allocations and frees using the buddy and SLUB allocators. KASan detects memory bugs by checking if the shadow memory indicates a memory access is valid.
Writing Character driver (loadable module) in linuxRajKumar Rampelli
It covers the step by step approach on how to write a simple loadable character device driver in linux. What are Device files in linux detail. How user application interact with character driver using a device file.
This document provides an introduction to Linux, including its history and architecture. It describes Linux's origins from Unix in the 1960s and the development of the Linux kernel by Linus Torvalds in 1991. It outlines the key components of a Linux system, including the kernel, shell, file system, processes, networking, and desktop environments. It also discusses booting a Linux system and provides resources for learning more about Linux distributions and building your own operating system.
Systemd: the modern Linux init system you will learn to loveAlison Chaiken
The talk combines a design overview of systemd with some tutorial incofrmation about how to configure it. Systemd's features and pitfalls are illustrated by short demos and real-life examples. Files used in the demos are listed under "Presentations" at http://she-devel.com/
Video of the live presentation will appear here:
http://www.meetup.com/Silicon-Valley-Linux-Technology/events/208133972/
Vmlinux: anatomy of bzimage and how x86 64 processor is bootedAdrian Huang
This slide deck describes the Linux booting flow for x86_64 processors.
Note: When you view the the slide deck via web browser, the screenshots may be blurred. You can download and view them offline (Screenshots are clear).
Linux Kernel Booting Process (2) - For NLKBshimosawa
Describes the bootstrapping part in Linux, and related architectural mechanisms and technologies.
This is the part two of the slides, and the succeeding slides may contain the errata for this slide.
The document provides an overview of the initialization phase of the Linux kernel. It discusses how the kernel enables paging to transition from physical to virtual memory addresses. It then describes the various initialization functions that are called by start_kernel to initialize kernel features and architecture-specific code. Some key initialization tasks discussed include creating an identity page table, clearing BSS, and reserving BIOS memory.
Decompressed vmlinux: linux kernel initialization from page table configurati...Adrian Huang
Talk about how Linux kernel initializes the page table.
Note: When you view the the slide deck via web browser, the screenshots may be blurred. You can download and view them offline (Screenshots are clear).
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.
This document provides an introduction to Linux drivers. It discusses the ecosystem of Linux drivers, types of Linux drivers, driver layering, related commands and configurations. It also guides the reader in creating their first Linux driver, covering basics like the module constructor, destructor, printk function and building the driver module.
The document provides an overview of Das U-Boot, a universal boot loader used to load operating systems and applications into memory on embedded systems. It discusses U-Boot's features such as its command line interface, ability to load images from different sources, and support for various architectures and boards. It also covers compiling and configuring U-Boot, as well as its basic command set and image support capabilities.
Android boot time optimization involves measuring boot times, analyzing the results, and reducing times. Key areas of focus include the bootloader, kernel initialization, zygote class preloading, and system service startup. Hibernation technologies like QuickBoot and Fast-On can improve resume speeds by saving a system image to flash. The "R-Loader" concept aims to minimize hardware re-initialization on resume by directly loading a suspended kernel image.
An unique module combining various previous modules you have learnt by combing Linux administration, Hardware knowledge, Linux as OS, C/Computer programming areas. This is a complete module on Embedded OS, as of now no books are written on this with such practical aspects. Here is a consolidated material to get real hands-on perspective about building custom Embedded Linux distribution in ARM.
Linux uses memory management to partition memory between kernel and application spaces, organize memory using virtual addresses, and swap memory between primary and secondary storage. It divides memory using paging into equal-sized pages, creates virtual address spaces, and uses an MMU to translate between virtual and physical addresses. This allows processes to run independently with their own logical view of memory while the physical memory is shared.
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.
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 document summarizes a presentation on static partitioning virtualization for RISC-V. It discusses the motivation for embedded virtualization, an overview of static partitioning hypervisors like Jailhouse and Xen, and the Bao hypervisor. It then provides an overview of the RISC-V hypervisor specification and extensions, including implemented features. It evaluates the performance overhead and interrupt latency of a prototype RISC-V hypervisor implementation with and without interference mitigations like cache partitioning.
The document summarizes how to write a character device driver in Linux. It covers the anatomy of a device driver including the user interface via device files, and kernel interfaces via file operations and major/minor numbers. It describes registering a character driver by defining file operations, reserving major/minor numbers, and associating them. Open and release functions handle initialization and cleanup. Read/write functions transfer data between userspace and hardware. Ioctl allows extending functionality.
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...Adrian Huang
This document describes setting up a QEMU virtual machine with Ubuntu 20.04.1 to debug Linux kernel code using gdb. It has a 2-socket CPU configuration with 16GB of memory and disabled KASAN and ASLR. The QEMU VM can be used to run sample code and observe Linux kernel behavior under gdb, such as setting conditional breakpoints to analyze page fault behavior for mmap addresses by referencing a gdb debugging text file.
The document provides an introduction to ARMv8 Aarch64, a 64-bit instruction set introduced in ARMv8. Some key points:
- It uses 64-bit pointers and registers, with 32-bit fixed length instructions. It has 31 general purpose 64-bit registers.
- Many traditional ARM features are removed or modified, such as conditional execution, immediate shifts, load/store multiple. New features are added like large PC-relative addressing and branching.
- It has a load-acquire/store-release memory model and supports atomic operations. Advanced SIMD and floating point are now mandatory.
How to use KASAN to debug memory corruption in OpenStack environment- (2)Gavin Guo
KASan is a kernel address sanitizer that detects memory corruption bugs like use-after-free and out-of-bounds memory accesses. It allocates shadow memory to track the state of kernel virtual memory and instruments memory accesses to check the shadow memory. KASan maps shadow memory during early boot and when modules are loaded. It poisons and unpoisons shadow memory for allocations and frees using the buddy and SLUB allocators. KASan detects memory bugs by checking if the shadow memory indicates a memory access is valid.
Writing Character driver (loadable module) in linuxRajKumar Rampelli
It covers the step by step approach on how to write a simple loadable character device driver in linux. What are Device files in linux detail. How user application interact with character driver using a device file.
This document provides an introduction to Linux, including its history and architecture. It describes Linux's origins from Unix in the 1960s and the development of the Linux kernel by Linus Torvalds in 1991. It outlines the key components of a Linux system, including the kernel, shell, file system, processes, networking, and desktop environments. It also discusses booting a Linux system and provides resources for learning more about Linux distributions and building your own operating system.
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.
This document provides an overview of a presentation on the basics of Linux based on the LPIC-1 certification. It discusses topics 101 and 102 from the LPIC-1 exam, including system architecture, hardware configuration, booting, runlevels, disk partitioning, installing boot managers, managing shared libraries, and using Debian and RPM package management. The presentation aims to teach basic Linux skills like command line work, user administration, backups and restores, and connecting Linux systems to networks.
This document discusses Docker concepts and implementation in Chinese. It covers Linux kernel namespaces, seccomp, cgroups, LXC, and Docker. Namespaces isolate processes and resources between containers. Cgroups control resource limits and prioritization. LXC provides containerization tools while Docker builds on these concepts and provides an easy-to-use interface for containers. The document also provides examples of using namespaces, cgroups, LXC, and building Docker images.
The presentation deals with the set of tools and features that can be used by Linux kernel developers for kernel debugging. Also, static analysis of kernel patches was addressed during speech. Special attention was given to access tools, tracing tools, and interactive debugging tools, namely: DebugFS, ftrace, and GDB.
This presentation by Aleksandr Bulyshchenko (Software Engineer, Consultant, GlobalLogic Kharkiv) was delivered at GlobalLogic Kharkiv Embedded TechTalk #1 on March 13, 2018.
The document provides an overview of device driver development in Linux, including character device drivers. It discusses topics such as device driver types, kernel subsystems, compiling and loading kernel modules, the __init and __exit macros, character device registration, and issues around reference counting when removing modules. It also provides sample code for a basic character device driver that prints information to the kernel log.
Zephyr RTOS in One Hour | HARDWARIO @ IoT North UKHARDWARIO
Pavel Hübner (from HARDWARIO) will provide a crash course into the Zephyr RTOS. Zephyr is an innovative operating system targeting 32-bit microcontrollers and is suitable for connected IoT products. Such devices are often low-power and provide a multi-year battery lifespan. The ambitious 60-minute live session with be held on a configurable IoT gateway CHESTER - a platform based on Nordic Semiconductor SoCs nRF52840 / nRF9160. Throughout the course, Pavel will go from the key Zephyr fundamentals to connecting a fully-fledged IoT application over the NB-IoT network.
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.
This document discusses Linux device drivers. It provides an overview of the history and purpose of Linux and device drivers. It explains that device drivers connect hardware and software by communicating at both the logical and physical layers. It also describes the difference between kernel and user modes, and discusses how device drivers are developed by utilizing Linux system calls and supporting development environments within the Linux kernel programming interface.
This document provides an overview of embedded Linux for an embedded systems design course. It discusses various commercial and open source embedded Linux distributions and their characteristics. It also covers important topics for embedded Linux including tool chains, the Linux kernel, debugging, driver development, memory management, and synchronization techniques. Example code snippets are provided for common Linux system programming tasks like file I/O, processes, threads, IPC, signals, and sockets. Cross-compiling for embedded targets is also briefly explained.
This document provides an introduction to Linux device drivers. It discusses that device drivers provide an abstraction layer between software and hardware, hiding hardware details. It describes different types of devices like character and block devices. It covers key concepts like loadable modules, driver entry/exit points, interrupts, deferred work, and memory-mapped peripherals. The document uses serial/UART drivers and the TTY layer as examples to illustrate driver concepts.
The document provides an introduction to Linux and device drivers. It discusses Linux directory structure, kernel components, kernel modules, character drivers, and registering drivers. Key topics include dynamically loading modules, major and minor numbers, private data, and communicating with hardware via I/O ports and memory mapping.
How Secure Is Your Container? ContainerCon Berlin 2016Phil Estes
A conference talk at ContainerCon Europe in Berlin, Germany, given on October 5th, 2016. This is a slightly modified version of my talk first used at Docker London in July 2016.
This document discusses the evolution of Linux container virtualization, including technologies like LXC, Docker, CoreOS, and Kubernetes. It provides an overview of key concepts in virtualization like namespaces, cgroups, AppArmor, SELinux, and seccomp. It also summarizes features of Linux container engines like LXC, and container platforms like Docker, CoreOS, and the Kubernetes container cluster management system.
The default applications on an embedded Linux system include many common command line utilities from BusyBox, such as cat, cp, grep, ls, mkdir, more, mv, ping, ps, rm, top, and vi. BusyBox provides minimal versions of many common UNIX commands in a single executable to reduce the size of the system. Other default applications may include services like bootchartd, crond, and syslogd.
Talk from Embedded Linux Conference, http://elcabs2015.sched.org/event/551ba3cdefe2d37c478810ef47d4ca4c?iframe=no&w=i:0;&sidebar=yes&bg=no#.VRUCknSQQQs
Device drivers in Linux allow software to interact with hardware devices by implementing functions like open, read, write, and close, and can be built into the kernel or loaded as modules. The kernel provides common interfaces for character and block devices that drivers can hook into. Device drivers must be registered with the kernel and handle events like loading, unloading, and accessing devices through file operations.
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
Walmart Business+ and Spark Good for Nonprofits.pdfTechSoup
"Learn about all the ways Walmart supports nonprofit organizations.
You will hear from Liz Willett, the Head of Nonprofits, and hear about what Walmart is doing to help nonprofits, including Walmart Business and Spark Good. Walmart Business+ is a new offer for nonprofits that offers discounts and also streamlines nonprofits order and expense tracking, saving time and money.
The webinar may also give some examples on how nonprofits can best leverage Walmart Business+.
The event will cover the following::
Walmart Business + (https://business.walmart.com/plus) is a new shopping experience for nonprofits, schools, and local business customers that connects an exclusive online shopping experience to stores. Benefits include free delivery and shipping, a 'Spend Analytics” feature, special discounts, deals and tax-exempt shopping.
Special TechSoup offer for a free 180 days membership, and up to $150 in discounts on eligible orders.
Spark Good (walmart.com/sparkgood) is a charitable platform that enables nonprofits to receive donations directly from customers and associates.
Answers about how you can do more with Walmart!"
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
Leveraging Generative AI to Drive Nonprofit InnovationTechSoup
In this webinar, participants learned how to utilize Generative AI to streamline operations and elevate member engagement. Amazon Web Service experts provided a customer specific use cases and dived into low/no-code tools that are quick and easy to deploy through Amazon Web Service (AWS.)
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Linux kernel modules
1. Linux Kernel Modules
Let’s solve the puzzle
Dheryta Jaisinghani
Workshop on Computer Systems, Ashoka University
Dec 9, 2018
(Note: Most of the codes in the slides are from references in the end)
3. Basic Operating System Structure
Hardware
Kernel
User Services
User Applications
& Processes
System Call
Interface
● What is an operating system?
○ An operating system is system software
that manages computer hardware and
software resources and provides
common services for computer
programs. [Wikipedia]
● What is Kernel?
○ Core of the operating system
○ Loads at startup and takes care of
everything else -
resources/memory/scheduling and many
more
○ Types: Monolithic, Microkernel, Modular,
Nano, Exo 3
4. What is a Kernel Module?
● Piece of code - Runtime Load/Unload
● Examples - Device Drivers - printer
driver, WLAN driver, vbox driver and
many more
● Actual kernel image is small - Modules
make it big
○ Monolithic kernels would have
been huge
User-level
Programs
System Call Interface
Kernel Services
Device Modules and Drivers
Physical Devices
User space
Kernel space
4
5. Module vs Program
● Program
○ main() - sequentially executes instructions and terminates
● Kernel Modules
○ init_module() or module_init() - Entry function
■ Initial setup to tell kernel about this module
■ Kernel executes it when needed
○ cleanup_module() or module_exit - Exit function
■ Unregister the module
5
9. Prepare the system
● Update the system
○ sudo apt-get update
● Search appropriate headers
○ apt-cache search linux-headers-$(uname -r)
● Download and install correct Linux headers
○ sudo apt-get install linux-headers-$(uname -r)
● Check if installed correctly
○ cd /usr/src/linux-headers-$(uname -r)
○ ls - should show the header files
● Follow steps under Prepare the System for Building LKMs, presented here
(http://derekmolloy.ie/writing-a-linux-kernel-module-part-1-introduction/)
9
10. Hello World Kernel Module
#include <linux/module.h>
#include <linux/kernel.h>
DRIVER_AUTHOR "Dheryta Jaisinghani"
DRIVER_DESC "A Hello World kernel module."
MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
int init_module(void)
{
printk(KERN_INFO "Hello Worldn");
return 0;
}
void cleanup_module(void)
{
printk(KERN_INFO "Goodbye Worldn");
}
10
Header files to make it a kernel module
and log levels
Module Information
Load the module
0 - Success, Else - Failure
Unload the module
12. printk
● Log at kernel
● 8 priority levels (See: include/linux/kern_levels.h)
○ KERN_EMERG 0 system is unusable
○ KERN_ALERT 1 action must be taken immediately
○ KERN_CRIT 2 critical conditions
○ KERN_ERR 3 error conditions
○ KERN_WARNING 4 warning conditions
○ KERN_NOTICE 5 normal but significant condition
○ KERN_INFO 6 informational
○ KERN_DEBUG 7 debug-level messages
12
13. Module Makefile
obj−m += hello.o
all:
make −C /lib/modules/$(shell uname −r)/build M=$(PWD) modules
clean:
make −C /lib/modules/$(shell uname −r)/build M=$(PWD) clean
13
Multiple modules can be built with single makefile. Refer to
Section 2.2 in The Linux Kernel Module Programming Guide
17. Not Using Default init and cleanup
#include <linux/module.h>
#include <linux/kernel.h>
DRIVER_AUTHOR "Dheryta Jaisinghani"
DRIVER_DESC "A Hello World kernel module."
MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
static int __init myInit(void)
{
printk(KERN_INFO "Hello Worldn");
/*
* A non 0 return means init_module failed; module can't be loaded.
*/
return 0;
}
static void __exit myExit(void)
{
printk(KERN_INFO "Goodbye Worldn");
}
module_init(myInit);
module_exit(myExit);
17
● __init and __exit are Macros
● Kernel can free memory
when initialization or module
unloading is done
24. Device Drivers vs Device Files
● Everything is a file or a directory
● Every device is represented by a file in /dev/
● Device Driver: Kernel Module that controls a device
● Device File:
○ Interface for the Device Driver to read from or
write to a physical device
○ Also known as Device Nodes
○ Created with mknod system call [ex. mknod
<c/b> <major> <minor>]
Device File
(/dev/xxx)
Device Driver
Physical Device
User space
Kernel space
24
26. Types of Device Files
● Character Files
○ Stream of data one character at a time
○ No restriction on number of bytes
● Block Files
○ Random access to block of data
○ Can buffer and schedule the requests
$ ls -a /dev/
$crw-rw---- 1 root dialout 4, 64 Nov 30 09:51 ttyS0
$brw-rw---- 1 root dialout 4, 64 Nov 30 09:52 sdd
26
27. Major and Minor Device Number
root@iiitd-HP-Compaq-8200-Elite-MT-PC:/home/iiitd# ls -l /dev/sda*
brw-rw---- 1 root disk 8, 0 Dec 3 11:48 /dev/sda
brw-rw---- 1 root disk 8, 1 Dec 3 11:48 /dev/sda1
brw-rw---- 1 root disk 8, 2 Dec 3 11:48 /dev/sda2
brw-rw---- 1 root disk 8, 3 Dec 3 11:48 /dev/sda3
● Major Number
○ The driver for the hardware
○ Unique for each driver
● Minor Number
○ The number of unique hardware a driver manages
27
31. Getting Runtime Information of System
● proc file system
○ Reports runtime information about various resources
○ Memory usage/hardware/modules loaded and many more
● Try
○ ls /proc/ (Numbered directories correspond to processes!)
○ cat /proc/devices
○ cat /proc/modules
○ cat /proc/cpuinfo
○ cat /proc/meminfo
● More Details: http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html
31
35. Interacting with External Devices
● printk does not always help
● Device specific commands should be known
● Interfacing with Keyboard
○ Periodic Lighting Keyboard - Example 10.2 from Ref[1]
○ Dancing Lights Keyboard - Modify Example 10.2 (see help on next slide)
35
37. Interrupt Handlers
37
Processor Hardware
Instructions
How? → Interrupts
Received an interrupt
Pause current work.
Save the state (How?)
Address the interrupt
with Interrupt Handler
Resume the work
request_irq() → Create entry in /proc/interrupts
request_irq() → Create entry in /proc/interrupts
39. Raise and Capture Interrupt on a
Character Device
● chardev.c
● Raise the interrupt whenever file is read [asm instruction]
● Capture the interrupt
● Tell user that the interrupt is captured
39
41. Interacting with Physical Devices
Kernel Modules
41
/proc/ file system
/dev/ file system
Device read/write
IOCTLs
System Calls
Interrupt Handlers
Use Existing or Write Your Own Custom Calls
43. What and Why of Shell Scripts
● Shell is an interface to allow the use of operating system services
● All commands are executed in a shell through a terminal
● Bash shell is the most common shell
● Shell scripts allow to
○ Automate the execution of repetitive shell commands
○ Routine procedures such as backups
○ System monitoring
43
44. Shell Script Structure
● Every shell script starts with a shell name like → # !/bin/bash
● As per convention, a shell script file extension is .sh
● A shell script should be made executable with chmod command
● A shell script can have constructs such as for, while, if-elseif-else, switch
● A shell script can read/write from files
● A shell script can call another program may it be a python or C or any other
● In summary - shell scripts are very powerful
44
46. Control CD Drive
#!/bin/bash
while :
do
eject
eject -t
done
Ref:https://www.quora.com/What-is-the-most-interesting-shell-script-you-have-ever-written
46
47. GRE Prep
1. sudo apt-get install cowsay
2. Prepare a dictionary
a. Apple == red fruit
b. LadyFinger == green vegetable
c. Clock == A device to show time
d. English == It is a language
3. In .bashrc → shuf -n 1 MyDictionary.txt | cowsay
Ref:https://www.quora.com/What-is-the-most-interesting-shell-script-you-have-ever-
written 47
48. System Health
● Use standard commands to summarize all vitals
48
Ref: https://www.tecmint.com/linux-server-health-monitoring-script/
49. Conclusion
● Kernel Modules: An introduction
● Hello world modules: Creating, Compiling, Inserting, Initialization and Passing
variables
● Proc, Device file system
● Device drivers, files
● Interaction with devices
● Interrupt handling
● Shell Scripts
49
50. Linux WiFi Subsytem
● Tutorial: Opening Nuts and Bolts of Linux WiFi Subsytem
● Slides:
https://www.slideshare.net/DherytaJaisinghani/tutorial-wifi-driver-code-opening
-nuts-and-bolts-of-linux-wifi-subsystem
● Video: https://www.youtube.com/watch?v=pa1oEyc7Dm0
50