1. The document provides an overview of the history and development of UNIX/Linux operating systems. It originated from projects in the 1960s and was further developed by Ken Thompson, Dennis Ritchie and others.
2. UNIX became popular due to its modular design, use of a hierarchical file system, treating all system resources as files, and ability to combine simple programs together.
3. The basic architecture of UNIX involves application programs interacting with the kernel via system calls to perform tasks like process and memory management.
Threads allow multiple tasks to run concurrently by sharing memory and resources within a process. Context switching between threads is typically faster than between processes. Threads can be created and started in different ways and use synchronization techniques like locks, monitors, mutexes, semaphores, and wait handles to coordinate access to resources. The thread pool optimizes thread usage by maintaining pooled threads that can be assigned tasks to run asynchronously. Exceptions on worker threads must be handled manually.
The vi editor is a powerful text editor installed by default in most Unix systems. It has two modes: command mode for taking actions and insert mode for inserting text. Common commands in vi include i to enter insert mode, Esc to exit insert mode, hjkl to navigate, dd to delete lines, p to paste, and :wq to save and quit. Vi is case sensitive and requires using keyboard commands rather than a mouse to edit files.
It is a simple powerpoint presentation on Linux Operating System of its brief and simplified introduction of this Operating System.
This is based on Ubuntu version of Linux.
The Linux boot process begins when the BIOS performs initial checks and loads the master boot record (MBR). The MBR then loads the GRUB boot loader, which displays a menu allowing the user to select an operating system. GRUB loads the Linux kernel, which initializes devices, mounts the root filesystem, and executes the init process. Init reads the /etc/inittab file to determine the run level and loads the appropriate startup scripts to fully boot the system.
This document provides an overview of virtual machines. It defines a virtual machine as a software implementation of a machine that executes programs like physical hardware. There are two main types: system virtual machines which provide a complete OS environment, and process virtual machines which provide a platform-independent programming environment. Popular virtual machine software discussed includes VMware Workstation, Xen, VirtualBox, and Citrix. VMware Workstation allows multiple operating systems to run simultaneously on a single PC without restarting. Xen is an open-source virtual machine monitor that allows multiple guest operating systems to run concurrently on the same hardware. It has a three-layer architecture consisting of a virtual machine layer, hypervisor layer, and hardware/physical layer.
The document provides descriptions of various Linux commands for basic usage and pentesting. It describes commands for making directories (mkdir), deleting empty directories (rmdir), viewing processes (ps), checking username (whoami), checking disk space (df), displaying date and time (date), checking connectivity (ping), downloading files (wget), looking up domain registration records (whois), navigating directories (cd), listing directory contents (ls), displaying command manuals (man), displaying text files (cat), copying files (cp), moving and renaming files (mv), removing files and directories (rm), creating empty files (touch), searching files (grep), using administrative privileges (sudo), viewing start of files (head), viewing end of files (
System calls provide an interface between processes and the operating system. They allow programs to request services like reading/writing files or communicating over a network. Common system calls include opening/closing files, reading/writing data, process creation/termination, and requesting the current time/date. System calls are grouped into categories like process control, file management, device management, information maintenance, and communications.
Process creation and termination In Operating SystemFarhan Aslam
The document discusses process creation, resource sharing, execution, and termination in Unix/Linux systems. It covers:
1. A parent process can create a child process using the fork() system call. The child process may fully or partially share resources with the parent process.
2. After creating a child process, the parent process can either wait for the child to finish using wait(), or both processes can run simultaneously.
3. Common system calls used in process management include fork(), wait(), and exec(). Fork() creates a child process, wait() pauses a parent until its child exits, and exec() replaces the current process with a new program.
Unix operating system architecture with file structure amol_chavan
The document provides information about the Unix operating system, including:
- Unix was originally developed in 1969 at Bell Labs and consists of programs that link the computer and user. There are various commercial and open-source variants available.
- It allows for multi-user access where many users can use the system at once, and multitasking where users can run multiple programs simultaneously.
- The kernel manages hardware interaction, memory, processes, I/O, and enforces access permissions. The shell interprets commands for the kernel to execute programs and utilities like cp, mv, cat, and grep.
- All data is organized into files within a hierarchical directory structure called the file system, with directories like
The document provides an overview of the UNIX operating system. It discusses the history and development of UNIX from the 1960s onward. It describes the key features of UNIX including its layered architecture, kernel, shell, process management, file system, and security features. It also covers basic UNIX commands for working with files and directories, permissions, and getting help. The objective is to introduce readers to fundamental concepts of the UNIX OS.
The document discusses kernel mode and user mode in operating systems. It defines the kernel as the core software that manages computer resources and allows users to share them. The kernel can interact directly with hardware and runs with privileged access, while user applications run in user mode with restrictions to prevent crashes. A process switches from user to kernel mode by making a system call to access privileged resources like hardware, files or memory. Interrupts from devices can also trigger a switch to kernel mode to handle the interrupt.
The document discusses kernels and their responsibilities. Kernels are the core component of an operating system that controls processes, memory management, I/O devices, and acts as an interface between hardware and applications. Kernels can take different forms such as monolithic kernels that run all services in the kernel space or micro kernels that separate services into user-space servers that communicate via messages. Hybrid kernels combine aspects of monolithic and micro kernels.
The document summarizes key aspects of operating system structures including:
1) Operating systems provide services to users like user interfaces, program execution, I/O, file manipulation and resource allocation. They also ensure efficient system operation through accounting and protection.
2) System calls are the programming interface to OS services, accessed via APIs. Common APIs include Win32, POSIX, and Java.
3) Operating systems can have different structures like layered, modular, microkernel and virtual machine approaches. They are implemented through system programs, boot processes, and configuration for specific hardware.
This document discusses semaphores and their use in solving critical section problems. It defines semaphores, describes their wait and signal methods, and types including counting and binary semaphores. It then explains how semaphores can be used to solve classical synchronization problems like the bounded buffer, readers-writers, and dining philosophers problems. Examples of semaphore implementations are provided for each problem.
- Shell scripting allows users to automate repetitive tasks by writing scripts of shell commands that can be executed automatically. The shell acts as an interface between the user and the operating system kernel, accepting commands and passing them to the kernel for execution. Common shells used for scripting include Bash, C Shell, and Korn Shell. Shell scripts use shell commands, control structures, and functions to perform automated tasks like backups and system monitoring.
CPU scheduling allows processes to share the CPU by pausing execution of some processes to allow others to run. The scheduler selects which process in memory runs on the CPU. There are four types of scheduling decisions: when a process pauses for I/O, switches from running to ready, finishes I/O, or terminates. Scheduling can be preemptive, where a higher priority process interrupts a running one, or non-preemptive. Common algorithms are first come first serve, shortest job first, priority, and round robin. Real-time scheduling aims to process data without delays and ensures the highest priority tasks run first.
This document discusses thrashing and allocation of frames in an operating system. It defines thrashing as when a processor spends most of its time swapping pieces of processes in and out rather than executing user instructions. This leads to low CPU utilization. It also discusses how to allocate a minimum number of frames to each process to prevent thrashing and ensure efficient paging.
Introduction to Network and System AdministrationDuressa Teshome
The document provides an overview of computer networks and system administration. It defines what a computer network is and describes different types of networks including WANs, LANs, peer-to-peer networks, and the internet. It also discusses servers, switches, hubs and the roles and responsibilities of a system administrator. Key aspects of system administration include automating tasks, documenting all changes, communicating with users, securing systems, and planning for expected and unexpected issues.
Message and Stream Oriented CommunicationDilum Bandara
Message and Stream Oriented Communication in distributed systems. Persistent vs. Transient Communication. Event queues, Pub/sub networks, MPI, Stream-based communication, Multicast communication
The document provides an overview of Linux kernel development including:
- Linux kernel versions follow a naming convention and source code can be found at kernel.org
- Kernel source code is installed by extracting tar files and applying patches
- The kernel directory has a hierarchy and is configured, built, and installed
- Kernel modules are installed separately from the kernel
- The kernel lacks features of userspace like memory protection and floating point support due to its low-level nature and process management
What is Soft Computing ? Difference between Soft Computing and Hard Computing. Classical Sets ,operations on classical sets ,Properties of classical sets
Unix is a multi-user, multi-tasking operating system that was first created in 1969 at Bell Labs. It allows many users to use the system simultaneously running multiple programs. Linux originated in 1991 as a personal project and is now a free, open source Unix-like operating system. It features multi-tasking, virtual memory, networking and more. Linux is widely used for servers, workstations, internet services and more due to its low cost, stability, and reliability compared to other operating systems.
The document provides an overview of the UNIX operating system. It discusses the components of a computer system including hardware, operating system, utilities, and application programs. It then defines the operating system as a program that acts as an interface between the user and computer hardware. The document outlines the goals of an operating system and provides a brief history of the development of UNIX from Multics. It also describes some key concepts of UNIX including the kernel, shell, files, directories, and multi-user capabilities.
This document provides an overview of a 5-day UNIX/Linux training course. The training covers topics such as Linux desktops and administration, Linux command line administration, networking, servers, and programming. Each day focuses on a different aspect of UNIX/Linux including installation, desktop environments, administration tasks from the command line interface, and networking. Common Linux distributions and benefits of UNIX/Linux are also discussed.
The document discusses the history and characteristics of UNIX operating systems. It describes how UNIX was developed in the 1960s and has since evolved into many different versions. Some key aspects of UNIX include its multi-user and multi-tasking capabilities, large number of free and commercial applications, and importance in internet development. The document also covers UNIX system calls, memory management, process management, and file systems.
The document discusses the key components and functions of the Unix system kernel. It describes the kernel as managing system resources like CPUs, memory and I/O devices. The major components are the process control subsystem, file subsystem, and hardware control. The kernel handles process management, device management, file management and provides services like virtual memory and networking. It uses a scheduler to allocate CPU time to processes based on their state and priority level.
The kernel manages processes, memory, and I/O. It has two levels - user level and kernel level. Processes interact with the kernel through system calls. A process contains text, data, stack, and a U area. The kernel uses process tables, region tables, and context switches to manage multiple simultaneous processes. The file system contains boot blocks, super blocks, inode lists, and data blocks to organize files on disk. Processes can create new processes using the fork system call.
This presentation discusses system calls and provides an overview of their key aspects:
System calls provide an interface between processes and the operating system. They allow programs to request services from the OS like reading/writing files. There are different methods of passing parameters to the OS, such as via registers, parameter blocks, or pushing to the stack. System calls fall into categories including process control, file management, device management, information maintenance, and communication. An example is given of how system calls would be used in a program to copy data between two files.
The document provides information about shells in Linux operating systems. It defines what a kernel and shell are, explains why shells are used, describes different types of shells, and provides examples of shell scripting. The key points are:
- The kernel manages system resources and acts as an intermediary between hardware and software. A shell is a program that takes commands and runs them, providing an interface between the user and operating system.
- Shells are useful for automating tasks, combining commands to create new ones, and adding functionality to the operating system. Common shells include Bash, Bourne, C, Korn, and Tcsh.
- Shell scripts allow storing commands in files to automate tasks.
This document provides an introduction to the UNIX operating system. It discusses that UNIX is a multi-user, multitasking operating system developed in 1969. It describes the three categories of UNIX systems and lists some popular flavors. It also summarizes key UNIX features like portability, security, and networking. Finally, it provides overviews of the UNIX file system structure, commands, utilities and applications.
- Linux originated as a clone of the UNIX operating system. Key developers included Linus Torvalds and developers from the GNU project.
- Linux is open source, multi-user, and can run on a variety of hardware. It includes components like the Linux kernel, shell, terminal emulator, and desktop environments.
- The document provides information on common Linux commands, files, users/groups, permissions, and startup scripts. It describes the Linux file system and compression/archiving utilities.
This document provides a summary of the Unix and GNU/Linux command line. It begins with an overview of files and file systems in Unix, including that everything is treated as a file. It then discusses command line interpreters (shells), and commands for handling files and directories like ls, cd, cp, and rm. It also covers redirecting standard input/output, pipes, and controlling processes. The document is intended as training material and provides a detailed outline of its contents.
What is a Kernel? : Introduction And Architecturepec2013
An Assembly car that has all stuffs except exteriors.This assembly is responsible for the movement of car and various other functions but we cannot travel in it as it has no seats or exteriors.
This assembly is analogous to kernel. Without it operating system is nothing. More formally, we can also call kernel a type of micro OS that handles all the very important functions.
While the main OS contains various other functions and kernel in the same way the car has shafts and tyres for rotations.
The document discusses operating systems and real-time operating systems. It defines an operating system as software that manages computer hardware resources and provides common services for programs. It then describes the main functions of an operating system including managing resources and devices, running applications, and providing a user interface. The document also discusses different types of operating systems including single-user/single-tasking, single-user/multi-tasking, and multi-user/multi-tasking. It defines a real-time operating system as one intended for real-time applications that has advanced scheduling algorithms to ensure deterministic timing behavior.
This document provides an overview of the Linux architecture. It describes Linux as a free UNIX-like kernel that forms the GNU/Linux operating system together with the GNU project software. The kernel acts as an intermediary between hardware and software, managing processes, scheduling, and resources. Processes can be in different states like running, waiting, or sleeping. The kernel uses preemptive multitasking to switch between processes and prioritize interrupts. System calls allow processes to be created and managed.
The document provides an outline on operating systems memory storage and management. It discusses how the OS must manage memory to ensure each process has enough space to execute without interfering with other processes. It describes different types of memory like cache, RAM, and disk and how the OS uses these properly. Specific topics covered include cache memory, RAM, virtual memory using swap files, the kernel, kernel types, shells, types of shells, shell scripting, and the four freedoms of open source software.
The document discusses operating system support for distributed computing systems. It describes how the operating system facilitates resource encapsulation, protection, and concurrent access. The OS provides processes, threads, communication, and an architecture to support middleware applications. Core OS components include a process manager, thread manager, communication manager, and memory manager. The OS uses protection rings and address space isolation to protect resources and enforce access control policies for processes. Threads allow sharing within a process while maintaining separation between processes.
This presentation covers the understanding of system calls for various resource management and covers system calls for file management in details. The understanding of using system calls helps to start with working with device driver programming on Unix/Linux OS.
The document provides a summary of 15 lectures on operating systems topics:
1. The first few lectures introduce concepts like computer organization, boot process, need for an operating system, and basic OS definitions.
2. Later lectures cover additional OS concepts like multiprogramming, multitasking, multiprocessing, memory protection, and interrupts.
3. The document discusses process management topics like process states, context switching, scheduling, and inter-process communication using pipes.
This document discusses processes and threads in operating systems. It defines a process as a program under execution with its own virtual CPU and state. Processes are created through system initialization, forking, or by user request. Processes transition between running, ready, blocked, and terminated states. A process control block stores process information. Context switching involves saving one process's state and restoring another's. Threads are lightweight processes within a process that share the process's resources. Threads provide concurrency and efficient communication compared to processes.
The document discusses basic operating system concepts including resource management, abstraction, and virtualization as main goals of an OS. It describes system calls as entry points for users to request OS services, and some common UNIX system calls. It also reviews key OS concepts like processes, threads, scheduling, synchronization, and memory management.
The document discusses operating system concepts including:
1. The operating system controls computer resources and provides an interface between applications and hardware.
2. It hides hardware complexity and manages resources like processors, memory, and devices.
3. Key OS components include processes, files, pipes, and system calls that allow programs to request services from the OS kernel.
This document provides a summary of key topics covered in lecture materials on operating systems. It discusses the basic functions and components of operating systems including process management, memory management, CPU scheduling, synchronization, deadlocks, and virtual memory. Specific scheduling algorithms like first-come first-served, shortest job first and round-robin are explained. The document also covers operating system services, system calls, protection and various historical generations of operating systems.
This document contains teaching material on distributed systems operating systems from the book "Distributed Systems: Concepts and Design". It discusses key concepts around processes, threads, communication, and operating system architecture to support distributed applications and middleware. The material is made available for teaching purposes and cannot be used without permission.
operating system calls input and output by (rohit malav)Rohit malav
Introduction of System Call
In computing, a system call is the programmatic way in which a computer program requests a service from the kernel of the operating system it is executed on. A system call is a way for programs to interact with the operating system. A computer program makes a system call when it makes a request to the operating system’s kernel. System call provides the services of the operating system to the user programs via Application Program Interface(API). It provides an interface between a process and operating system to allow user-level processes to request services of the operating system. System calls are the only entry points into the kernel system. All programs needing resources must use system calls.
Services Provided by System Calls :
Process creation and management
Main memory management
File Access, Directory and File system management
Device handling(I/O)
Protection
Networking, etc.
An introduction to Linux Container, Namespace & Cgroup.
Virtual Machine, Linux operating principles. Application constraint execution environment. Isolate application working environment.
This document summarizes key concepts from lecture notes on operating systems. It discusses the role of an operating system as an intermediary between the user and computer hardware. It describes the main components of an operating system including process management, memory management, file management, I/O management, and networking. It also covers process states, scheduling algorithms like FCFS, SJF, priority and round robin scheduling, and the goals of utilizing CPU resources efficiently and providing a user-friendly interface.
The document discusses key concepts related to Unix operating systems including:
1) The Unix file system uses a hierarchical structure with a root directory and standard file types like regular files, directories, and links.
2) Files are structured as sequences of bytes and have attributes like access rights and modes that determine who can read, write, and execute them.
3) The kernel provides services through system calls that programs interface with, and uses techniques like reentrancy, address spaces, synchronization, and device drivers to support processes running concurrently.
The operating system is a collection of programs that manage computer hardware resources and provide common services for computer programs. It acts as an interface between the user and computer hardware, and controls the computer system by managing all hardware and software. The primary functions of an operating system are to execute user programs, make the computer system convenient to use, and efficiently use computer hardware resources.
The document discusses operating systems and provides information on various topics related to operating systems including:
- What an operating system is and its main functions
- Types of operating systems such as single-user/multi-user, real-time, distributed, and mobile operating systems
- Components of an operating system including the kernel, shell, interrupts, and processes
- Concepts such as booting, memory management, virtual memory, and process scheduling
- Additional topics like threads, cloud computing, computer storage, and advantages of cloud computing
The document discusses key aspects of operating systems including:
- An operating system acts as an interface between the user and computer hardware and manages resources.
- UNIX was developed in the 1960s and rewritten in C in 1972, becoming widely used on various hardware.
- UNIX features include multitasking, multi-user access, portability and application tools.
- The system structure consists of hardware, kernel and user programs layers. The kernel isolates and manages resources.
- The user interacts via the file system hierarchy, running concurrent processes, and building programs from small tools.
This document contains lecture notes on operating systems. It covers topics like the definition and goals of operating systems, system components, processes and process states, CPU scheduling algorithms, synchronization between processes, deadlocks, memory management, and virtual memory. The key points are:
- An operating system acts as an intermediary between the user and computer hardware to provide an environment for running programs and efficiently using computer resources.
- System components include process management, memory management, file management, I/O management, networking, and protection.
- CPU scheduling algorithms like FCFS, SJF, priority, round-robin, and multilevel queue aim to make efficient use of CPU time between processes.
Distributed operating systems present users with an integrated computing platform that hides individual computers. They control all nodes in a network and allocate resources without user involvement. Distributed OS examples include cluster computer systems, V system, and Sprite. Middleware implements network-wide programming abstractions like RPC, event distribution, and resource discovery. The core OS functionality distributed OSs should provide for middleware includes encapsulation, protection, concurrent processing, and invocation mechanisms.
Chorus - Distributed Operating System [ case study ]Akhil Nadh PC
ChorusOS is a microkernel real-time operating system designed as a message-based computational model. ChorusOS started as the Chorus distributed real-time operating system research project at Institut National de Recherche en Informatique et Automatique (INRIA) in France in 1979. During the 1980s, Chorus was one of two earliest microkernels (the other being Mach) and was developed commercially by Chorus Systèmes. Over time, development effort shifted away from distribution aspects to real-time for embedded systems.
Similar to Chapter 1: Introduction to Unix / Linux Kernel (20)
What is the Use of API.onchange in Odoo 17Celine George
The @api.onchange decorator in Odoo is indeed used to trigger a method when a field's value changes. It's commonly used for validating data or triggering actions based on the change of a specific field. When the field value changes, the function decorated with @api.onchange will be called automatically.
Introduction to Literary Criticism 10 (1).pptxjessintv
Introduction to Literary Criticism prepared by Mrs.V.Jesinthal Mary,Asst.Professor,Dept of English and other foreign Languages (EFL), SRMIST Science and Humanities, Ramapuram,
Chennai-600089
Multi Language and Language Translation with the Website of Odoo 17Celine George
In this slide, we'll explore the Multi Language and Language Translation features in Odoo 17 Website. We'll show you how to easily set up and manage these powerful tools.
What is the Difference Between Lot & Serial Number in Odoo 17Celine George
In Odoo, both lots and serial numbers are used for tracking inventory, Now we can take look into about the difference between the lot number and serial number through this slide.
How to Integrate Facebook in Odoo 17 - Odoo 17 SlidesCeline George
Integrating Facebook with other platforms, such as business software like Odoo, serves several purposes and can offer numerous benefits depending on the specific goals of your business.
Dear Sakthi Thiru Dr. G. B. Senthil Kumar,
It is with great honor and respect that we extend this formal invitation to you. As a distinguished leader whose presence commands admiration and reverence, we cordially invite you to join us in celebrating the 25th anniversary of our graduation from Adhiparasakthi Engineering College on 27th July, 2024. we would be honored to have you by our side as we reflect on the achievements and memories of the past 25 years.
How to Restrict Price Modification to Managers in Odoo 17 POSCeline George
This slide will represent the price control functionality in Odoo 17 PoS module. This feature provides the opportunity to restrict price adjustments. We can limit pricing changes to managers exclusively with it.
Odoo 17 Project Module : New Features - Odoo 17 SlidesCeline George
The Project Management module undergoes significant enhancements, aimed at providing users with more robust tools for planning, organizing, and executing projects effectively.
Tale of a Scholar and a Boatman ~ A Story with Life Lessons (Eng. & Chi.).pptxOH TEIK BIN
A PowerPoint Presentation of a meaningful story that teaches important Life Lessons /Virtues /Moral values.
The texts are in English and Chinese.
For the Video with audio narration and explanation in English, please check out the Link:
https://www.youtube.com/watch?v=GH71Ds2WzU8
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.
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.
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.
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.
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.