SlideShare a Scribd company logo
1 of 33
Advanced Operating Systems
Unit I Introduction to UNIX/Linux Kernel
By,
Ashvini Chaudhari
Prerequisites:
1. Working knowledge of C programming.
2. Basic Computer Architecture concepts.
3. Basic algorithms and data structure concepts.
Prof.Prasad Sawant
,Assitiant Professor
,Dept. Of CS PCCCS
Chichwad
History
• 1965, AT&T Bell Lab & GE (General Electric Company) &
Project MAC of MIT : Multics
• Ken Thompson & Dennis Ritchie :UNICS
• 1971, UNIX was tried on more powerful machine PDP-1
• 1972, Dennis Ritchie developed ‘C’ language
• 1977, it was first ported (or say installed) on Non-PDP
machine called Interdata 8/32.
• 1982, AT&T itself created UNIX System III (for commercial
purpose), UNIX System IV (only for its internal use)
• Jan 1983, the UNIX System V Last Version
• Due to availability of source code, University California in
Berkeley, developed their own UNIX standard for VAX
machine, which was called as UNIX 4.3 BSD (Berkeley
Software Distribution).
•
Prof.Prasad Sawant
,Assitiant Professor
,Dept. Of CS PCCCS
Chichwad
Why Unix is popular
• easy to read, easy to understand, easy to move to other machines.
• It has easy user interface,
• Complex programs can be built by combining existing simple programs
(obviously by using pipe).
• It uses Hierarchical file system, which is easy to maintain & implement.
• In UNIX, everything storable is “file”, means device, terminals, even
directories are also files. UNIX considers “file” as stream of byte.
Thus system programming becomes easy.
• It is Multi-user, Multi-tasking, Multi-threading operating system.
• It hides hardware (i.e. machine architecture) from the programmer & end
user.
• Though system was written in C, it provides environmental support to
other languages like Basic, Fortran, Pascal, ADA, Cobol, Lisp, Prolog,
C++, Java, etc.
The Basic System Architecture
Prof.Prasad Sawant
,Assitiant Professor
,Dept. Of CS PCCCS
Chichwad
• This interaction (i.e. communication of application
program with the Kernel) is done by a set of functions
known as System Calls. In UNIX System Release V,
there are such 64 system calls, out of which 32 system
calls are sued much frequently.
•
Prof.Prasad Sawant
,Assitiant Professor
,Dept. Of CS PCCCS
Chichwad
Features
• The high-level features of UNIX system, mainly includes
3 points :
• The File System.
• The Processing Environment.
• The Building Block Primitives.
Sample File System Tree
Absolute Path
Relative Path
Prof.Prasad Sawant
,Assitiant Professor
,Dept. Of CS PCCCS
Chichwad
Characteristics
▫ A hierarchical (i.e. tree like) structure.
▫ Consistent treatment to file data (i.e. all files are
stream of bytes).
▫ Ability to create new & to delete old files.
▫ Dynamic growth of files.
▫ The protection of file data (by access permissions)
▫ Peripheral devices & directories are also
considered as files.
•
Prof.Prasad Sawant
,Assitiant Professor
,Dept. Of CS PCCCS
Chichwad
• “Files in UNIX are unformatted stream of bytes” and
system treats them with same system calls assessment.
• Thus “copy oldfile newfile” command will
operate on any type of file, whether it is a regular file
or directory file or device file.
•
Processing Environment
• A program is an executable file, and a process is an instance of
the program in execution .Many process can execute
simultaneously on UNIX system with no logical limit to their
number ,and many instances of a program can exist
simultaneously in the system .
Prof.Prasad Sawant
,Assitiant Professor
,Dept. Of CS PCCCS
Chichwad
• The major 4 system calls for process management are
fork ( ),
• exec ( ),
• wait ( ) and
• exit ( ), where fork ( ) is used to create a new process,
exec ( ) is used to execute the new process, wait ( ) is
used to allow the old process to wait for the completion
of the execution of new process and exit ( ) is used for
exiting the program
Prof.Prasad Sawant
,Assitiant Professor
,Dept. Of CS PCCCS
Chichwad
• When exec ( ) executes a child process, the child
process overlaps (or more precisely overlays) the
address space (memory) of parent process. And thus
there remains no memory for parent process to run, thus
parent process must wait for the completion of execution
of child.
User Perspective
• the fork system call to create a
new process. The new process,
called the child process, gets a 0
return value from fork and
invokes execl
• The execl call overlays the address
space of the child process with the
file "copy“.
• If the execl call succeeds, it never
returns because the process executes
in a new address space meanwhile,
the process that had invoked fork (the
parent) receives a non-0 return from
the call, calls wait:, suspending its
execution until copy finishes, prints
the message "copy done," and exits
User perspective: Shell
• The shell allows three types of commands.
• First, a command can be an executable file that contains object code
produced by compilation of source code (a C program for example).
• Second, a command can be an executable file that contains a sequence of
shell command lines
• The internal commands make the shell a programming language in
addition to a command interpreter and include commands for looping
User Perspective :
Building Block Primitives
• redirect I/O
• Processes conventionally have access to three files: they read
from their standard input file, write to their standard output
file, and write error messages to their standard error file.
User Perspective :
Building Block Primitives
• Pipe
• The pipe, a mechanism that allows a stream of data to be
passed between reader and writer processes. Processes can
redirect their standard output to a pipe to be read by other
processes that have redirected their standard input to come
from the pipe.
• The data that the first processes write into the pipe is the input
for the second processes. The second processes could also
redirect their output, and so on, depending on programming
need. Again, the processes need not know what type of file
their standard output is;they work regardless of whether
their standard output is a regular file, a pipe, or a device
Operating System Functions
▫ Process creation, termination, suspension and
inter-process communication.
▫ CPU scheduling for multiple processes in “time-
shared” manner. (here it is assumed that system
has one CPU)
▫ Memory allocation (either by swapping or paging)
for executing process/processes.
▫ File I/O, by creating file system.
▫ Insulates processes from hardware of the machine.
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Assumptions about h/w
• A process (i.e. running program) runs in two modes : - Kernel
Mode & User Mode.
• Kernel Mode : When a process makes a system call, then
it said that, now the process is running in Kernel Mode.
• User Mode : When the process is doing operations like
assignments, comparisons, looping, then it is said that, now the
process is running in User Mode.
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Interrupts :
• While handing the interrupts, Kernel gives first preference to
high priority interrupts and then to low priority interrupts.
• The priority of the interrupt is usually decided by the hardware
itself.
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Exceptions :
• Exception is an un-excepted event caused by a process. E.g. –
Addressing illegal memory by using pointer, execution of un-
allowed instruction (like dividing by 0) etc.
• Interrupts occur by the events which are external to the process
while exception occurs “in the middle” of the process due to
code instruction.
• It is also said that, interrupt occurs between the two
instructions and exception occurs at the instruction (obviously
at illegal instruction).
• For interrupt, system starts the next instruction normally after
handling the interrupt.
• But for exception, system handles the exception, and then
either re-starts the same instruction
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Processor Execution Level
• If a processor execution level is set to “Disk Interrupt
Level” (see in figure), then only “System Clock” &
“Machine Error” interrupts are processed and remaining
all lower level interrupts (including the set level) are
prevented
• During & Critical Activity
• Privileged Instructions :
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Memory Management :
• If sufficient memory is available, then Kernel can assign
memory to the program’s process by methods of
memory management, like swapping or demand paging.
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Unix System Architecture
Assumptions about Hardware
user VS kernel
1. Processes in user mode can access their own instructions and
data but not kernel instructions and data (or those of other
processes). Processes in kernel mode,however, can access
kernel and user addresses.
2. Some machine instructions are privileged and result in an
error when executed in user mode.
Concepts of Linux Programming
Files and the File system
1. The file is the most basic and fundamental abstraction in Linux. Linux
follows the everything-is-a-file
2. In order to be accessed, a file must first be opened. Files can be opened for
reading, writing, or both
3. An open file is referenced via a unique descriptor, a mapping from the
metadata associated with the open file back to the specific file itself. Inside
the Linux kernel, this descriptor is handled by an integer (of the C type int)
called the file descriptor, abbreviated fd.
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Files and the Filesystem
• Regular files
• What most of us call “files” are what Linux labels regular files. A regular file contains
bytes of data, organized into a linear array called a byte stream. In Linux, no further
organization or formatting is specified for a file.
• Directories and links
• Accessing a file via its inode number is cumbersome so files are always opened
from user space by a name, not an inode number.
• Directories are used to provide the names with which to access files. A directory
acts
• as a mapping of human-readable names to inode numbers. A name and inode pair
is
• called a link. The physical on-disk form of this mapping a simple table, a hash, or
• Whatever is implemented and managed by the kernel code that supports a given
• filesystem. Conceptually, a directory is viewed like any normal file, with the
difference
• that it contains only a mapping of names to inodes. The kernel directly uses this
• mapping to perform name-to-inode resolutions.
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Files and the File system
• Hard links
• Conceptually, nothing covered thus far would prevent multiple names
resolving to the same inode. Indeed, this is allowed. When multiple
links map different names to the same inode, we call them hard links.
• Hard links allow for complex filesystem structures with multiple
pathnames pointing to the same data. The hard links can be in the
same directory, or in two or more different directories.
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Files and the File system
• Symbolic links
• Hard links cannot span filesystems because an inode number is
meaningless outside of the inode’s own filesystem. To allow
links that can span filesystems, and that are a bit simpler and
less transparent, Unix systems also implement symbolic links
(often shortened to symlinks).
• Symbolic links look like regular files. A symlink has its own
inode and data chunk, which contains the complete pathname
of the linked-to file. This means symbolic links can point
anywhere, including to files and directories that reside on
different filesystems, and even to files and directories that do
not exist. A symbolic link that points to a nonexistent file is
called a broken link.
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Users and Groups
• Authorization in Linux is provided by users and groups. Each user is
associated with a unique positive integer called the user ID (uid). Each
process is in turn associated with exactly one uid, which identifies the user
running the process, and is called the process’ real uid. Inside the Linux
kernel, the uid is the only concept of a user. Users themselves, however,
refer to themselves and other users through usernames, not numerical values.
Usernames and their corresponding uids are stored in /etc/passwd, and
library routines map user-supplied usernames to the corresponding uids.
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Permissions
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Signals
• Signals are a mechanism for one-way asynchronous
notifications. A signal may be sent from the kernel to a
process, from a process to another process, or from a
process to itself. Signals typically alert a process to
some event, such as a segmentation fault, or the user
pressing Ctrl-C.
Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad
Inter process Communication
• Allowing processes to exchange information and notify
each other of events is one of an operating system’s
most important jobs.

More Related Content

What's hot

Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in LinuxHenry Osborne
 
Linux process management
Linux process managementLinux process management
Linux process managementRaghu nath
 
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.Muhammad SiRaj Munir
 
Lecture 1 introduction to parallel and distributed computing
Lecture 1   introduction to parallel and distributed computingLecture 1   introduction to parallel and distributed computing
Lecture 1 introduction to parallel and distributed computingVajira Thambawita
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor schedulingShashank Kapoor
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.pptRakesh Kadu
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architectureSHAJANA BASHEER
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignmentKarthi Keyan
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating SystemKathirvel Ayyaswamy
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O SystemsWayne Jones Jnr
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System ImplementationWayne Jones Jnr
 
Case study operating systems
Case study operating systemsCase study operating systems
Case study operating systemsAkhil Bevara
 
Process management in os
Process management in osProcess management in os
Process management in osMiong Lazaro
 

What's hot (20)

Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Process threads operating system.
Process threads operating system.Process threads operating system.
Process threads operating system.
 
Distributed file systems dfs
Distributed file systems   dfsDistributed file systems   dfs
Distributed file systems dfs
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.
 
Lecture 1 introduction to parallel and distributed computing
Lecture 1   introduction to parallel and distributed computingLecture 1   introduction to parallel and distributed computing
Lecture 1 introduction to parallel and distributed computing
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
 
Xen & virtualization
Xen & virtualizationXen & virtualization
Xen & virtualization
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Storage Management in Linux OS.ppt
Storage Management in Linux OS.pptStorage Management in Linux OS.ppt
Storage Management in Linux OS.ppt
 
Linux kernel architecture
Linux kernel architectureLinux kernel architecture
Linux kernel architecture
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating System
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Case study operating systems
Case study operating systemsCase study operating systems
Case study operating systems
 
Process management in os
Process management in osProcess management in os
Process management in os
 

Viewers also liked

Overview of linux kernel development
Overview of linux kernel developmentOverview of linux kernel development
Overview of linux kernel developmentPushkar Pashupat
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating Systemsubhsikha
 
Unix operating system
Unix operating systemUnix operating system
Unix operating systemABhay Panchal
 
Présentation Unix/Linux (mise à jour 2016)
Présentation Unix/Linux (mise à jour 2016)Présentation Unix/Linux (mise à jour 2016)
Présentation Unix/Linux (mise à jour 2016)Emmanuel Florac
 
UNIX and Linux - an introduction by Mathias Homann
UNIX and Linux - an introduction by Mathias HomannUNIX and Linux - an introduction by Mathias Homann
UNIX and Linux - an introduction by Mathias HomannMathias Homann
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in LinuxAnu Chaudhry
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Scriptsbmguys
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 
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
 

Viewers also liked (20)

Overview of linux kernel development
Overview of linux kernel developmentOverview of linux kernel development
Overview of linux kernel development
 
Soft computing Chapter 1
Soft computing Chapter 1Soft computing Chapter 1
Soft computing Chapter 1
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
Présentation Unix/Linux (mise à jour 2016)
Présentation Unix/Linux (mise à jour 2016)Présentation Unix/Linux (mise à jour 2016)
Présentation Unix/Linux (mise à jour 2016)
 
Unix kernal
Unix kernalUnix kernal
Unix kernal
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
 
System call
System callSystem call
System call
 
Kernal
KernalKernal
Kernal
 
System calls
System callsSystem calls
System calls
 
UNIX and Linux - an introduction by Mathias Homann
UNIX and Linux - an introduction by Mathias HomannUNIX and Linux - an introduction by Mathias Homann
UNIX and Linux - an introduction by Mathias Homann
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in Linux
 
Shell programming
Shell programmingShell programming
Shell programming
 
Unix - An Introduction
Unix - An IntroductionUnix - An Introduction
Unix - An Introduction
 
Unix
UnixUnix
Unix
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
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
 

Similar to Chapter 1: Introduction to Unix / Linux Kernel

Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & ApplicationsMaulen Bale
 
Unit 3 part a. operating system support
Unit 3 part a.  operating system support Unit 3 part a.  operating system support
Unit 3 part a. operating system support saira banu atham
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System CallsVandana Salve
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentationchnrketan
 
operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)Rohit malav
 
Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup. Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup. Neeraj Shrimali
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfFahanaAbdulVahab
 
operatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptxoperatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptxkrishnajoshi70
 
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
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfnikhil287188
 
Distributed computing
Distributed computingDistributed computing
Distributed computingDeepak John
 
Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]Akhil Nadh PC
 

Similar to Chapter 1: Introduction to Unix / Linux Kernel (20)

Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
 
Unit 3 part a. operating system support
Unit 3 part a.  operating system support Unit 3 part a.  operating system support
Unit 3 part a. operating system support
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
Os lectures
Os lecturesOs lectures
Os lectures
 
Chapter -2 operating system presentation
Chapter -2 operating system presentationChapter -2 operating system presentation
Chapter -2 operating system presentation
 
Os
OsOs
Os
 
Os concepts
Os conceptsOs concepts
Os concepts
 
OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
Chapter 6 os
Chapter 6 osChapter 6 os
Chapter 6 os
 
operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)operating system calls input and output by (rohit malav)
operating system calls input and output by (rohit malav)
 
Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup. Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup.
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
 
operatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptxoperatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptx
 
Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)Operating systems (For CBSE School Students)
Operating systems (For CBSE School Students)
 
Unit 1 introduction to operating system
Unit 1 introduction to operating systemUnit 1 introduction to operating system
Unit 1 introduction to operating system
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]Chorus - Distributed Operating System [ case study ]
Chorus - Distributed Operating System [ case study ]
 

Recently uploaded

Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 

Recently uploaded (20)

Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 

Chapter 1: Introduction to Unix / Linux Kernel

  • 1. Advanced Operating Systems Unit I Introduction to UNIX/Linux Kernel By, Ashvini Chaudhari
  • 2. Prerequisites: 1. Working knowledge of C programming. 2. Basic Computer Architecture concepts. 3. Basic algorithms and data structure concepts.
  • 3. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad History • 1965, AT&T Bell Lab & GE (General Electric Company) & Project MAC of MIT : Multics • Ken Thompson & Dennis Ritchie :UNICS • 1971, UNIX was tried on more powerful machine PDP-1 • 1972, Dennis Ritchie developed ‘C’ language • 1977, it was first ported (or say installed) on Non-PDP machine called Interdata 8/32. • 1982, AT&T itself created UNIX System III (for commercial purpose), UNIX System IV (only for its internal use) • Jan 1983, the UNIX System V Last Version • Due to availability of source code, University California in Berkeley, developed their own UNIX standard for VAX machine, which was called as UNIX 4.3 BSD (Berkeley Software Distribution). •
  • 4. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Why Unix is popular • easy to read, easy to understand, easy to move to other machines. • It has easy user interface, • Complex programs can be built by combining existing simple programs (obviously by using pipe). • It uses Hierarchical file system, which is easy to maintain & implement. • In UNIX, everything storable is “file”, means device, terminals, even directories are also files. UNIX considers “file” as stream of byte. Thus system programming becomes easy. • It is Multi-user, Multi-tasking, Multi-threading operating system. • It hides hardware (i.e. machine architecture) from the programmer & end user. • Though system was written in C, it provides environmental support to other languages like Basic, Fortran, Pascal, ADA, Cobol, Lisp, Prolog, C++, Java, etc.
  • 5. The Basic System Architecture
  • 6. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad • This interaction (i.e. communication of application program with the Kernel) is done by a set of functions known as System Calls. In UNIX System Release V, there are such 64 system calls, out of which 32 system calls are sued much frequently. •
  • 7. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Features • The high-level features of UNIX system, mainly includes 3 points : • The File System. • The Processing Environment. • The Building Block Primitives.
  • 8. Sample File System Tree Absolute Path Relative Path
  • 9. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Characteristics ▫ A hierarchical (i.e. tree like) structure. ▫ Consistent treatment to file data (i.e. all files are stream of bytes). ▫ Ability to create new & to delete old files. ▫ Dynamic growth of files. ▫ The protection of file data (by access permissions) ▫ Peripheral devices & directories are also considered as files. •
  • 10. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad • “Files in UNIX are unformatted stream of bytes” and system treats them with same system calls assessment. • Thus “copy oldfile newfile” command will operate on any type of file, whether it is a regular file or directory file or device file. •
  • 11. Processing Environment • A program is an executable file, and a process is an instance of the program in execution .Many process can execute simultaneously on UNIX system with no logical limit to their number ,and many instances of a program can exist simultaneously in the system .
  • 12. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad • The major 4 system calls for process management are fork ( ), • exec ( ), • wait ( ) and • exit ( ), where fork ( ) is used to create a new process, exec ( ) is used to execute the new process, wait ( ) is used to allow the old process to wait for the completion of the execution of new process and exit ( ) is used for exiting the program
  • 13. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad • When exec ( ) executes a child process, the child process overlaps (or more precisely overlays) the address space (memory) of parent process. And thus there remains no memory for parent process to run, thus parent process must wait for the completion of execution of child.
  • 14. User Perspective • the fork system call to create a new process. The new process, called the child process, gets a 0 return value from fork and invokes execl • The execl call overlays the address space of the child process with the file "copy“. • If the execl call succeeds, it never returns because the process executes in a new address space meanwhile, the process that had invoked fork (the parent) receives a non-0 return from the call, calls wait:, suspending its execution until copy finishes, prints the message "copy done," and exits
  • 15. User perspective: Shell • The shell allows three types of commands. • First, a command can be an executable file that contains object code produced by compilation of source code (a C program for example). • Second, a command can be an executable file that contains a sequence of shell command lines • The internal commands make the shell a programming language in addition to a command interpreter and include commands for looping
  • 16. User Perspective : Building Block Primitives • redirect I/O • Processes conventionally have access to three files: they read from their standard input file, write to their standard output file, and write error messages to their standard error file.
  • 17. User Perspective : Building Block Primitives • Pipe • The pipe, a mechanism that allows a stream of data to be passed between reader and writer processes. Processes can redirect their standard output to a pipe to be read by other processes that have redirected their standard input to come from the pipe. • The data that the first processes write into the pipe is the input for the second processes. The second processes could also redirect their output, and so on, depending on programming need. Again, the processes need not know what type of file their standard output is;they work regardless of whether their standard output is a regular file, a pipe, or a device
  • 18. Operating System Functions ▫ Process creation, termination, suspension and inter-process communication. ▫ CPU scheduling for multiple processes in “time- shared” manner. (here it is assumed that system has one CPU) ▫ Memory allocation (either by swapping or paging) for executing process/processes. ▫ File I/O, by creating file system. ▫ Insulates processes from hardware of the machine.
  • 19. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Assumptions about h/w • A process (i.e. running program) runs in two modes : - Kernel Mode & User Mode. • Kernel Mode : When a process makes a system call, then it said that, now the process is running in Kernel Mode. • User Mode : When the process is doing operations like assignments, comparisons, looping, then it is said that, now the process is running in User Mode.
  • 20. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Interrupts : • While handing the interrupts, Kernel gives first preference to high priority interrupts and then to low priority interrupts. • The priority of the interrupt is usually decided by the hardware itself.
  • 21. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Exceptions : • Exception is an un-excepted event caused by a process. E.g. – Addressing illegal memory by using pointer, execution of un- allowed instruction (like dividing by 0) etc. • Interrupts occur by the events which are external to the process while exception occurs “in the middle” of the process due to code instruction. • It is also said that, interrupt occurs between the two instructions and exception occurs at the instruction (obviously at illegal instruction). • For interrupt, system starts the next instruction normally after handling the interrupt. • But for exception, system handles the exception, and then either re-starts the same instruction
  • 22. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Processor Execution Level • If a processor execution level is set to “Disk Interrupt Level” (see in figure), then only “System Clock” & “Machine Error” interrupts are processed and remaining all lower level interrupts (including the set level) are prevented • During & Critical Activity • Privileged Instructions :
  • 23. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Memory Management : • If sufficient memory is available, then Kernel can assign memory to the program’s process by methods of memory management, like swapping or demand paging.
  • 24. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Unix System Architecture
  • 25. Assumptions about Hardware user VS kernel 1. Processes in user mode can access their own instructions and data but not kernel instructions and data (or those of other processes). Processes in kernel mode,however, can access kernel and user addresses. 2. Some machine instructions are privileged and result in an error when executed in user mode.
  • 26. Concepts of Linux Programming Files and the File system 1. The file is the most basic and fundamental abstraction in Linux. Linux follows the everything-is-a-file 2. In order to be accessed, a file must first be opened. Files can be opened for reading, writing, or both 3. An open file is referenced via a unique descriptor, a mapping from the metadata associated with the open file back to the specific file itself. Inside the Linux kernel, this descriptor is handled by an integer (of the C type int) called the file descriptor, abbreviated fd.
  • 27. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Files and the Filesystem • Regular files • What most of us call “files” are what Linux labels regular files. A regular file contains bytes of data, organized into a linear array called a byte stream. In Linux, no further organization or formatting is specified for a file. • Directories and links • Accessing a file via its inode number is cumbersome so files are always opened from user space by a name, not an inode number. • Directories are used to provide the names with which to access files. A directory acts • as a mapping of human-readable names to inode numbers. A name and inode pair is • called a link. The physical on-disk form of this mapping a simple table, a hash, or • Whatever is implemented and managed by the kernel code that supports a given • filesystem. Conceptually, a directory is viewed like any normal file, with the difference • that it contains only a mapping of names to inodes. The kernel directly uses this • mapping to perform name-to-inode resolutions.
  • 28. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Files and the File system • Hard links • Conceptually, nothing covered thus far would prevent multiple names resolving to the same inode. Indeed, this is allowed. When multiple links map different names to the same inode, we call them hard links. • Hard links allow for complex filesystem structures with multiple pathnames pointing to the same data. The hard links can be in the same directory, or in two or more different directories.
  • 29. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Files and the File system • Symbolic links • Hard links cannot span filesystems because an inode number is meaningless outside of the inode’s own filesystem. To allow links that can span filesystems, and that are a bit simpler and less transparent, Unix systems also implement symbolic links (often shortened to symlinks). • Symbolic links look like regular files. A symlink has its own inode and data chunk, which contains the complete pathname of the linked-to file. This means symbolic links can point anywhere, including to files and directories that reside on different filesystems, and even to files and directories that do not exist. A symbolic link that points to a nonexistent file is called a broken link.
  • 30. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Users and Groups • Authorization in Linux is provided by users and groups. Each user is associated with a unique positive integer called the user ID (uid). Each process is in turn associated with exactly one uid, which identifies the user running the process, and is called the process’ real uid. Inside the Linux kernel, the uid is the only concept of a user. Users themselves, however, refer to themselves and other users through usernames, not numerical values. Usernames and their corresponding uids are stored in /etc/passwd, and library routines map user-supplied usernames to the corresponding uids.
  • 31. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Permissions
  • 32. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Signals • Signals are a mechanism for one-way asynchronous notifications. A signal may be sent from the kernel to a process, from a process to another process, or from a process to itself. Signals typically alert a process to some event, such as a segmentation fault, or the user pressing Ctrl-C.
  • 33. Prof.Prasad Sawant ,Assitiant Professor ,Dept. Of CS PCCCS Chichwad Inter process Communication • Allowing processes to exchange information and notify each other of events is one of an operating system’s most important jobs.