SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel ProgrammingNalin Sharma
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module ProgrammingSaurabh Bangad
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernelguest547d74
 
Linux Porting to a Custom Board
Linux Porting to a Custom BoardLinux Porting to a Custom Board
Linux Porting to a Custom BoardPatrick Bellasi
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Toursamrat das
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System AdministrationSreenatha Reddy K R
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linuxsureskal
 
Unit 3 storage fundamentals
Unit 3 storage fundamentalsUnit 3 storage fundamentals
Unit 3 storage fundamentalsRaj vardhan
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBshimosawa
 

La actualidad más candente (20)

Linux Kernel Programming
Linux Kernel ProgrammingLinux Kernel Programming
Linux Kernel Programming
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module Programming
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
Linux device drivers
Linux device driversLinux device drivers
Linux device drivers
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Linux Porting to a Custom Board
Linux Porting to a Custom BoardLinux Porting to a Custom Board
Linux Porting to a Custom Board
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Unit 3 storage fundamentals
Unit 3 storage fundamentalsUnit 3 storage fundamentals
Unit 3 storage fundamentals
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Linux Programming
Linux ProgrammingLinux Programming
Linux Programming
 
systemd
systemdsystemd
systemd
 
Presentation on linux
Presentation on linuxPresentation on linux
Presentation on linux
 

Similar 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
 
Mass storage systems presentation operating systems
Mass storage systems presentation operating systemsMass storage systems presentation operating systems
Mass storage systems presentation operating systemsnight1ng4ale
 
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
 

Similar 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
 
File systems for Embedded Linux
File systems for Embedded LinuxFile systems for Embedded Linux
File systems for Embedded Linux
 
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
 
Mass storage systems presentation operating systems
Mass storage systems presentation operating systemsMass storage systems presentation operating systems
Mass storage systems presentation operating systems
 
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
 

Último

VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 

Último (20)

FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 

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