SlideShare uma empresa Scribd logo
1 de 17
Unix Internals
OS Architecture

                  Khader Shaik
Unix OS - Agenda
•   Boot Process
•   Shutdown Process
•   Process Management
•   Memory Management
•   File System
•   Networking




                         2
PROM – Programmable ROM
• Small non-volatile memory loaded with vendor
  specific software
• Performs some basic checks (POST) and finds
  the boot device; runs the boot program
  – Power-on Self Test (POST)
• Usually Boot program is stored on Block 0 (boot
  sector) of a Boot disk
• Boot program reads and loads the kernel
  program
• System can be booted from any other devices
  as well if you have access to ROM
  > boot cdrom (on Sun)
• More details are Vendor specific

                                                    3
Boot Process - Steps
• Kernel checks the Memory Availability
  – For eg: on Solaris kernel program is located under -
    /kernel/unix
• Probes & Configures hardware devices
• Updates the entries in /dev directory
  – /dev directory holds the information on all hardware
    devices installed
• Sets up all RAM tables to hold the processes
  information, memory allocation and open files
  etc
• At the of the booting KERNEL creates the init
  process

                                                           4
Dummy Processes
• Process that cannot be killed is known as
  DUMMY process
• Used for crucial system functions
• Created by Kernel during booting process
  – Part of the kernel
• Some of the samples are:
  – swapping services (xsched)
  – virtual memory paging services (pageout/vhand)
  – periodic buffer flushing service (bdflush)
• To see these process run command > ps -ef


                                                     5
OS Run Levels
• OS runs in different levels indicating a
  specific mode
• init command changes the run level of OS
  (init process is different from init
  command)
• Different levels have the different limited
  set of processes running
  – /etc/inittab – configuration file contains this
    info
• Different sample levels
 0 – Halt           1 – single user mode   2 – Multi-user without NFS
 3 – Full multi-user 4 – unused            5 – X11 graphical mode
 6 – Reboot etc.
                                                                        6
Process Management
•   Process Hierarchy
•   Process Creations
•   Process Management
•   Process Status
•   Communicating with Processes




                                   7
Process Hierarchy
• KERNEL process is created as part of the
  booting
• KERNEL first loads the init process
• All other processes are created by init
• Each process is given an unique process id
  (PID)
  – PID of init is 1
  – PID of kernel is 0 (zero)
• Each process is associated with its creator
  (parent) – identified by the Parent Process ID
  (PPID)
• init process is mother of all processes

                                                   8
Process Hierarchy ..cont
• When parent process of any process dies,
  it will be linked to init process as its
  parent
• Each process runs with a specific priority
  (PRI)
• For Eg:
  – Solaris Priorities vary from -20 to +20;
  – ‘-20’ being highest and ‘+20’ being the lowest
• ‘ps’ command lists the current processes
  running
  – ‘ps –ax’
                                                     9
Process Creation
• New processes are created using either fork or
  exec command
• fork creates an independent process
  – Except kernel everything else is created using fork
• exec creates a new process as a sub-process
  (thread) of the calling program
  – It shares the memory and other resources of the
    parent process
• Eg: a shell script with find command in it
  – Shell creates the independent (fork) process to
    execute the Shell script
  – Script process creates the sub-process (using exec)
    to execute the find command                           10
Process Creation ..
• Kernel allocates the memory to the new process
  known as ADDRESS SPACE
• Address Space contains four main segments
  – Text – stores the program instructions
  – Data – contains program variables (initialized)
    (dynamically grows?)
  – BSS/Heap Memory - contains un-initialized program
    variables (dynamically shrinking as used)
  – Free Store – unused memory; used as programs
    allocates
  – Stack – stores local variables and function
    parameters (dynamically grows)

                                                        11
Process Address Space (each process)

          Variable Size      Stack Memory


          Variable Size
          (grows & shrinks   Free Store
           as used)

           Variable Size     Heap Memory


            Fixed Size       Data Segment



            Fixed Size       Text Segment




                                            12
Process Execution Modes
• Kernel Mode
  – When process is executing kernel instructions is
    known as in KERNEL MODE
  – Control transfers to the Kernel and kernel carries out
    the instructions on behalf of the User process
  – During this mode, process can access entire Address
    Space of any process
  – Eg: User process is making a System call, interrupt,
    generating exception etc
• User Mode
  – Process created by user and executing in CPU is
    known as in USER MODE
  – It can access only its Address space and can’t
    access any other user’s space                        13
Various Process States
•   Created
•   Ready to run in Memory
•   Ready to run in Swap
•   Asleep in memory
•   Sleep, swapped
•   User Running
•   Kernel Running
•   Preempted
•   Zombie


                             14
Process Life Cycle




                     15
Process Interruptions – Two Types

• Interrupt - Caused by some event that is
  external to and asynchronous to the
  currently running process
  – Eg: Completion of IO.
• Trap - Error or exception condition
  generated within the currently running
  process.
  – Eg: illegal access to a file, arithmetic
    exception.
• ?(supervisor call) : explicit interruption
                                               16
Common SIGNALS
• SIGHUP - Hang-up       • SIGSYS - Bad argument
• SIGINT- Interrupt        to system call
• SIGQIT - Quit          • SIGPIPE - Write on pipe
• SIGINS - Illegal         with no one to read it
  Instruction            • SIGTERM - Software
• SIGTRAP - Trace Trap     termination signal from kill
• SIGKILL - Kill         • SIGSTOP - Stop signal
                         • For more info -
                           /usr/include/sys/signal.h



                                                    17

Mais conteúdo relacionado

Mais procurados

What is Kernel, basic idea of kernel
What is Kernel, basic idea of kernelWhat is Kernel, basic idea of kernel
What is Kernel, basic idea of kernelNeel Parikh
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingTushar B Kute
 
Kernel mode vs user mode in linux
Kernel mode vs user mode in linuxKernel mode vs user mode in linux
Kernel mode vs user mode in linuxSiddique Ibrahim
 
Linux advanced concepts - Part 1
Linux advanced concepts - Part 1Linux advanced concepts - Part 1
Linux advanced concepts - Part 1NAILBITER
 
What is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And ArchitectureWhat is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And Architecturepec2013
 
Unit 1-a-brief-history-of-unix-ppt
Unit 1-a-brief-history-of-unix-pptUnit 1-a-brief-history-of-unix-ppt
Unit 1-a-brief-history-of-unix-pptRahul Mashal
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and PropertiesSaadi Rahman
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernelguest547d74
 
KERNAL ARCHITECTURE
KERNAL ARCHITECTUREKERNAL ARCHITECTURE
KERNAL ARCHITECTURElakshmipanat
 
Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)Tushar B Kute
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module ProgrammingSaurabh Bangad
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programmingVandana Salve
 
Course 101: Lecture 2: Introduction to Operating Systems
Course 101: Lecture 2: Introduction to Operating Systems Course 101: Lecture 2: Introduction to Operating Systems
Course 101: Lecture 2: Introduction to Operating Systems Ahmed El-Arabawy
 
Linux architecture
Linux architectureLinux architecture
Linux architecturemcganesh
 
WELCOME TO THE CORE OF UNIX OPERATING SYSTEM
WELCOME TO THE CORE OF UNIX OPERATING SYSTEMWELCOME TO THE CORE OF UNIX OPERATING SYSTEM
WELCOME TO THE CORE OF UNIX OPERATING SYSTEMNarendra Mohan Mishra
 
Introduction to Linux Kernel
Introduction to Linux KernelIntroduction to Linux Kernel
Introduction to Linux KernelStryker King
 

Mais procurados (20)

What is Kernel, basic idea of kernel
What is Kernel, basic idea of kernelWhat is Kernel, basic idea of kernel
What is Kernel, basic idea of kernel
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Kernel mode vs user mode in linux
Kernel mode vs user mode in linuxKernel mode vs user mode in linux
Kernel mode vs user mode in linux
 
Linux advanced concepts - Part 1
Linux advanced concepts - Part 1Linux advanced concepts - Part 1
Linux advanced concepts - Part 1
 
What is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And ArchitectureWhat is a Kernel? : Introduction And Architecture
What is a Kernel? : Introduction And Architecture
 
Unit 1-a-brief-history-of-unix-ppt
Unit 1-a-brief-history-of-unix-pptUnit 1-a-brief-history-of-unix-ppt
Unit 1-a-brief-history-of-unix-ppt
 
Linux kernel Architecture and Properties
Linux kernel Architecture and PropertiesLinux kernel Architecture and Properties
Linux kernel Architecture and Properties
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
KERNAL ARCHITECTURE
KERNAL ARCHITECTUREKERNAL ARCHITECTURE
KERNAL ARCHITECTURE
 
Ch2
Ch2Ch2
Ch2
 
Unix kernal
Unix kernalUnix kernal
Unix kernal
 
Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)Part 01 Linux Kernel Compilation (Ubuntu)
Part 01 Linux Kernel Compilation (Ubuntu)
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module Programming
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programming
 
Course 101: Lecture 2: Introduction to Operating Systems
Course 101: Lecture 2: Introduction to Operating Systems Course 101: Lecture 2: Introduction to Operating Systems
Course 101: Lecture 2: Introduction to Operating Systems
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
WELCOME TO THE CORE OF UNIX OPERATING SYSTEM
WELCOME TO THE CORE OF UNIX OPERATING SYSTEMWELCOME TO THE CORE OF UNIX OPERATING SYSTEM
WELCOME TO THE CORE OF UNIX OPERATING SYSTEM
 
Introduction to Linux Kernel
Introduction to Linux KernelIntroduction to Linux Kernel
Introduction to Linux Kernel
 

Destaque (12)

Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
Unix
UnixUnix
Unix
 
Vi editor
Vi   editorVi   editor
Vi editor
 
Vi Editor
Vi EditorVi Editor
Vi Editor
 
Vi editor in linux
Vi editor in linuxVi editor in linux
Vi editor in linux
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Complete Guide for Linux shell programming
Complete Guide for Linux shell programmingComplete Guide for Linux shell programming
Complete Guide for Linux shell programming
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating System
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 

Semelhante a Unix Internals OS Architecture

Resource Monitoring and management
Resource Monitoring and management  Resource Monitoring and management
Resource Monitoring and management Duressa Teshome
 
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
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & ApplicationsMaulen Bale
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentationchnrketan
 
unixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfunixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfIxtiyorTeshaboyev
 
Erroneous co-routines can block system Formal interfaces slow down system
Erroneous co-routines can block system Formal  interfaces slow down systemErroneous co-routines can block system Formal  interfaces slow down system
Erroneous co-routines can block system Formal interfaces slow down systemjeronimored
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating SystemFatima Qayyum
 
opearating system notes mumbai university.pptx
opearating system notes mumbai university.pptxopearating system notes mumbai university.pptx
opearating system notes mumbai university.pptxssuser3dfcef
 
Deployment of WebObjects applications on CentOS Linux
Deployment of WebObjects applications on CentOS LinuxDeployment of WebObjects applications on CentOS Linux
Deployment of WebObjects applications on CentOS LinuxWO Community
 
Operating Systems 1 (6/12) - Processes
Operating Systems 1 (6/12) - ProcessesOperating Systems 1 (6/12) - Processes
Operating Systems 1 (6/12) - ProcessesPeter Tröger
 
Linux操作系统01 简介
Linux操作系统01 简介Linux操作系统01 简介
Linux操作系统01 简介lclsg123
 
Processes in unix
Processes in unixProcesses in unix
Processes in unixmiau_max
 

Semelhante a Unix Internals OS Architecture (20)

Resource Monitoring and management
Resource Monitoring and management  Resource Monitoring and management
Resource Monitoring and management
 
Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
unixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdfunixoperatingsystem-130327073532-phpapp01.pdf
unixoperatingsystem-130327073532-phpapp01.pdf
 
Erroneous co-routines can block system Formal interfaces slow down system
Erroneous co-routines can block system Formal  interfaces slow down systemErroneous co-routines can block system Formal  interfaces slow down system
Erroneous co-routines can block system Formal interfaces slow down system
 
Kernal
KernalKernal
Kernal
 
Operating systems
Operating systemsOperating systems
Operating systems
 
Os
OsOs
Os
 
UNIX Operating System
UNIX Operating SystemUNIX Operating System
UNIX Operating System
 
Linux Internals - Part II
Linux Internals - Part IILinux Internals - Part II
Linux Internals - Part II
 
opearating system notes mumbai university.pptx
opearating system notes mumbai university.pptxopearating system notes mumbai university.pptx
opearating system notes mumbai university.pptx
 
Unix Operaring System
Unix Operaring SystemUnix Operaring System
Unix Operaring System
 
Deployment of WebObjects applications on CentOS Linux
Deployment of WebObjects applications on CentOS LinuxDeployment of WebObjects applications on CentOS Linux
Deployment of WebObjects applications on CentOS Linux
 
Operating Systems 1 (6/12) - Processes
Operating Systems 1 (6/12) - ProcessesOperating Systems 1 (6/12) - Processes
Operating Systems 1 (6/12) - Processes
 
Linux操作系统01 简介
Linux操作系统01 简介Linux操作系统01 简介
Linux操作系统01 简介
 
Processes in unix
Processes in unixProcesses in unix
Processes in unix
 
Os introduction
Os introductionOs introduction
Os introduction
 
Os introduction
Os introductionOs introduction
Os introduction
 

Mais de Khader Shaik

The Dodd Frank & Derivatives market - Chapter 09
The Dodd Frank & Derivatives market - Chapter 09The Dodd Frank & Derivatives market - Chapter 09
The Dodd Frank & Derivatives market - Chapter 09Khader Shaik
 
Fixed Income Trading Platform Architecture
Fixed Income Trading Platform ArchitectureFixed Income Trading Platform Architecture
Fixed Income Trading Platform ArchitectureKhader Shaik
 
Interest Rate Derivatives
Interest Rate DerivativesInterest Rate Derivatives
Interest Rate DerivativesKhader Shaik
 
Securities Trade Life Cycle
Securities Trade Life CycleSecurities Trade Life Cycle
Securities Trade Life CycleKhader Shaik
 
Introduction to Portfolio Management
Introduction to Portfolio ManagementIntroduction to Portfolio Management
Introduction to Portfolio ManagementKhader Shaik
 
MS Access – Part 1 (One Day Workshop)
MS Access – Part 1 (One Day Workshop)MS Access – Part 1 (One Day Workshop)
MS Access – Part 1 (One Day Workshop)Khader Shaik
 
Inside Financial Markets
Inside Financial MarketsInside Financial Markets
Inside Financial MarketsKhader Shaik
 
Introduction to Derivatives Market
Introduction to  Derivatives MarketIntroduction to  Derivatives Market
Introduction to Derivatives MarketKhader Shaik
 
VBA & ADO MS Access – Part 2
VBA & ADO  MS Access – Part 2VBA & ADO  MS Access – Part 2
VBA & ADO MS Access – Part 2Khader Shaik
 
Fixed Income Trading and Platform Architecture
Fixed Income Trading and Platform ArchitectureFixed Income Trading and Platform Architecture
Fixed Income Trading and Platform ArchitectureKhader Shaik
 
Structured Products
Structured ProductsStructured Products
Structured ProductsKhader Shaik
 
Fixed Income Markets
Fixed Income MarketsFixed Income Markets
Fixed Income MarketsKhader Shaik
 
01 fi market_overview
01 fi market_overview01 fi market_overview
01 fi market_overviewKhader Shaik
 
Fixed Income Trading System Architecture
Fixed Income Trading System ArchitectureFixed Income Trading System Architecture
Fixed Income Trading System ArchitectureKhader Shaik
 
Introduction To Fixed Income Markets
Introduction To Fixed Income MarketsIntroduction To Fixed Income Markets
Introduction To Fixed Income MarketsKhader Shaik
 

Mais de Khader Shaik (15)

The Dodd Frank & Derivatives market - Chapter 09
The Dodd Frank & Derivatives market - Chapter 09The Dodd Frank & Derivatives market - Chapter 09
The Dodd Frank & Derivatives market - Chapter 09
 
Fixed Income Trading Platform Architecture
Fixed Income Trading Platform ArchitectureFixed Income Trading Platform Architecture
Fixed Income Trading Platform Architecture
 
Interest Rate Derivatives
Interest Rate DerivativesInterest Rate Derivatives
Interest Rate Derivatives
 
Securities Trade Life Cycle
Securities Trade Life CycleSecurities Trade Life Cycle
Securities Trade Life Cycle
 
Introduction to Portfolio Management
Introduction to Portfolio ManagementIntroduction to Portfolio Management
Introduction to Portfolio Management
 
MS Access – Part 1 (One Day Workshop)
MS Access – Part 1 (One Day Workshop)MS Access – Part 1 (One Day Workshop)
MS Access – Part 1 (One Day Workshop)
 
Inside Financial Markets
Inside Financial MarketsInside Financial Markets
Inside Financial Markets
 
Introduction to Derivatives Market
Introduction to  Derivatives MarketIntroduction to  Derivatives Market
Introduction to Derivatives Market
 
VBA & ADO MS Access – Part 2
VBA & ADO  MS Access – Part 2VBA & ADO  MS Access – Part 2
VBA & ADO MS Access – Part 2
 
Fixed Income Trading and Platform Architecture
Fixed Income Trading and Platform ArchitectureFixed Income Trading and Platform Architecture
Fixed Income Trading and Platform Architecture
 
Structured Products
Structured ProductsStructured Products
Structured Products
 
Fixed Income Markets
Fixed Income MarketsFixed Income Markets
Fixed Income Markets
 
01 fi market_overview
01 fi market_overview01 fi market_overview
01 fi market_overview
 
Fixed Income Trading System Architecture
Fixed Income Trading System ArchitectureFixed Income Trading System Architecture
Fixed Income Trading System Architecture
 
Introduction To Fixed Income Markets
Introduction To Fixed Income MarketsIntroduction To Fixed Income Markets
Introduction To Fixed Income Markets
 

Último

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Último (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

Unix Internals OS Architecture

  • 2. Unix OS - Agenda • Boot Process • Shutdown Process • Process Management • Memory Management • File System • Networking 2
  • 3. PROM – Programmable ROM • Small non-volatile memory loaded with vendor specific software • Performs some basic checks (POST) and finds the boot device; runs the boot program – Power-on Self Test (POST) • Usually Boot program is stored on Block 0 (boot sector) of a Boot disk • Boot program reads and loads the kernel program • System can be booted from any other devices as well if you have access to ROM > boot cdrom (on Sun) • More details are Vendor specific 3
  • 4. Boot Process - Steps • Kernel checks the Memory Availability – For eg: on Solaris kernel program is located under - /kernel/unix • Probes & Configures hardware devices • Updates the entries in /dev directory – /dev directory holds the information on all hardware devices installed • Sets up all RAM tables to hold the processes information, memory allocation and open files etc • At the of the booting KERNEL creates the init process 4
  • 5. Dummy Processes • Process that cannot be killed is known as DUMMY process • Used for crucial system functions • Created by Kernel during booting process – Part of the kernel • Some of the samples are: – swapping services (xsched) – virtual memory paging services (pageout/vhand) – periodic buffer flushing service (bdflush) • To see these process run command > ps -ef 5
  • 6. OS Run Levels • OS runs in different levels indicating a specific mode • init command changes the run level of OS (init process is different from init command) • Different levels have the different limited set of processes running – /etc/inittab – configuration file contains this info • Different sample levels 0 – Halt 1 – single user mode 2 – Multi-user without NFS 3 – Full multi-user 4 – unused 5 – X11 graphical mode 6 – Reboot etc. 6
  • 7. Process Management • Process Hierarchy • Process Creations • Process Management • Process Status • Communicating with Processes 7
  • 8. Process Hierarchy • KERNEL process is created as part of the booting • KERNEL first loads the init process • All other processes are created by init • Each process is given an unique process id (PID) – PID of init is 1 – PID of kernel is 0 (zero) • Each process is associated with its creator (parent) – identified by the Parent Process ID (PPID) • init process is mother of all processes 8
  • 9. Process Hierarchy ..cont • When parent process of any process dies, it will be linked to init process as its parent • Each process runs with a specific priority (PRI) • For Eg: – Solaris Priorities vary from -20 to +20; – ‘-20’ being highest and ‘+20’ being the lowest • ‘ps’ command lists the current processes running – ‘ps –ax’ 9
  • 10. Process Creation • New processes are created using either fork or exec command • fork creates an independent process – Except kernel everything else is created using fork • exec creates a new process as a sub-process (thread) of the calling program – It shares the memory and other resources of the parent process • Eg: a shell script with find command in it – Shell creates the independent (fork) process to execute the Shell script – Script process creates the sub-process (using exec) to execute the find command 10
  • 11. Process Creation .. • Kernel allocates the memory to the new process known as ADDRESS SPACE • Address Space contains four main segments – Text – stores the program instructions – Data – contains program variables (initialized) (dynamically grows?) – BSS/Heap Memory - contains un-initialized program variables (dynamically shrinking as used) – Free Store – unused memory; used as programs allocates – Stack – stores local variables and function parameters (dynamically grows) 11
  • 12. Process Address Space (each process) Variable Size Stack Memory Variable Size (grows & shrinks Free Store as used) Variable Size Heap Memory Fixed Size Data Segment Fixed Size Text Segment 12
  • 13. Process Execution Modes • Kernel Mode – When process is executing kernel instructions is known as in KERNEL MODE – Control transfers to the Kernel and kernel carries out the instructions on behalf of the User process – During this mode, process can access entire Address Space of any process – Eg: User process is making a System call, interrupt, generating exception etc • User Mode – Process created by user and executing in CPU is known as in USER MODE – It can access only its Address space and can’t access any other user’s space 13
  • 14. Various Process States • Created • Ready to run in Memory • Ready to run in Swap • Asleep in memory • Sleep, swapped • User Running • Kernel Running • Preempted • Zombie 14
  • 16. Process Interruptions – Two Types • Interrupt - Caused by some event that is external to and asynchronous to the currently running process – Eg: Completion of IO. • Trap - Error or exception condition generated within the currently running process. – Eg: illegal access to a file, arithmetic exception. • ?(supervisor call) : explicit interruption 16
  • 17. Common SIGNALS • SIGHUP - Hang-up • SIGSYS - Bad argument • SIGINT- Interrupt to system call • SIGQIT - Quit • SIGPIPE - Write on pipe • SIGINS - Illegal with no one to read it Instruction • SIGTERM - Software • SIGTRAP - Trace Trap termination signal from kill • SIGKILL - Kill • SIGSTOP - Stop signal • For more info - /usr/include/sys/signal.h 17