SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
LINUX ARCHITECTURE
Outline
● Linux history
● Linux system architecture
● Linux kernel
● Kernel Architecture overview
● Kernel Functional overview
– File system
– Process management
– Memory management
– Device driver
– Networking
History of Linux
● First truly free UNIX like OS
● 1983 , GNU developed by Richard Stallman but kernel was missing
● Personal project by Finnish student Linus Torvalds to create a new
free operating system kernel in year 1991.
● Linus Torvalds began a project that later became the Linux kernel.
● First version of kernel 0.01
● 1991 from few c files to 18 million lines in 2015
History of Linux
Characteristics of linux OS
● Multiuser Capability
● Multitasking
● Portability – Works on different hardware
● Security
– Authentication
– Authorization
– Encryption
Linux system architecture
Linux system architecture
● Hardware layer – Consist of all peripherical devices like RAM, CPU, HD
● Kernel
– Core of OS
– Interacts with hardware
– Perform low level services
Shell
– Interface to kernel. Hides complexity of kernel from users.
– Take commands and executes kernel functions.
● Utilities
Linux system architecture
Linux system architecture
Linux kernel
● Monolithic kernel
● Supports
– Preemptive mutitasking
– Virtual memory
– Shared libraries
– Demand loading
– Memory mangement
– Threading
– Loadable kernel modules
Kernel Functional overview
Linux system architecture
● Virtual address space – 0x0000000 to 0xFFFFFFFF for 32bit linux
● User space - normal programs run
– Contains data, stack
● Kernel space - where kernel run
– Contains kernel code, pagetable..
File systems
● In UNIX everything is a file
● Filesystem is a hierarchical storage of data adhering to a specific
structure
● Tree like structure
● Folders named as directories
● Root - '/ '
File systems
● Sort of files : directories (d), special files(s), links(l), sockets (s),
named pipes(p)
● Major partitions on a Linux system:
– data partition: system data, including the root partition
containing all the data to start up and run the system
– swap partition: expansion of the computer's physical memory,
extra memory on hard disk(twice amount of RAM)
● Mount point
– Partitions attached through mount point
File systems
● Virtual file system
File system
● Concepts in VFS
– Super block – filesystem metadata
– Inode – File metadata(permissions, owner, creation time)
● VFS is designed to work with filesystems that understand and
implement such concepts
File systems - VFS
● Four object types of VFS
– Superblock object – specific mounted filesystem.
– inode object - a specific file.
– dentry object - directory entry, which is a single component of
a path.
– file object - an open file as associated with a process.
Process management and Scheduling
● Illusion of multitasking
● Issues kernel must resolve
– Applications must not interfere.
– CPU time shared fairly.
● Process priorities
– Hard real time process
– Soft real time process
● Allocation of CPU time
Process management and Scheduling
● Fork and exec system calls
● Process life cycle
– Running, Waiting, Sleeping, Zombie
Process management
Process management and Scheduling
● User and kernel mode
● Interrupts and kernel threads
● Pre emptive multitasking
– Scheduler can take global decisions to start and stop a process
Process management and scheduling
● I/O bound and processor bound process
– I/O bound : much time on waiting request from I/O
– Process bound : much time on executing code
● Nice values – range from -20 to 19 (default 0)
– Larger nice value low priority
● Time slice (default 20 ms)
– Numeric value showing
how long a task can run
Process management and scheduling
● Scheduling policy with example
– Consider two runnable task text editor and video encoder
– Text editor – I/O bound, video encoder – processor bound
– Text editor : Interactive process hence larger timeslice and high
priority
Memory management
● Virtual memory – makes system appear to have more memory than it
actually has
– Virtual memory greater than physical memory
– Each process have its own virtual address space
– Sharing of physical memory
● Zones
– ZONE_DMA - This zone contains pages that can undergo DMA.
– ZONE_DMA32 - these pages are accessible only by 32-bit devices
– ZONE_NORMAL - contains normal, regularly mapped, pages.
– ZONE_HIGHMEM - contains “high memory,” which are pages not
permanently mapped into the kernel’s address space.
Memory management
● Page table - Data structures used to map virtual to physical address
● Pages – memory divided into chunks of equal size. (Intel x86 4Kbytes)
Memory management
● Linux page tables
Memory management
● Demand paging
– Creating page faults and bringing image/file/data from disk to
physical memory
– Process should wait in queue until it is fetched
● Swapping
– No free space in RAM swapping done and done by kswapd
– The page selected for swapping has modified (dirty page)it is saved
as swap file.
– Least recently used(LRU) used for swapping.
● Shared virtual memory
– Two process sharing same physical memory
Memory management
● Page allocation and deallocation
– mem_map_t : decribes single physical page
– free_area : to find free pages
– Buddy algorithm to allocate and deallocate pages
– Page allocation results in page fragmentation
– Reallocation combiles fragmented pages into large blocks
● Malloc(), vmalloc() and kmalloc()
Memory management
Devices drivers
● Communicate I/O devices through device files.
● Character and Block devices
– Character - continous stream of data, eg:modem
– Block – BLock of data, eg: hard disc
Device drivers
● Dynamic creation of device files
Thank you

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Memory management in Linux kernel
Memory management in Linux kernelMemory management in Linux kernel
Memory management in Linux kernel
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
File systems for Embedded Linux
File systems for Embedded LinuxFile systems for Embedded Linux
File systems for Embedded Linux
 
Linux internal
Linux internalLinux internal
Linux internal
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
 
Linux memory
Linux memoryLinux memory
Linux memory
 
linux device driver
linux device driverlinux device driver
linux device driver
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driver
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
 
Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto project
 
Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
 
Linux device drivers
Linux device driversLinux device drivers
Linux device drivers
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux Memory
Linux MemoryLinux Memory
Linux Memory
 

Semelhante a Linux kernel architecture

Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Vivian Vhaves
 
Chap1_Part2.pptx
Chap1_Part2.pptxChap1_Part2.pptx
Chap1_Part2.pptxNMohd3
 
Linux操作系统01 简介
Linux操作系统01 简介Linux操作系统01 简介
Linux操作系统01 简介lclsg123
 
Resource Monitoring and management
Resource Monitoring and management  Resource Monitoring and management
Resource Monitoring and management Duressa Teshome
 
InnoDB architecture and performance optimization (Пётр Зайцев)
InnoDB architecture and performance optimization (Пётр Зайцев)InnoDB architecture and performance optimization (Пётр Зайцев)
InnoDB architecture and performance optimization (Пётр Зайцев)Ontico
 
Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化YUCHENG HU
 
Mac Memory Analysis with Volatility
Mac Memory Analysis with VolatilityMac Memory Analysis with Volatility
Mac Memory Analysis with VolatilityAndrew Case
 
11. operating-systems-part-1
11. operating-systems-part-111. operating-systems-part-1
11. operating-systems-part-1Muhammad Ahad
 
Lecture 8 comp forensics 03 10-18 file system
Lecture 8 comp forensics 03 10-18 file systemLecture 8 comp forensics 03 10-18 file system
Lecture 8 comp forensics 03 10-18 file systemAlchemist095
 
unixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfunixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfIxtiyorTeshaboyev
 

Semelhante a Linux kernel architecture (20)

Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)Ospresentation 120112074429-phpapp02 (1)
Ospresentation 120112074429-phpapp02 (1)
 
Chap1_Part2.pptx
Chap1_Part2.pptxChap1_Part2.pptx
Chap1_Part2.pptx
 
Os
OsOs
Os
 
ubantu ppt.pptx
ubantu ppt.pptxubantu ppt.pptx
ubantu ppt.pptx
 
Linux操作系统01 简介
Linux操作系统01 简介Linux操作系统01 简介
Linux操作系统01 简介
 
Ubuntu OS Presentation
Ubuntu OS PresentationUbuntu OS Presentation
Ubuntu OS Presentation
 
Os
OsOs
Os
 
Resource Monitoring and management
Resource Monitoring and management  Resource Monitoring and management
Resource Monitoring and management
 
InnoDB architecture and performance optimization (Пётр Зайцев)
InnoDB architecture and performance optimization (Пётр Зайцев)InnoDB architecture and performance optimization (Пётр Зайцев)
InnoDB architecture and performance optimization (Пётр Зайцев)
 
Linux para iniciantes
Linux para iniciantesLinux para iniciantes
Linux para iniciantes
 
Linux Kernel
Linux KernelLinux Kernel
Linux Kernel
 
Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化Innodb 和 XtraDB 结构和性能优化
Innodb 和 XtraDB 结构和性能优化
 
Mac Memory Analysis with Volatility
Mac Memory Analysis with VolatilityMac Memory Analysis with Volatility
Mac Memory Analysis with Volatility
 
Unix File System
Unix File SystemUnix File System
Unix File System
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
 
11. operating-systems-part-1
11. operating-systems-part-111. operating-systems-part-1
11. operating-systems-part-1
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
Ioppt
IopptIoppt
Ioppt
 
Lecture 8 comp forensics 03 10-18 file system
Lecture 8 comp forensics 03 10-18 file systemLecture 8 comp forensics 03 10-18 file system
Lecture 8 comp forensics 03 10-18 file system
 
unixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfunixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdf
 

Último

University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Último (20)

University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 

Linux kernel architecture

  • 2. Outline ● Linux history ● Linux system architecture ● Linux kernel ● Kernel Architecture overview ● Kernel Functional overview – File system – Process management – Memory management – Device driver – Networking
  • 3. History of Linux ● First truly free UNIX like OS ● 1983 , GNU developed by Richard Stallman but kernel was missing ● Personal project by Finnish student Linus Torvalds to create a new free operating system kernel in year 1991. ● Linus Torvalds began a project that later became the Linux kernel. ● First version of kernel 0.01 ● 1991 from few c files to 18 million lines in 2015
  • 5. Characteristics of linux OS ● Multiuser Capability ● Multitasking ● Portability – Works on different hardware ● Security – Authentication – Authorization – Encryption
  • 7. Linux system architecture ● Hardware layer – Consist of all peripherical devices like RAM, CPU, HD ● Kernel – Core of OS – Interacts with hardware – Perform low level services Shell – Interface to kernel. Hides complexity of kernel from users. – Take commands and executes kernel functions. ● Utilities
  • 10. Linux kernel ● Monolithic kernel ● Supports – Preemptive mutitasking – Virtual memory – Shared libraries – Demand loading – Memory mangement – Threading – Loadable kernel modules
  • 12. Linux system architecture ● Virtual address space – 0x0000000 to 0xFFFFFFFF for 32bit linux ● User space - normal programs run – Contains data, stack ● Kernel space - where kernel run – Contains kernel code, pagetable..
  • 13. File systems ● In UNIX everything is a file ● Filesystem is a hierarchical storage of data adhering to a specific structure ● Tree like structure ● Folders named as directories ● Root - '/ '
  • 14. File systems ● Sort of files : directories (d), special files(s), links(l), sockets (s), named pipes(p) ● Major partitions on a Linux system: – data partition: system data, including the root partition containing all the data to start up and run the system – swap partition: expansion of the computer's physical memory, extra memory on hard disk(twice amount of RAM) ● Mount point – Partitions attached through mount point
  • 16. File system ● Concepts in VFS – Super block – filesystem metadata – Inode – File metadata(permissions, owner, creation time) ● VFS is designed to work with filesystems that understand and implement such concepts
  • 17. File systems - VFS ● Four object types of VFS – Superblock object – specific mounted filesystem. – inode object - a specific file. – dentry object - directory entry, which is a single component of a path. – file object - an open file as associated with a process.
  • 18. Process management and Scheduling ● Illusion of multitasking ● Issues kernel must resolve – Applications must not interfere. – CPU time shared fairly. ● Process priorities – Hard real time process – Soft real time process ● Allocation of CPU time
  • 19. Process management and Scheduling ● Fork and exec system calls ● Process life cycle – Running, Waiting, Sleeping, Zombie
  • 21. Process management and Scheduling ● User and kernel mode ● Interrupts and kernel threads ● Pre emptive multitasking – Scheduler can take global decisions to start and stop a process
  • 22. Process management and scheduling ● I/O bound and processor bound process – I/O bound : much time on waiting request from I/O – Process bound : much time on executing code ● Nice values – range from -20 to 19 (default 0) – Larger nice value low priority ● Time slice (default 20 ms) – Numeric value showing how long a task can run
  • 23. Process management and scheduling ● Scheduling policy with example – Consider two runnable task text editor and video encoder – Text editor – I/O bound, video encoder – processor bound – Text editor : Interactive process hence larger timeslice and high priority
  • 24. Memory management ● Virtual memory – makes system appear to have more memory than it actually has – Virtual memory greater than physical memory – Each process have its own virtual address space – Sharing of physical memory ● Zones – ZONE_DMA - This zone contains pages that can undergo DMA. – ZONE_DMA32 - these pages are accessible only by 32-bit devices – ZONE_NORMAL - contains normal, regularly mapped, pages. – ZONE_HIGHMEM - contains “high memory,” which are pages not permanently mapped into the kernel’s address space.
  • 25. Memory management ● Page table - Data structures used to map virtual to physical address ● Pages – memory divided into chunks of equal size. (Intel x86 4Kbytes)
  • 27. Memory management ● Demand paging – Creating page faults and bringing image/file/data from disk to physical memory – Process should wait in queue until it is fetched ● Swapping – No free space in RAM swapping done and done by kswapd – The page selected for swapping has modified (dirty page)it is saved as swap file. – Least recently used(LRU) used for swapping. ● Shared virtual memory – Two process sharing same physical memory
  • 28. Memory management ● Page allocation and deallocation – mem_map_t : decribes single physical page – free_area : to find free pages – Buddy algorithm to allocate and deallocate pages – Page allocation results in page fragmentation – Reallocation combiles fragmented pages into large blocks ● Malloc(), vmalloc() and kmalloc()
  • 30. Devices drivers ● Communicate I/O devices through device files. ● Character and Block devices – Character - continous stream of data, eg:modem – Block – BLock of data, eg: hard disc
  • 31. Device drivers ● Dynamic creation of device files