Unix foundations


Download 1.51 Mb.
bet2/9
Sana18.06.2023
Hajmi1.51 Mb.
#1583315
1   2   3   4   5   6   7   8   9
Bog'liq
process

Summary of UNIX History

  • V1
  • .
  • .
  • .
  • V6
  • V7
  • 32V
  • V8
  • V10
  • Plan9
  • PWB
  • PWB2
  • SIII
  • SYSV
  • V.2
  • V.3
  • V.3.2
  • SVR4
  • SCO
  • Xenix2
  • Xenix
  • BSD
  • 2BSD
  • .
  • .
  • .
  • 2.9BSD
  • 2.10BSD
  • 2.11BSD
  • 3BSD
  • 4BSD
  • 4.2BSD
  • 4.3BSD
  • 4.4BSD
  • Ultrix
  • Mach
  • OSF1
  • LINUX
  • Solaris
  • AIX
  • SUNOS

Flexibility

  • Traditional Kernel: file, scheduling, executable file formats

Modern UNIX Kernel

Assessment of UNIX

  • Advantages: - open software process, - well designed, small and simple kernel, - text files in system databases, - simple, uniform interface to I/O devices, - portability (written in C)

Assessment of UNIX

  • Disadvantages: - expansion of the more and more complex I/O library, - unfriendly user interface, - building block approach to tools, but not to the kernel, - too many versions and standards, - monolithic, unmodular and more and more complex kernel.

UNIX Architecture

  • Hardware is surrounded by the operating-system
  • Operating system is called the kernel
  • Comes with a number of user services and interfaces
    • shell
    • C compiler

UNIX Architecture

  • Hardware
  • Kernel
  • Compiler Components
  • Compiler
  • Application Programs

The layers of a UNIX system.

  • The layers of a UNIX system.
  • User Interface

UNIX Utility Programs

  • A few of the more common UNIX utility programs required by POSIX

UNIX shell programming

  • cp src dest
  • head –20 file
  • ls *.c
  • sort out
  • sort temp;head –30
  • sort
  • grep ter *.t | sort | head –20 | tail –5 >foo
  • sort

Process

  • In UNIX
    • Process is an instance of a running program.
    • Lifetime: fork/vfork->exec->exit
    • Well-defined hierarchy: parent,child,init,
    • init process: the top process
    • swapper & pagedeamon
    • Orphans: the parent process is terminated.

Process Creation

  • Submission of a batch job
  • User logs on
  • Created to provide a service such as printing
  • Spawned by an existing process

Process Termination

  • Batch job issues Halt instruction
  • User logs off
  • Process executes a service request to terminate
  • Error and fault conditions

Reasons for Process Termination

  • Normal completion
  • Time limit exceeded
  • Memory unavailable
  • Bounds violation
  • Protection error
    • example write to read-only file
  • Arithmetic error
  • Time overrun
    • process waited longer than a specified maximum for an event

Reasons for Process Termination

  • I/O failure
  • Invalid instruction
    • happens when try to execute data
  • Privileged instruction
  • Data misuse
  • Operating system intervention
    • such as when deadlock occurs
  • Parent terminates so child processes terminate
  • Parent request

Process States

  • The Running state
    • The process that gets executed (single CPU)
  • The Ready state
    • any process that is ready to be executed
  • The Blocked state
    • when a process cannot execute until some event occurs (ex: the completion of an I/O)

Process States

  • The New state
    • OS has performed the necessary actions to create the process
    • but has not yet committed to execute the process (not yet admitted)
      • because resources are limited
  • The Exit state
    • Termination moves the process to this state
    • It is no longer eligible for execution
    • Tables and other info are temporarily preserved for auxiliary program

Five-State Process Model

  • New
  • Ready
  • Running
  • Exit
  • Blocked
  • Admit
  • Event
  • Occurs
  • Dispatch
  • Release
  • Time-out
  • Event
  • Wait

Single Blocked Queue

  • Admit
  • Ready Queue
  • Dispatch
  • Time-out
  • Event Wait
  • Release
  • Processor
  • Blocked Queue
  • Event
  • Occurs

Multiple Blocked Queues

  • Admit
  • Ready Queue
  • Dispatch
  • Time-out
  • Release
  • Processor
  • Event 1 Wait
  • Event 1 Queue
  • Event 1
  • Occurs
  • Event 2 Wait
  • Event 2 Queue
  • Event 2
  • Occurs

Suspended Processes

  • Processor is faster than I/O so all processes could be waiting for I/O
  • Swap these processes to disk to free up more memory
  • Blocked state becomes suspend state when swapped to disk
  • Two new states
    • Blocked, suspend
    • Ready, suspend

Process State Transition Diagram with Two Suspend States

  • Ready
  • Admit
  • Admit
  • Suspend
  • Dispatch
  • Time out
  • Ready,
  • suspend
  • Ready
  • Blocked
  • Blocked,
  • suspend
  • Event
  • Occurs
  • Activate
  • Event
  • Occurs
  • Activate
  • Suspend
  • Running
  • Exit
  • Event
  • Wait

Processor State Information

  • Contents of processor registers
    • User-visible registers
    • Control and status registers
    • Stack pointers
  • Program status word (PSW)

Process Control Information

  • Additional information needed by the operating system to control and coordinate the various active processes
    • scheduling and state information
    • data structuring
    • interprocess communication
    • process privileges
    • memory management
    • resource ownership and utilization

Process Creation

  • Assign a unique process identifier
  • Allocate space for the process
  • Initialize process control block
  • Set up appropriate linkages
    • Ex: add new process to linked list used for scheduling queue
  • Other
    • maintain an accounting file

Download 1.51 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling