The document discusses various concepts related to files in a UNIX system. It defines files as building blocks of an operating system and describes the different types of files like regular files, directory files, device files, FIFO files, etc. It explains key concepts like inodes, file attributes, directory structure, hard links and symbolic links. The document provides detailed information about each file type and how they are represented and used in a UNIX file system.
Part 03 File System Implementation in LinuxTushar B Kute
Presentation on "Virtual File System Implementation in Linux".
Presented at Army Institute of Technology, Pune for FDP on "Basics of Linux Kernel Programming". by Tushar B Kute (http://tusharkute.com).
This document provides an overview of Windows file systems and how they are used for digital forensics investigations. It discusses the File Allocation Table (FAT) file system and how it tracks file clusters. It also describes the New Technology File System (NTFS) and how it stores file metadata and tracks unused data clusters. The document outlines how file deletion, renaming and moving works in Windows, and artifacts that can be recovered from deleted files. It identifies several useful file types for forensic analysis, like shortcut files, the Recycle Bin, print spool files and registry keys.
LInux: Basics & File System:The Unix operating system was conceived and implemented in 1969 at AT&T's Bell Laboratories in the United States by Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna. First released in 1971, Unix was written entirely in assembly language, as was common practice at the time. Later, in a key pioneering approach in 1973, it was rewritten in the C programming language by Dennis Ritchie (with exceptions to the kernel and I/O). The availability of a high-level language implementation of Unix made its porting to different computer platforms easier.
This document provides an overview of file I/O and systems programming in UNIX. It discusses file descriptors, opening and accessing files, file permissions, file systems, linking and renaming files, and password files. The key points covered are:
- Files are accessed using file descriptors rather than FILE objects.
- Common file access functions include open(), close(), read(), write(), and lseek().
- Each open file has a v-node containing metadata and pointers to functions for that file type.
- File permissions are checked against a process's effective user and group IDs.
- Directories map filenames to inodes, which contain file metadata and data block pointers.
- Functions for file manipulation include link(), unlink
The Virtual File System (VFS) provides a standardized interface for user programs to access different types of file systems. It uses various data structures like superblocks, inodes, dentries, and files to represent file system objects and metadata. System calls allow programs to interact with the operating system kernel to perform operations on these VFS objects. The VFS implements various caching mechanisms like the dentry cache to improve performance. It also supports features like namespaces and mounting/unmounting of different file systems.
This document discusses various concepts related to file input/output (I/O) in Linux system programming. It covers opening, reading from, writing to, closing, seeking within, and truncating files using system calls like open(), read(), write(), close(), lseek(), ftruncate(). It also discusses related topics like file descriptors, blocking vs non-blocking I/O, synchronized I/O, direct I/O, and positional reads/writes.
Poking The Filesystem For Fun And Profitssusera432ea1
1) The document discusses writing a rogue filesystem driver that could be used as an attacker tool. It covers motivation, filesystem internals, types of filesystem drivers, and how to write a rogue filesystem driver by implementing functions like superblock operations, inode operations, and file operations.
2) A rogue filesystem driver could be difficult to detect and could selectively spoof, block, or hide file contents to gain a strong foothold in the system. It does not require hooking system calls or compromising the kernel in the same way.
3) Key aspects of developing a rogue driver involve registering the filesystem type, setting up superblock operations, and implementing inode, directory, and file operations to handle
The document discusses various concepts related to files in a UNIX system. It defines files as building blocks of an operating system and describes the different types of files like regular files, directory files, device files, FIFO files, etc. It explains key concepts like inodes, file attributes, directory structure, hard links and symbolic links. The document provides detailed information about each file type and how they are represented and used in a UNIX file system.
Part 03 File System Implementation in LinuxTushar B Kute
Presentation on "Virtual File System Implementation in Linux".
Presented at Army Institute of Technology, Pune for FDP on "Basics of Linux Kernel Programming". by Tushar B Kute (http://tusharkute.com).
This document provides an overview of Windows file systems and how they are used for digital forensics investigations. It discusses the File Allocation Table (FAT) file system and how it tracks file clusters. It also describes the New Technology File System (NTFS) and how it stores file metadata and tracks unused data clusters. The document outlines how file deletion, renaming and moving works in Windows, and artifacts that can be recovered from deleted files. It identifies several useful file types for forensic analysis, like shortcut files, the Recycle Bin, print spool files and registry keys.
LInux: Basics & File System:The Unix operating system was conceived and implemented in 1969 at AT&T's Bell Laboratories in the United States by Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna. First released in 1971, Unix was written entirely in assembly language, as was common practice at the time. Later, in a key pioneering approach in 1973, it was rewritten in the C programming language by Dennis Ritchie (with exceptions to the kernel and I/O). The availability of a high-level language implementation of Unix made its porting to different computer platforms easier.
This document provides an overview of file I/O and systems programming in UNIX. It discusses file descriptors, opening and accessing files, file permissions, file systems, linking and renaming files, and password files. The key points covered are:
- Files are accessed using file descriptors rather than FILE objects.
- Common file access functions include open(), close(), read(), write(), and lseek().
- Each open file has a v-node containing metadata and pointers to functions for that file type.
- File permissions are checked against a process's effective user and group IDs.
- Directories map filenames to inodes, which contain file metadata and data block pointers.
- Functions for file manipulation include link(), unlink
The Virtual File System (VFS) provides a standardized interface for user programs to access different types of file systems. It uses various data structures like superblocks, inodes, dentries, and files to represent file system objects and metadata. System calls allow programs to interact with the operating system kernel to perform operations on these VFS objects. The VFS implements various caching mechanisms like the dentry cache to improve performance. It also supports features like namespaces and mounting/unmounting of different file systems.
This document discusses various concepts related to file input/output (I/O) in Linux system programming. It covers opening, reading from, writing to, closing, seeking within, and truncating files using system calls like open(), read(), write(), close(), lseek(), ftruncate(). It also discusses related topics like file descriptors, blocking vs non-blocking I/O, synchronized I/O, direct I/O, and positional reads/writes.
Poking The Filesystem For Fun And Profitssusera432ea1
1) The document discusses writing a rogue filesystem driver that could be used as an attacker tool. It covers motivation, filesystem internals, types of filesystem drivers, and how to write a rogue filesystem driver by implementing functions like superblock operations, inode operations, and file operations.
2) A rogue filesystem driver could be difficult to detect and could selectively spoof, block, or hide file contents to gain a strong foothold in the system. It does not require hooking system calls or compromising the kernel in the same way.
3) Key aspects of developing a rogue driver involve registering the filesystem type, setting up superblock operations, and implementing inode, directory, and file operations to handle
Linux treats all devices as files. There are three main types of devices in Linux - block devices which deal with blocks of data like hard disks, character devices which transfer data as a stream of bytes like keyboards, and network devices which transmit data packets over a network. The Linux kernel includes device drivers that provide a standard interface to access and interact with devices, making them accessible to applications as special files.
The document discusses file systems and file management. It covers key topics such as file structure and attributes, directory structures including tree and graph implementations, access methods like sequential and direct, and file sharing including remote file systems. Protection and permissions are also covered through access control lists and user/group models.
The document discusses input/output (I/O) and file management in operating systems. It covers several key topics:
1) I/O devices are controlled by the OS and include input devices like keyboards and output devices like monitors. Files are managed through a logical, uniform view abstracted from physical storage properties.
2) A file is a collection of related information defined by its creator, such as programs, data, text, or formatted records. File management involves creation, deletion, mapping to storage, and backup.
3) The OS implements I/O buffering and caching to improve performance and address speed mismatches between devices. It also performs disk scheduling and structures file storage through directories, indexing,
The document discusses various UNIX file APIs. It describes different file types in UNIX like regular files, directories, FIFO files, device files, and symbolic links. It then explains the open(), read(), write(), close() system calls used to perform operations on files. open() is used to open or create a file. read() reads data from an open file. write() writes data to a file. close() closes an open file. Examples of using these calls are also provided.
The document discusses several aspects of file and directory structure in operating systems. It describes different approaches to implementing directories, including linear lists and hash tables. It also discusses file access mechanisms in distributed file systems, including how file name mapping, caching, and various protocols for open, read, and close operations work. The key components of a file system structure, such as the logical file system, file organization module, and layers of an application program, logical file system, and file organization are also summarized.
The document provides an overview of the Linux file system structure and common Linux commands. It describes that in Linux, everything is treated as a file, including devices, pipes and directories. It explains the different types of files and partitions in Linux, and provides examples of common file manipulation and system monitoring commands.
Unix was created in 1969 by Ken Thompson at Bell Labs to allow multiple users to access a computer simultaneously. It features a multi-user design, hierarchical file system, and shell interface. The kernel handles memory management, process scheduling, and device interactions to enable these features. Common Unix commands like cat, ls, cp and rm allow users to work with files and directories from the shell. File permissions and ownership are managed through inodes to control access across users.
This document provides an overview of Linux and its filesystem hierarchy. It discusses how Linux originated from Linus Torvalds' interest in the Minix operating system. It describes the initial 1991 release of Linux and how it has grown with contributions from thousands of programmers worldwide. It also explains the relationship between the Linux kernel and the GNU operating system. The document outlines the main components of Linux, including the kernel, libraries, utilities, and user interfaces. It provides details on the Linux filesystem hierarchy and describes the purpose and common contents of the main directories like /bin, /boot, /dev, /etc, /home, /lib, /opt, /proc, /root, /srv, /sys, /tmp, /
The document discusses various aspects of file systems and file organization in operating systems. It describes files as named collections of related information stored on secondary storage devices like disks. It covers different file access methods, directory structures like single-level, two-level and tree-structured directories. It also discusses file allocation methods like contiguous, linked and indexed allocation and free space management techniques.
The document discusses key concepts related to Unix operating systems including:
1) The Unix file system uses a hierarchical structure with a root directory and standard file types like regular files, directories, and links.
2) Files are structured as sequences of bytes and have attributes like access rights and modes that determine who can read, write, and execute them.
3) The kernel provides services through system calls that programs interface with, and uses techniques like reentrancy, address spaces, synchronization, and device drivers to support processes running concurrently.
The document discusses various types of files in UNIX/Linux systems such as regular files, directory files, device files, FIFO files, and symbolic links. It describes how each file type is created and used. It also covers UNIX file attributes, inodes, and how the kernel manages file access through system calls like open, read, write, and close.
This document provides an overview and summary of key concepts related to file management and low-level file systems. It discusses the structure of hard disks and how they are organized into blocks, tracks, and cylinders. It describes low-level file systems as implementing byte-stream files and stream-block translation. Common block management strategies for organizing file data blocks on storage devices include contiguous allocation, linked lists, and indexed allocation. The document also summarizes key file system calls like open, read, write, and close used in low-level file systems.
The document discusses the UNIX file system. It describes how the file system is organized in a tree structure that can be arbitrarily deep. Files include regular files, directories, device files, UNIX domain sockets, and named pipes. File permissions are managed through permission bits and special flags like setuid and setgid. Inodes store metadata about files like timestamps, ownership, and size. The file system is mounted to map directories to storage resources and unmounted to detach them.
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.
The document provides an overview of the Unix operating system, including its history, design principles, and key components. It describes how Unix was developed at Bell Labs in the 1960s and later influenced by BSD at UC Berkeley. The core elements discussed include the process model, file system, I/O, and standard user interface through shells and commands.
This document provides an overview of the Linux kernel internals and device drivers. It discusses topics like memory management, process creation, inter-process communication using shared memory, and device drivers. The key aspects covered are virtual memory mapping, demand paging, steps in program execution, different types of device drivers, and how the kernel interacts with hardware through device drivers in the userspace.
The document discusses Linux kernel internals and provides an overview of key concepts such as memory management, process creation, device drivers, and file systems. It describes how the kernel handles tasks like compiling programs, managing memory and processes, and facilitating communication between software and hardware. The document also outlines common Linux system calls and functions related to program execution.
This lecture describes the virtual filesystems procfs and sysfs.
Video for this Lecture on youtube:
http://www.youtube.com/watch?v=wlxL-iQN6No
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 document provides guidance on standard operating and maintenance procedures for file systems. It discusses file system maintenance techniques, such as creating an organized directory structure, finding and deleting unused files on a regular basis, and performing disk maintenance like defragmenting to optimize performance. Backup plans and software installation procedures are also covered. The document provides examples of directory structures and maintenance tasks for different operating systems including Windows, Linux/UNIX, and Mac OS X.
Linux treats all devices as files. There are three main types of devices in Linux - block devices which deal with blocks of data like hard disks, character devices which transfer data as a stream of bytes like keyboards, and network devices which transmit data packets over a network. The Linux kernel includes device drivers that provide a standard interface to access and interact with devices, making them accessible to applications as special files.
The document discusses file systems and file management. It covers key topics such as file structure and attributes, directory structures including tree and graph implementations, access methods like sequential and direct, and file sharing including remote file systems. Protection and permissions are also covered through access control lists and user/group models.
The document discusses input/output (I/O) and file management in operating systems. It covers several key topics:
1) I/O devices are controlled by the OS and include input devices like keyboards and output devices like monitors. Files are managed through a logical, uniform view abstracted from physical storage properties.
2) A file is a collection of related information defined by its creator, such as programs, data, text, or formatted records. File management involves creation, deletion, mapping to storage, and backup.
3) The OS implements I/O buffering and caching to improve performance and address speed mismatches between devices. It also performs disk scheduling and structures file storage through directories, indexing,
The document discusses various UNIX file APIs. It describes different file types in UNIX like regular files, directories, FIFO files, device files, and symbolic links. It then explains the open(), read(), write(), close() system calls used to perform operations on files. open() is used to open or create a file. read() reads data from an open file. write() writes data to a file. close() closes an open file. Examples of using these calls are also provided.
The document discusses several aspects of file and directory structure in operating systems. It describes different approaches to implementing directories, including linear lists and hash tables. It also discusses file access mechanisms in distributed file systems, including how file name mapping, caching, and various protocols for open, read, and close operations work. The key components of a file system structure, such as the logical file system, file organization module, and layers of an application program, logical file system, and file organization are also summarized.
The document provides an overview of the Linux file system structure and common Linux commands. It describes that in Linux, everything is treated as a file, including devices, pipes and directories. It explains the different types of files and partitions in Linux, and provides examples of common file manipulation and system monitoring commands.
Unix was created in 1969 by Ken Thompson at Bell Labs to allow multiple users to access a computer simultaneously. It features a multi-user design, hierarchical file system, and shell interface. The kernel handles memory management, process scheduling, and device interactions to enable these features. Common Unix commands like cat, ls, cp and rm allow users to work with files and directories from the shell. File permissions and ownership are managed through inodes to control access across users.
This document provides an overview of Linux and its filesystem hierarchy. It discusses how Linux originated from Linus Torvalds' interest in the Minix operating system. It describes the initial 1991 release of Linux and how it has grown with contributions from thousands of programmers worldwide. It also explains the relationship between the Linux kernel and the GNU operating system. The document outlines the main components of Linux, including the kernel, libraries, utilities, and user interfaces. It provides details on the Linux filesystem hierarchy and describes the purpose and common contents of the main directories like /bin, /boot, /dev, /etc, /home, /lib, /opt, /proc, /root, /srv, /sys, /tmp, /
The document discusses various aspects of file systems and file organization in operating systems. It describes files as named collections of related information stored on secondary storage devices like disks. It covers different file access methods, directory structures like single-level, two-level and tree-structured directories. It also discusses file allocation methods like contiguous, linked and indexed allocation and free space management techniques.
The document discusses key concepts related to Unix operating systems including:
1) The Unix file system uses a hierarchical structure with a root directory and standard file types like regular files, directories, and links.
2) Files are structured as sequences of bytes and have attributes like access rights and modes that determine who can read, write, and execute them.
3) The kernel provides services through system calls that programs interface with, and uses techniques like reentrancy, address spaces, synchronization, and device drivers to support processes running concurrently.
The document discusses various types of files in UNIX/Linux systems such as regular files, directory files, device files, FIFO files, and symbolic links. It describes how each file type is created and used. It also covers UNIX file attributes, inodes, and how the kernel manages file access through system calls like open, read, write, and close.
This document provides an overview and summary of key concepts related to file management and low-level file systems. It discusses the structure of hard disks and how they are organized into blocks, tracks, and cylinders. It describes low-level file systems as implementing byte-stream files and stream-block translation. Common block management strategies for organizing file data blocks on storage devices include contiguous allocation, linked lists, and indexed allocation. The document also summarizes key file system calls like open, read, write, and close used in low-level file systems.
The document discusses the UNIX file system. It describes how the file system is organized in a tree structure that can be arbitrarily deep. Files include regular files, directories, device files, UNIX domain sockets, and named pipes. File permissions are managed through permission bits and special flags like setuid and setgid. Inodes store metadata about files like timestamps, ownership, and size. The file system is mounted to map directories to storage resources and unmounted to detach them.
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.
The document provides an overview of the Unix operating system, including its history, design principles, and key components. It describes how Unix was developed at Bell Labs in the 1960s and later influenced by BSD at UC Berkeley. The core elements discussed include the process model, file system, I/O, and standard user interface through shells and commands.
This document provides an overview of the Linux kernel internals and device drivers. It discusses topics like memory management, process creation, inter-process communication using shared memory, and device drivers. The key aspects covered are virtual memory mapping, demand paging, steps in program execution, different types of device drivers, and how the kernel interacts with hardware through device drivers in the userspace.
The document discusses Linux kernel internals and provides an overview of key concepts such as memory management, process creation, device drivers, and file systems. It describes how the kernel handles tasks like compiling programs, managing memory and processes, and facilitating communication between software and hardware. The document also outlines common Linux system calls and functions related to program execution.
This lecture describes the virtual filesystems procfs and sysfs.
Video for this Lecture on youtube:
http://www.youtube.com/watch?v=wlxL-iQN6No
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 document provides guidance on standard operating and maintenance procedures for file systems. It discusses file system maintenance techniques, such as creating an organized directory structure, finding and deleting unused files on a regular basis, and performing disk maintenance like defragmenting to optimize performance. Backup plans and software installation procedures are also covered. The document provides examples of directory structures and maintenance tasks for different operating systems including Windows, Linux/UNIX, and Mac OS X.
Similar to Unit 2.1 Introduction to Kernel.ppt (Kernel Services and Architecture) (20)
- The Unix operating system originated from the MULTICS project in the 1960s. Bell Labs researchers Ken Thompson and Dennis Ritchie developed the first version of Unix in 1969.
- Unix became popular due to its portability, simplicity, and ability to support complex programs built from simpler ones. It introduced a hierarchical file system, consistent file format, and multi-user capabilities.
- Over time, Unix evolved into two main versions - System V (SVR) and Berkeley Software Distribution (BSD). Linux was later developed as a Unix-like system and shares many similarities with SVR.
How to Add Chatter in the odoo 17 ERP ModuleCeline George
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...PECB
Denis is a dynamic and results-driven Chief Information Officer (CIO) with a distinguished career spanning information systems analysis and technical project management. With a proven track record of spearheading the design and delivery of cutting-edge Information Management solutions, he has consistently elevated business operations, streamlined reporting functions, and maximized process efficiency.
Certified as an ISO/IEC 27001: Information Security Management Systems (ISMS) Lead Implementer, Data Protection Officer, and Cyber Risks Analyst, Denis brings a heightened focus on data security, privacy, and cyber resilience to every endeavor.
His expertise extends across a diverse spectrum of reporting, database, and web development applications, underpinned by an exceptional grasp of data storage and virtualization technologies. His proficiency in application testing, database administration, and data cleansing ensures seamless execution of complex projects.
What sets Denis apart is his comprehensive understanding of Business and Systems Analysis technologies, honed through involvement in all phases of the Software Development Lifecycle (SDLC). From meticulous requirements gathering to precise analysis, innovative design, rigorous development, thorough testing, and successful implementation, he has consistently delivered exceptional results.
Throughout his career, he has taken on multifaceted roles, from leading technical project management teams to owning solutions that drive operational excellence. His conscientious and proactive approach is unwavering, whether he is working independently or collaboratively within a team. His ability to connect with colleagues on a personal level underscores his commitment to fostering a harmonious and productive workplace environment.
Date: May 29, 2024
Tags: Information Security, ISO/IEC 27001, ISO/IEC 42001, Artificial Intelligence, GDPR
-------------------------------------------------------------------------------
Find out more about ISO training and certification services
Training: ISO/IEC 27001 Information Security Management System - EN | PECB
ISO/IEC 42001 Artificial Intelligence Management System - EN | PECB
General Data Protection Regulation (GDPR) - Training Courses - EN | PECB
Webinars: https://pecb.com/webinars
Article: https://pecb.com/article
-------------------------------------------------------------------------------
For more information about PECB:
Website: https://pecb.com/
LinkedIn: https://www.linkedin.com/company/pecb/
Facebook: https://www.facebook.com/PECBInternational/
Slideshare: http://www.slideshare.net/PECBCERTIFICATION
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
How to Setup Warehouse & Location in Odoo 17 Inventory
Unit 2.1 Introduction to Kernel.ppt (Kernel Services and Architecture)
1. Operating System and Administration
UNIT-II
Introduction To The Kernel
Reference:
“ The Design of the UNIX Operating
System”, by Maurice J. Bach.
17/05/2024 1
2. Objectives
• To understand system kernel architecture.
• To understand files subsystem and process control
subsystem of kernel.
• To learn and understand Process states and
contexts.
17/05/2024 2
3. Contents
• Architecture of Unix Operating System
• Introduction to the System Concepts
– An overview of the file subsystem
– Processes
• Context of a process
• Process states
• State transitions
• Sleep and wakeup
• Kernel Data Structure
• System Administration
17/05/2024 3
4. What is Kernel
• It acts as an interface between the user
applications and the hardware.
• The main tasks of the kernel
are:
– Process management
– Device management
– Memory management
– Interrupt handling
– I/O communication
– File system...etc..
17/05/2024 4
5. Contents
• Architecture of Unix Operating System
17/05/2024 5
• Introduction to the System Concepts
– An overview of the file subsystem
– Processes
• Context of a process
• Process states
• State transitions
• Sleep and wakeup
• Kernel Data Structure
• System Administration
6. Architecture of the UNIX
• Unix system supports two central concepts
– File system : has “Places”
(basic unit of information storage)
– - Processes : have “life”
– (basic unit of computation)
17/05/2024 6
7. 7
Block Diagram of System Kernel
Libraries
System Call Interface
File Subsystem
Process
Control
Subsystem
Inter-process
Communication
Scheduler
Memory
Management
Hardware Control
Hardware
Buffer Cache
Device Drivers
Character Block
User Level
Kernel
Level
Kernel Level
Hardware Level
Trap
User Programs
17/05/2024
8. 8
System calls & Libraries
Libraries
System Call Interface
File Subsystem
Process
Control
Subsystem
Inter-process
Communication
Scheduler
Memory
Management
Hardware Control
Hardware
Buffer Cache
Device Drivers
Character Block
User Level
Kernel
Level
Kernel Level
Hardware Level
Trap
User Programs
17/05/2024
9. System calls & Libraries
• System call library
– System calls in user programs looks like normal C function.
– Then libraries maps them to primitives requires to enter in OS.
• Standard library
– User program uses libraries such as standard I/O .
– Linked with the programs at compile time and are part of the
user program
17/05/2024 9
10. System calls & Libraries
• System calls interacts with file subsystem
– Managing files and structures of file system
– Allocating file space
– Administering free space
– Controlling access to files
– Retrieving data for users
• System calls for process to interact with file subsystem
– open (to open file for reading/writing) & close
– read & write
– stat (to query the attributes of file)
– chown ( to change the record of who owns the file)
– chmod (to change access permissions of a file)
17/05/2024 10
11. 11
File Subsystem
Libraries
System Call Interface
File Subsystem
Process
Control
Subsystem
Inter-process
Communication
Scheduler
Memory
Management
Hardware Control
Hardware
Buffer Cache
Device Drivers
Character Block
User Level
Kernel
Level
Kernel Level
Hardware Level
Trap
User Programs
17/05/2024
12. 12
Buffering Mechanism
Libraries
System Call Interface
File Subsystem
Process
Control
Subsystem
Inter-process
Communication
Scheduler
Memory
Management
Hardware Control
Hardware
Buffer Cache
Device Drivers
Character Block
User Level
Kernel
Level
Kernel Level
Hardware Level
Trap
User Programs
17/05/2024
13. 13
Buffering Mechanism (Cont..)
• Interact with block I/O device drivers to initiate
data transfer to and from kernel.
• Device drivers are the kernel modules that controls
operations of peripheral devices.
• Block I/O devices are random access storage
devices.
– Such as Tape unit,
– hard disk,
– USB cameras etc.
17/05/2024
14. • File subsystem also interacts with “raw” I/O
device drivers without buffering mechanism.
• Raw devices also called as character devices.
– Such as serial port,
– parallel port,
– sound cards, etc.
17/05/2024 14
File Subsystem
15. 15
Process Control Subsystem
Libraries
System Call Interface
File Subsystem
Process
Control
Subsystem
Inter-process
Communication
Scheduler
Memory
Management
Hardware Control
Hardware
Buffer Cache
Device Drivers
Character Block
User Level
Kernel
Level
Kernel Level
Hardware Level
Trap
User Programs
17/05/2024
16. 16
Process Control Subsystem (Cont..)
• Responsible for process synchronization
• Inter-process communication (IPC)
• Memory management
• Process scheduling
• Communicate with file subsystem
– Loading a file into memory for execution
• Interact with set of system calls
– fork (to create new process)
– exec (to overlay image of program onto running process)
– exit (to finish executing process)
– wait (synchronize process execution with exit of previously forked process)
– brk (to control size of memory allocated to a process)
– signal (to control process response to extraordinary events)
17/05/2024
17. 17
Process Control Subsystem (Cont..)
• Memory management module
– Control the allocation of memory to a process
– In absence of enough memory kernel moves processes between main mem. &
sec. mem.
– Memory management is done with swapping & demand paging
• Scheduler module
– Allocate the CPU to processes
• Interprocess communication
– There are several forms.
• Asynchronous signaling of events
• Synchronous transmission of messages between processes.
17/05/2024
18. 18
Hardware Control
Libraries
System Call Interface
File Subsystem
Process
Control
Subsystem
Inter-process
Communication
Scheduler
Memory
Management
Hardware Control
Hardware
Buffer Cache
Device Drivers
Character Block
User Level
Kernel
Level
Kernel Level
Hardware Level
Trap
User Programs
17/05/2024
19. 19
Hardware Control (Cont..)
• Responsible for handling interrupts and for
communicating with the machine.
• Devices such as disks or terminals may interrupt
the CPU while a process is executing.
• If so, kernel may resume execution of interrupted
process after servicing the interrupt.
17/05/2024
20. Contents
• Architecture of Unix Operating System
• Introduction to the System Concepts
– An overview of the file subsystem
– Processes
• Context of a process
• Process states
• State transitions
• Sleep and wakeup
• Kernel Data Structure
• System Administration
17/05/2024 20
21. 17/05/2024
Files
• What is file?
– A container for data with name
• contiguous / non-contiguous storage
• Types of files
21
22. Overview of File Subsystem
• Each file on disk has an associated data structure
in the operating system, called an "inode"
17/05/2024 22
24. • Several file names may be associated with a
single inode, but each file is controlled by
exactly ONE inode.
• ls –i (to get inode number)
• $ ls -li /tmp/a /home/bob/xfile /var/tmp/file
114693 -rw-r-r- 3 hjc hjc 5 Sep 6 13:55 /tmp/a
114693 -rw-r-r- 3 hjc hjc 5 Sep 6 13:55 /home/bob/xfile
114693 -rw-r-r- 3 hjc hjc 5 Sep 6 13:55 /var/tmp/file
17/05/2024 24
Overview of File Subsystem (cont..)
Inode
no.
Permissions Link count Owner/group size Time Stamp
26. Example
• when a user issues open(``/etc/passwd'', ...) the
kernel performs the following operations:
– kernel finds the inode of the root directory and search the
corresponding file for the entry ``etc''
• when the entry ``etc'' is found, fetch its corresponding inode and check
that it is of type directory
– scan the file associated with ``/etc'' looking for ``passwd'‘
– finally, fetch the inode associated with passwd's directory entry,
verify that it is a regular file, and start accessing the file.
17/05/2024 26
27. • Inode Table
– List of all I-nodes
• Global File table
– It is global to the kernel
– It keeps track of the byte offset in the file where the user's next read/write
will start .
– It also keeps track of the access rights allowed to the opening process.
• User/Process File Descriptor table
– local to every process
– contains information like the identifiers of the files opened by the process.
– Whenever, a process creates / open a file, it gets an index from this table
called as ”File Descriptor”.
Data Structure for File Access
17/05/2024 27
User File
Descriptor Table
File
Table
Inode
Table
28. Interaction between tables with an Example
• Example:
• Process A:
fd1 = open("/var/file1", O_RDONLY);
fd2 = open("/var/file2", O_RDWR);
fd3 = open("/var/file1", O_WRONLY);
• Process B:
fd1 = open("/var/file1", O_RDONLY);
fd2 = open("/var/file3", O_RDONLY);
17/05/2024 28
30. Explanation of figure
• Each open() returns a file descriptor to the process, and the
corresponding entry in the user file descriptor table points to a
unique entry in the global file table even though a file(/var/file1) is
opened more then once.
• These global file table entries map to the in-core inode table entry.
Every opened file has a unique entry in the global file table and
the user file descriptor table but kernel keeps only single entry per
file in the in-core inode table.
• Separate entries are created in user file descriptor and global file
table, but only the reference count is increased in the inode table.
All the system calls related to file handling use these tables for
data manipulation.
17/05/2024 30
32. File System
• A file system is consists of a sequence of logical blocks
(512/1024 byte etc.)
17/05/2024 32
partition partition partition
disk drive
file system
super
block
boot
block
I-list
Data blocks for files, dirs, etc.
. . . . . . . .
.
i-node i-node i-node i-node
33. File System: Boot Block
• Typically occupies the first sector of the
disk
• Holds boot program, a short program for
loading the kernel of OS and launching it
17/05/2024 33
34. File System: Super Block
• Contains information about the geometry of the
physical disk
• Describes the state of a file system
• Describes the size of the file system
• a chain of free data block numbers
• a chain of free i-node numbers
17/05/2024 34
35. File System: Inode List
• Inodes are used to access disk files.
• Inodes maps the disk files
• For each file there is an inode entry in the inode
list block
• Inode list also keeps track of directory structure
17/05/2024 35
36. File System: Data Block
• Starts at the end of the inode list
• Contains disk files (Data)
• An allocated data block can belong to one and
only one file in the file system
17/05/2024 36
37. Contents
• Architecture of Unix Operating System
• Introduction to the System Concepts
– An overview of the file subsystem
– Processes
• Context of a process
• Process states
• State transitions
• Sleep and wakeup
• Kernel Data Structure
• System Administration
17/05/2024 37
38. Processes
• A process is the execution of a program
• A process is consists
– object code (program) to be executed
– data which the process works on
– Stack
– Required resources
17/05/2024 38
Code Data
Status
Resource R0
Resource R1
Resource RN
Abstract Machine Environment (OS)
Process Pk
39. • Many process can run simultaneously as kernel schedules
them for execution
• Several processes may be instances of one program
• A process reads and writes its data and stack sections, but
it cannot read or write the data and stack of other
processes
• A process communicates with all processes in UNIX
system are created by the fork system call, except the very
first process (process 0) which is created by the system
boot code
17/05/2024 39
Processes (Cont..)
40. Process (Cont..)
17/05/2024 40
• Kernel loads an executable file into memory
during ‘exec’ system call’
• Loaded process consist of text, data, & stack.
• Stack consist of logical stack frames
• Stack Frame has
– Local variables, address of previous frame, return address, parameters to
function
41. #include <fcntl.h>
char buffer[2048];
int version ™ 1;
main(argc, argv)
int argc;
char *argv[];
{
int fdold, fdnew;
if (argc !=- 3)
{ printfC'need 2 arguments for copy programn");
exit(l);
}
fdold =- open(argv[l], O_RDONLY);
/* open source file read only */
if (fdold 1)
{ printf ("cannot open file %sn", argv[l]);
exit(l);
}
fdnew - creat(argv[2], 0666); /* create target file rw for all */
if (fdnew -- -1) { printf ("cannot create file %sn", argv[2]); exit(1);}
copy(fdold, fdnew);
exit(l);
}
41
Processes (Cont..)
copy (old, new)
int old, new;
{
int count;
while ((count - readfold, buffer, sizeof(buffer))) >
0)
write (new, buffer, count);
}
17/05/2024
42. 17/05/2024 42
Processes (Cont..)
Addr of Frame 2
Ret addr after write call
Local
Vars
not
shown
params to
write
new buffer
count
Addr of Frame 1
Ret addr after copy call
Local
Vars
count
params to
copy
old
new
Addr of Frame 0
Ret addr after main call
Local
Vars
fdold
fdnew
params to
main
argc
argv
user stack
Addr of Frame 1
Ret addr after func2 call
Local
Vars
parms to kernel func2
Addr of Frame 0
Ret addr after func1 call
Local
Vars
params to kernel
func1
kernel stack
frame 3
call write()
frame 2
call copy()
frame 1
call main()
frame 3
frame 2
call func2()
frame 1
call func1()
frame 0 start frame 0 system call
interface
Direction of
stack growth
43. Processes (Cont..)
• Kernel has a process table that keeps track of
all active processes
• Process table contains a per process region
table whose entry points to entries in region
table.
17/05/2024 43
44. Data Structures for Process
17/05/2024 44
u area
main memory
region table
per process
region table
process table
45. • Fields of process table entry:
– State field
– User ID (UID)- owner of process
– An event descriptor set when a process is suspended
• u pointer (address)
17/05/2024 45
Process: Process Table
User
46. Process: Region Table
• A region is a contiguous area of a process’s
address space such as
– text, data and stack.
• Region table entries describes the attributes of
the region, such as
– whether it contains text or data,
– whether it is shared or private and
– Where the “data” of region is located in memory
17/05/2024 46
47. Process: U Area
• U Area is the extension of process table entry
• Fields of U Area
– Pointer to process table entry of currently executing process
– Parameters of the current system call, return values and error
codes.
– File descriptors of all open files
– Current directory and current root
– I/O parameters
– Process and file size limit
• Kernel can directly access fields of the U Area of the
executing process but not of the U Area of other processes
17/05/2024 47
48. Contents
• Architecture of Unix Operating System
• Introduction to the System Concepts
– An overview of the file subsystem
– Processes
• Context of a process
• Process states
• State transitions
• Sleep and wakeup
• Kernel Data Structure
• System Administration
17/05/2024 48
49. Process Context
• The context of a process is its state, which is
defined by
– Its text,
– Values of global user variables, data structures, and
machine registers
– Values stored in Process table and U Area
– Contents of user and kernel stack
• When executing a process, the system is said to
be executing in the context of the process.
17/05/2024 49
50. Context Switch
• When the kernel decides that it should execute
another process, it does a context switch, so that
the system executes in the context of the other
process
• When doing a context switch, the kernel saves
enough information so that it can later switch
back to the first process and resume its
execution.
17/05/2024 50
51. Mode of Process Execution
• The UNIX process runs in two modes:
– User mode
• Can access its own instructions and data, but not kernel
instruction and data
– Kernel mode
• Can access kernel and user instructions and data
• requires special instruction sequence to change from user
to kernel mode
• When a process executes a system call, the
execution mode of the process changes from
user mode to kernel mode
17/05/2024 51
52. Mode of Process Execution (cont..)
• When moving from user to kernel mode, the
kernel saves enough information so that it can
later return to user mode and continue execution
from where it left off.
• Mode change is not a context switch, just
change in mode.
17/05/2024 52
53. Contents
• Architecture of Unix Operating System
• Introduction to the System Concepts
– An overview of the file subsystem
– Processes
• Context of a process
• Process states and State transitions
• Sleep and wakeup
• Kernel Data Structure
• System Administration
17/05/2024 53
54. Process States
• Lifetime of process can be divided into a set
of states.
• Process states are:
– User mode: currently executing
– Kernel mode: currently executing
– Ready to run : soon as the scheduler chooses it
– Sleeping : waiting for I/O to complete.
17/05/2024 54
55. Process State Transition
17/05/2024 55
1
2
4 3
kernel
running
user
running
context switch
permissible
ready to run
return
sys call
or interrupt
interrupt,
interrupt return
schedule
process
sleep
wakeup
56. Process State Transition(cont..)
• The kernel allows a context switch only when a
process moves from the state kernel running to
the state asleep
• Process running in kernel mode cannot be
preempted by other processes.
• Kernel maintains consistency of its data
structures because it is non-preemptive, uses
mutual exclusion to restrict critical section.
17/05/2024 56
57. Example
struct queue {
} *bp, *bpl;
bpl—>forp — bp—>forp;
bpl—>backp — bp;
bp—>forp — bpl;
/* consider possible context switch here */
bp 1—>forp— >backp ~ bpl;
• Unix prevents such situation by disallowing
context switching when process is in kernel mode.
17/05/2024 57
58. Contents
• Architecture of Unix Operating System
• Introduction to the System Concepts
– An overview of the file subsystem
– Processes
• Context of a process
• Process states and State transitions
• Sleep and wakeup
• Kernel Data Structure
• System Administration
17/05/2024 58
59. Sleep and wakeup
• Process go to sleep when awaiting to happen some
event such as
– Waiting for I/O completion
– Waiting for process to exit
– Waiting for system resources to become available
– And so on
• When event occurs all sleeping process on that
event get wake up and enter in “ready to run” state
• Sleeping processes do not consume CPU resources
17/05/2024 59
60. Sleep and wakeup (cont..)
• Locks
– used to lock some shared data structures and other resources.
• Implementation of lock
while(condition is true)
sleep(event: condition becomes false);
set condition true;
• When event occur unlock the lock and awakens all
processes asleep on lock.
set condition false;
wakeup(event: condition is false);
• Consider processes A, B and C contended for a locked
buffer.
17/05/2024 60
62. Kernel Data Structures
• Fixed size tables
– Advantage: Kernel code is simple
– Disadvantage: Limits no. of entries in table
– If table size exceeds kernel should report error to
user.
• Dynamic allocation
– Excess table space is wasted
• For simplicity of kernel algorithms Fixed size
tables are used.
17/05/2024 62
63. System Administration
• Administrative Processes are used to perform various functions for
general welfare of user community.
– Disk formatting
– Creation of new file systems
– Repair of damaged file systems
– Kernel debugging, etc…
• Administrative processes are distinguished in terms of rights and
privileges provided to them.
– Eg. File access permissions allows manipulation to administrative process not
to user process.
• Superuser
– has special privileges.
– User may become superuser by using login-password.
17/05/2024 63
64. Exercise
• Assignment 1:
What should happen if the kernel attempts to awaken all processes
sleeping on an event, but no process are asleep on the event at the
time of the wakeup?
• No process is waken up.
– If scheduler finds at least one process in the queue, everything goes on.
– If not, no process will be scheduled, and kernel will not have anything to do so it
will not do anything. It will be idle.
– Then how would the kernel know, if it is idle, that some process wants it to do
something?
– Well, the answer is, scheduler comes a checks the ready to run queue on
every/some clock interrupts.
17/05/2024 64
65. Exercise
• Assignment 2:
Consider the following sequence of commands:
Case 1: grep main a.c b.c c.c > grepout &
wc —1 < grepout &
rm grepout &
The ampersand ("&") at the end of each command line informs the
shell to run the command in the background, and it can execute
each command line in parallel. Why is this not equivalent to the
following command line?
Case 2: grep main a.c b.c c.c | wc —1
17/05/2024 65
66. Excercise
• Assignment 3:
struct queue { } *bp, *bpl;
bp1—>forp = bp—>forp;
bp1—>backp = bp;
bp—>forp = bp1;
/* consider possible context switch here, and scheduled
process executes remove() function */
void remove(struct queue *qp)
{
qp—>forp —>backp = qp—>backp;
qp—>backp —>forp = qp—>forp;
qp—>forp = qp—>backp = NULL;
}
/*Return from context switch to execute remaining
code*/
bp1—>forp— >backp = bp1;
17/05/2024 66
So what is the status of the
link list if
case 1: qp = bp;
case 2: qp = bp1;
case 3: qp = Node that follows
bp in original Link List i.e.
before adding bp1.