1 / 38

Basic concepts of OS OS Structures

Basic concepts of OS OS Structures. G.Anuradha. Basic concepts of OS. Processes Deadlocks Memory management Input/output Files Security. Processes. Process is a program in execution Associated with each process we have Address space (executable program+data+stack)

shayla
Download Presentation

Basic concepts of OS OS Structures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Basic concepts of OSOS Structures G.Anuradha

  2. Basic concepts of OS • Processes • Deadlocks • Memory management • Input/output • Files • Security

  3. Processes • Process is a program in execution • Associated with each process we have • Address space (executable program+data+stack) • List of memory locations (with max and min memory locations) • Registers(stack pointer, program counter, hardware registers) • Eg: Time Sharing System

  4. Processes Contd. • Whenever a process is suspended temporarily the current state of the process is stored in a process table. • Interprocess communication is the Communication between different interrelated process • When communicating between processes of different computers a alarm signal is send to notify lost messages.

  5. Processes Contd. • In UNIX processes, every user who logs in has a Unique Identification (UID). • Every process started has the UID of the person who started it • A child process has the UID as that of parent • Members of the same group can have Group Identification(GID) • One UID called Superuser has all the administrative powers.

  6. Deadlocks

  7. Deadlocks Contd… • When two or more processes are interacting, they can sometimes get themselves into a stalemate situation they cannot get out of. Such a situation is called a deadlock. • Processes in a computer can experience an analogous situation in which they cannot make any progress

  8. Memory Management • Main memory holds the executing program • In simple OS only one executing program resides in the main memory • In sophisticated OS more than one executing program can reside in memory • To prevent them from interfering with each our some protection mechanism has to be provided by the OS

  9. Memory Management Contd… • Managing the address space of the processes. • The executable program address space is less than the main memory address space for the program to reside in the memory • If the program address space is more than main memory address space a concept of virtual memory is used • Virtual Memory-OS keeps part of address space in memory and part in disk and shuttles between both

  10. Input/Output • OS has to manage the input output devices like keyboards, monitors, printers…. • Every OS has I/O subsystem for managing the I/O devices • Some I/O software are device independent but some device drivers are specific to particular I/O devices

  11. Files • One major function of the OS is to hide the peculiarities of the disks and other I/O devices and present the programmer with a nice, clean abstract model of device-independent files • System calls are needed • create files • remove files • read files • write files.

  12. Files Contd… • OS has a concept of directory for grouping files together(UNIX) the path for file CS101 is /Faculty/Prof.Brown/Courses/CS101.

  13. Files Contd… • Every file within the directory hierarchy is specified by its path name from the root directory. • Each process has a current working directory • Before a file can be read or written, it must be opened, at which time the permissions are checked • If permitted the system returns a file descriptor else an error code is returned

  14. Special Files • Special files are provided in order to make I/O devices look like files. • Two kinds of special files exist • block special files :- used to model devices that consist of a collection of randomly addressable blocks (disks) • character special files:-used to model printers, modems, and other devices that accept or output a character stream.

  15. Pipes • A pipe is a sort of pseudofile that can be used to connect two processes • If processes A and B wish to talk using a pipe, they must set it up in advance. • When process A wants to send data to process B, it writes on the pipe as though it were an output file. • Process B can read the data by reading from the pipe as though it were an input file.

  16. Security • OS has to manage the system security so that files, are accessible to authorized users. • In UNIX security is provided by 9-bit binary protection code • The protection code consists of three 3-bit fields • Owner • Members of the owner’s group • Everyone • rwxr-x--x • r read • w write • x execute

  17. Shells(exclusive for UNIX) • OS carries out system calls • Although Shells are not part of OS it makes use of many OS Features • When user logs in a shell is started • Shell has terminal as standard input and standard output • It starts out by typing the prompt, a character such as a dollar sign, which tells the user that the shell is waiting to accept a command

  18. OS-Structure • Simple structure • Layered approach • Microkernels • modules

  19. Simple Structure • Do not have a well-defined structure • MS-DOS – written to provide the most functionality in the least space • Not divided into modules • Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated

  20. MS-DOS Layer Structure(Simple Structure) initially written to provide the most functionality in the least space started small and grew beyond its original scope levels not well separated: programs could access I/O devices directly excuse: the hardware of that time was limited (no dual user/kernel mode)

  21. Simple Layered Approach(UNIX) • Enormous functionality crammed into the kernel below the system call interface • No encapsulation but total visibility across system • Made of thick monolithic layers More functionality combined into one level system call interface to the kernel

  22. Fully Layered Approach • The operating system is divided into a number of layers (levels), each built on top of lower layers. • The bottom layer (layer 0), is the hardware; The highest (layer N) is the user interface. • With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers • THE system (by Dijkstra), MULTICS, GLUnix, VAX/VMS

  23. Solaris Modular Approach • Advantages :- • More flexible than a layered system • More efficient than the micro kernel approach because there is no message passing

  24. Mac OS X Structure • Uses a hybrid structure • Mach provides • Memory management • Remote Procedure Calls • Interprocess communication facilities • Thread Scheduling • BSD(Berkeley Software Distribution) provides • Command line interface • Support for networking and file systems • Implementation of POSIX API

  25. Types of OS: Operating System can also be classified as,- • Single User Systems • Multi User Systems

  26. Single User Systems: • Provides a platform for only one user at a time. • They are popularly associated with Desk Top operating system which run on standalone systems where no user accounts are required. • Example: DOS

  27. Multi-User Systems: • Provides regulated access for a number of users by maintaining a database of known users. • Refers to computer systems that support two or more simultaneous users. • Another term for multi-user is time sharing. • Ex: All mainframes and  are multi-user systems. • Example: Unix

  28. University Questions • What are system calls and its types • Difference between monolithic and micro kernel • What is kernel and how do u design it? • Short notes on monitor • What is shared memory? Difference between shared memory and message passing • What are the various system calls for process management • Services provided by OS

More Related