SlideShare una empresa de Scribd logo
1 de 12
Linux Architecture
Radu Boncea <radu@rotld.ro>
IT Architect
What is Linux?
• Usually we refer to Linux as an operating system
• Linux is a free UNIX-like kernel
• GNU is the actual operating system
• GNU is a free UNIX-like operating system
• GNU (Gnu’s Not Unix) project was started by Richard Stallman in 1983 with the sole
intention to build and adopt free software (TeX, Emacs, X Window System, Lisp, shell, GNU
C compiler, Empire game ;p …and GNU kernel )
• Linux project was started by Linus Torvalds in 1991
• The Linux operating system is actually GNU/Linux, that is GNU with Linux kernel, with the
linux kernel accounting 3% of the OS code, the GNU libraries accouting for 20%
• So by linux architecture we mean linux kernel architecture
What is the kernel?
• the kernel is an intermediary layer between the hardware and the software
• Its main function is to pass application requests to the hardware and to act as a low-level driver to
address the devices and components of the system.
• Kernel can also be viewed as:
• an enhanced machine that, in the view of the application, abstracts the computer on a high level
• a resource manager
• a library providing a range of system-oriented commands
• There are two kernel implementation strategies:
• microkernels – a central kernel with core functionality and the rest distributed to autonomous
processes which communicate with the central process. Known kernels: Amoeba, Symbian, QNX,
Blackberry, GNU (the GNU/GNU)
• monolithic kernel– one big binary, one big process. Performs better than microkernel, but
harder to develop and maintain. Know kernels: Unix (FreeBSD, OpenBSD, NetBSD, SunOS), Unix
SystemV (HP-UX), Unix-like (Linux), DOS (MS-DOS, FreeDOS)
• There are also hybrid implementations like XNU developed and maintained by Apple (taken from NeXT)
and used in Darwin, iOS, MacOSX
• Today Linux is monolithic, but has implemented dynamic loading of certain modules, like
Kernel overview
Processes, Task Switching, and Scheduling
• A process (task) is an executing (i.e., running)
instance of a program
• Task switching aka context switching: save task
state, give CPU time to other tasks
• Scheduling: prioritizing and deciding how much
CPU time to give to a task
Unix processes
•hierarchical scheme in which each process depends on a parent process
•kernel starts with init responsible for further system initialization actions and display of the login prompt
(or graphical login interface)
•pstree
•two methods of spawning child processes
•fork: after calling fork(), the created child process is an exact copy of the parent except for the
return value.
•exec: loads a new program into an existing content and then executes it
•clone: similar to fork but the process is not independent of the parent (used to implement threads)
•there are 3 process types: interactive processes, automatic processes (batch processing), daemons
•Namespaces: grouping processes
http://www.tldp.org/LDP/intro-linux/html/sect_04_01.html
Threads
• light-weight processes
• a process may consist of several threads that all share the same data and
resources but take different paths through the program code
• process can be seen as an executing program, whereas a thread is a program
function or routine running in parallel to the main program
Process Life Cycle
• Process states
• Running — The process is executing at the moment.
• Waiting— The process is able to run but is not allowed to because the CPU is allocated to another process. The
scheduler can select the process, if it wants to, at the next task switch.
• Sleeping— The process is sleeping and cannot run because it is waiting for an external event. The scheduler
cannot select the process at the next task switch.
• The system saves all processes in a process table
• Zombie processes are processes that defunct (resources have been release), but there are
still entries in process table
Preemptive Multitasking
• A process switches between user mode and kernel mode explicitly though system call or indirectly
though system interrupts
• The preemptive scheduling model of the kernel establishes a hierarchy that determines which process
states may be interrupted by which other states.
• Normal processes may always be interrupted— even by other processes. When an important
process becomes runnable —for example, an editor receives long-awaited keyboard input — the
scheduler can decide whether to execute the process immediately, even if the current process is
still happily running. This kind of preemption makes an important contribution to good
interactive behavior and low system latency.
• If the system is in kernel mode and is processing a system call, no other process in the system is
able to cause withdrawal of CPU time. The scheduler is forced to wait until execution of the
system call has terminated before it can select another process. However, the system call can be
suspended by an interrupt.
• Interrupts can suspend processes in user mode and in kernel mode. They have the highest
priority because it is essential to handle them as soon as possible after they are issued.
Process Management System Calls
• Process Duplication
• fork is the heavy-weight call because it creates a full copy of the parent process that then
executes as a child process
• vfork is similar to fork but does not create a copy of the data of the parent process. Instead, it
shares the data between the parent and child process. This saves a great deal of CPU time
• clone generates threads and enables a decision to be made as to exactly which elements are to
be shared between the parent and the child process and which are to be copied
• copy-on-write: technique to prevent all data of the parent process from being copied when fork is
executed.
• Kernel Threads
• processes started directly by the kernel itself
• Kernel daemons: manage deferred actions, periodically synchronize modified memory pages, etc
• Two types:
• The thread is started and waits until requested by the kernel to perform a specific action
• Once started, the thread runs at periodic intervals, checks the utilization of a specific
resource, and takes action when utilization exceeds or falls below a set limit value. The
kernel uses this type of thread for continuous monitoring tasks
Process monitoring
• watch
• /proc/[pid]/* http://man7.org/linux/man-
pages/man5/proc.5.html
• strings /proc/[pid]/environ
Must read
• https://www.gnu.org/gnu/manifesto.html
• Professional Linux® Kernel Architecture, Wolfgang Mauerer

Más contenido relacionado

La actualidad más candente

Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and PropertiesSaadi Rahman
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemSadia Bashir
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architectureSHAJANA BASHEER
 
Linux Presentation
Linux PresentationLinux Presentation
Linux PresentationNaiyan Noor
 
Linux Administration
Linux AdministrationLinux Administration
Linux AdministrationHarish1983
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsAhmed El-Arabawy
 
Linux presentation
Linux presentationLinux presentation
Linux presentationNikhil Jain
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linuxPapu Kumar
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examplesabclearnn
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linuxanandvaidya
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in LinuxRaghu Udiyar
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 

La actualidad más candente (20)

Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux OS presentation
Linux OS presentationLinux OS presentation
Linux OS presentation
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
4. linux file systems
4. linux file systems4. linux file systems
4. linux file systems
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
Linux
LinuxLinux
Linux
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
Linux
LinuxLinux
Linux
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in Linux
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 

Similar a Linux architecture

Unix operating system
Unix operating systemUnix operating system
Unix operating systemABhay Panchal
 
unixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfunixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfIxtiyorTeshaboyev
 
Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)Gaurav Aggarwal
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works. Fahad Farooq
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating SystemFatima Qayyum
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & ApplicationsMaulen Bale
 
CSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptxCSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptxakhilagajjala
 
Bca i-fundamental of computer-u-3-functions operating systems
Bca  i-fundamental of  computer-u-3-functions operating systemsBca  i-fundamental of  computer-u-3-functions operating systems
Bca i-fundamental of computer-u-3-functions operating systemsRai University
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentationchnrketan
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfFahanaAbdulVahab
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)Vaibhav Bajaj
 
Mca i-fundamental of computer-u-3-functions operating systems
Mca  i-fundamental of  computer-u-3-functions operating systemsMca  i-fundamental of  computer-u-3-functions operating systems
Mca i-fundamental of computer-u-3-functions operating systemsRai University
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsRai University
 

Similar a Linux architecture (20)

Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
unixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfunixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdf
 
Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)
 
Unix Operaring System
Unix Operaring SystemUnix Operaring System
Unix Operaring System
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating System
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
 
CSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptxCSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptx
 
Chapter 1: Introduction to Unix / Linux Kernel
Chapter 1: Introduction to Unix / Linux KernelChapter 1: Introduction to Unix / Linux Kernel
Chapter 1: Introduction to Unix / Linux Kernel
 
OS_MD_1.pdf
OS_MD_1.pdfOS_MD_1.pdf
OS_MD_1.pdf
 
Operating System Overview.pdf
Operating System Overview.pdfOperating System Overview.pdf
Operating System Overview.pdf
 
Advanced_OS_Unit 1 & 2.ppt
Advanced_OS_Unit 1 & 2.pptAdvanced_OS_Unit 1 & 2.ppt
Advanced_OS_Unit 1 & 2.ppt
 
Thread
ThreadThread
Thread
 
Bca i-fundamental of computer-u-3-functions operating systems
Bca  i-fundamental of  computer-u-3-functions operating systemsBca  i-fundamental of  computer-u-3-functions operating systems
Bca i-fundamental of computer-u-3-functions operating systems
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Mca i-fundamental of computer-u-3-functions operating systems
Mca  i-fundamental of  computer-u-3-functions operating systemsMca  i-fundamental of  computer-u-3-functions operating systems
Mca i-fundamental of computer-u-3-functions operating systems
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systems
 

Último

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 

Último (20)

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 

Linux architecture

  • 1. Linux Architecture Radu Boncea <radu@rotld.ro> IT Architect
  • 2. What is Linux? • Usually we refer to Linux as an operating system • Linux is a free UNIX-like kernel • GNU is the actual operating system • GNU is a free UNIX-like operating system • GNU (Gnu’s Not Unix) project was started by Richard Stallman in 1983 with the sole intention to build and adopt free software (TeX, Emacs, X Window System, Lisp, shell, GNU C compiler, Empire game ;p …and GNU kernel ) • Linux project was started by Linus Torvalds in 1991 • The Linux operating system is actually GNU/Linux, that is GNU with Linux kernel, with the linux kernel accounting 3% of the OS code, the GNU libraries accouting for 20% • So by linux architecture we mean linux kernel architecture
  • 3. What is the kernel? • the kernel is an intermediary layer between the hardware and the software • Its main function is to pass application requests to the hardware and to act as a low-level driver to address the devices and components of the system. • Kernel can also be viewed as: • an enhanced machine that, in the view of the application, abstracts the computer on a high level • a resource manager • a library providing a range of system-oriented commands • There are two kernel implementation strategies: • microkernels – a central kernel with core functionality and the rest distributed to autonomous processes which communicate with the central process. Known kernels: Amoeba, Symbian, QNX, Blackberry, GNU (the GNU/GNU) • monolithic kernel– one big binary, one big process. Performs better than microkernel, but harder to develop and maintain. Know kernels: Unix (FreeBSD, OpenBSD, NetBSD, SunOS), Unix SystemV (HP-UX), Unix-like (Linux), DOS (MS-DOS, FreeDOS) • There are also hybrid implementations like XNU developed and maintained by Apple (taken from NeXT) and used in Darwin, iOS, MacOSX • Today Linux is monolithic, but has implemented dynamic loading of certain modules, like
  • 5. Processes, Task Switching, and Scheduling • A process (task) is an executing (i.e., running) instance of a program • Task switching aka context switching: save task state, give CPU time to other tasks • Scheduling: prioritizing and deciding how much CPU time to give to a task
  • 6. Unix processes •hierarchical scheme in which each process depends on a parent process •kernel starts with init responsible for further system initialization actions and display of the login prompt (or graphical login interface) •pstree •two methods of spawning child processes •fork: after calling fork(), the created child process is an exact copy of the parent except for the return value. •exec: loads a new program into an existing content and then executes it •clone: similar to fork but the process is not independent of the parent (used to implement threads) •there are 3 process types: interactive processes, automatic processes (batch processing), daemons •Namespaces: grouping processes http://www.tldp.org/LDP/intro-linux/html/sect_04_01.html
  • 7. Threads • light-weight processes • a process may consist of several threads that all share the same data and resources but take different paths through the program code • process can be seen as an executing program, whereas a thread is a program function or routine running in parallel to the main program
  • 8. Process Life Cycle • Process states • Running — The process is executing at the moment. • Waiting— The process is able to run but is not allowed to because the CPU is allocated to another process. The scheduler can select the process, if it wants to, at the next task switch. • Sleeping— The process is sleeping and cannot run because it is waiting for an external event. The scheduler cannot select the process at the next task switch. • The system saves all processes in a process table • Zombie processes are processes that defunct (resources have been release), but there are still entries in process table
  • 9. Preemptive Multitasking • A process switches between user mode and kernel mode explicitly though system call or indirectly though system interrupts • The preemptive scheduling model of the kernel establishes a hierarchy that determines which process states may be interrupted by which other states. • Normal processes may always be interrupted— even by other processes. When an important process becomes runnable —for example, an editor receives long-awaited keyboard input — the scheduler can decide whether to execute the process immediately, even if the current process is still happily running. This kind of preemption makes an important contribution to good interactive behavior and low system latency. • If the system is in kernel mode and is processing a system call, no other process in the system is able to cause withdrawal of CPU time. The scheduler is forced to wait until execution of the system call has terminated before it can select another process. However, the system call can be suspended by an interrupt. • Interrupts can suspend processes in user mode and in kernel mode. They have the highest priority because it is essential to handle them as soon as possible after they are issued.
  • 10. Process Management System Calls • Process Duplication • fork is the heavy-weight call because it creates a full copy of the parent process that then executes as a child process • vfork is similar to fork but does not create a copy of the data of the parent process. Instead, it shares the data between the parent and child process. This saves a great deal of CPU time • clone generates threads and enables a decision to be made as to exactly which elements are to be shared between the parent and the child process and which are to be copied • copy-on-write: technique to prevent all data of the parent process from being copied when fork is executed. • Kernel Threads • processes started directly by the kernel itself • Kernel daemons: manage deferred actions, periodically synchronize modified memory pages, etc • Two types: • The thread is started and waits until requested by the kernel to perform a specific action • Once started, the thread runs at periodic intervals, checks the utilization of a specific resource, and takes action when utilization exceeds or falls below a set limit value. The kernel uses this type of thread for continuous monitoring tasks
  • 11. Process monitoring • watch • /proc/[pid]/* http://man7.org/linux/man- pages/man5/proc.5.html • strings /proc/[pid]/environ
  • 12. Must read • https://www.gnu.org/gnu/manifesto.html • Professional Linux® Kernel Architecture, Wolfgang Mauerer