1 / 146

Fundamentals of Information Technology UNIT - III

Fundamentals of Information Technology UNIT - III. Learning Objectives. In this Unit we will discuss : Introduction to Operating system Different types of operating systems and its working File Structure and Storage Introduction to process management: Threads

stiles
Download Presentation

Fundamentals of Information Technology UNIT - III

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. Fundamentals of Information TechnologyUNIT - III

  2. Learning Objectives In this Unit we will discuss : Introduction to Operating system • Different types of operating systems and its working • File Structure and Storage • Introduction to process management: • Threads • Scheduling and Synchronization • Introduction to Database Management System and its types

  3. Operating System • It keeps track of the status of each resource and decides who will have a control over computer resources. • It acts as an interface between users and the hardware of a computer system. • The most fundamental system program is the operating system - it controls all the computer's resources and provides the base upon which the application programs can be written. • It is a program that acts as an intermediary between a user of a computer and the computer hardware; it controls and coordinates the use of this hardware among its users.

  4. Operating System • A mechanism for scheduling jobs or processes. Scheduling can be as simple as running the next process, or it can use relatively complex rules to pick a running process. • A method for simultaneous CPU execution and IO handling. Processing is going on even as IO is occurring in preparation for future CPU work. • Examples of OS: Windows, Linux, Unix, MacOs etc

  5. Operating System • The CPU is wasted if a job waits for I/O. This leads to: • Multiprogramming ( dynamic switching ). While one job waits for a resource, the CPU can find another job to run. It means that several jobs are ready to run and only need the CPU in order to continue. • All of this leads to: • memory management • resource scheduling • deadlock protection

  6. Operating System Application Programs System Programs Software (Operating System) HARDWARE

  7. Operating System • The structure of OS consists of 4 layers: • Hardware • Hardware consists of CPU, Main memory, I/O Devices, etc, • Software (Operating System) • Software includes process management routines, memory management routines, I/O control routines, file management routines.

  8. Operating System • System programs • This layer consists of compilers, Assemblers, linker etc. • Application programs • This is dependent on users need. Ex. Railway reservation system, Bank database management etc.,

  9. Batch Processing • In Batch processing same type of jobs (BATCH- a set of jobs with similar needs) together execute at a time. • The OS was simple, its major task was to transfer control from one job to the next. • The job was submitted to the computer operator in form of a batch. At some later time the batch of programs is executed and the output is produced. • The OS was always resident in memory. (Ref. Fig. next slide) • Common Input devices were card readers and tape drives.

  10. Batch Processing • Common output devices were line printers, tape drives, and card punches. • Users did not interact directly with the computer systems, but he prepared a job (comprising of the program, the data, & some control information). OS User program area

  11. Multiprogramming • Multiprogramming is a technique to execute number of programs simultaneously by a single processor. • In Multiprogramming, number of processes reside in main memory at a time. • The OS picks and begins to executes one of the jobs in the main memory. • If any I/O wait happened in a process, then CPU switches from that job to another job. • Hence CPU in not idle at any time.

  12. Multiprogramming • Figure depicts the layout of multiprogramming system. • The main memory consists of 5 jobs at a time, the CPU executes one by one. • Advantages: • Efficient memory utilization • Throughput increases • CPU is never idle, so performance increases.

  13. Operating System • The main functions of operating systems are: • Process management • Memory management • Input/Output management • Error detection • Resource allocation • File management • Protection

  14. Operating System • Operating System can also be classified as,- • Single User Systems • Multi User Systems

  15. Single User • 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

  16. Multi User • 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 are multi-user systems. • Example: Unix

  17. Multi tasking OS • The ability to hold several programs in RAM at one time but the user switches between them. • The CPU is multiplexed among several jobs that are kept in memory and on disk (the CPU is allocated to a job only if the job is in memory). • A job is swapped in and out of memory to the disk. • On-line communication between the user and the system is provided; when the operating system finishes the execution of one command, it seeks the next “control statement” from the user’s keyboard.

  18. Multitasking OS § Simultaneous interactive use of a computer system by many users in such a way that each one feels that he/she is the sole user of the system § User terminals connected to the same computer simultaneously § Uses multiprogramming with a special CPU scheduling algorithm § Short period during which a user process gets to use CPU is known as time slice, time slot, or quantum § CPU is taken away from a running process when the allotted time slice expires

  19. Multiprocessor OS • Multiprocessor systems - with more than on CPU in close communication. • Tightly coupled system – processors share memory and a clock; communication usually takes place through the shared memory. • Advantages of parallel system: • Increased throughput • Economical • Increased reliability • Graceful degradation • Fault tolerant systems

  20. Multiprocessor OS Symmetric multiprocessing (SMP) • Each processor runs an identical copy of the operating system. • Many processes can run at once without performance deterioration. • Most modern operating systems support SMP Asymmetric multiprocessing • Each processor is assigned a specific task by master • Master schedules and allocated work to slave processors. • More common in extremely large systems

  21. Multiprocessing

  22. Real Time OS Often used as a control device in a dedicated application such as controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems. • Well-defined fixed-time constraints. • Real-Time systems may be either hard or soft real-time.

  23. OS Types • Hard real-time: • Secondary storage limited or absent, data stored in short term memory, or read-only memory (ROM) • Conflicts with time-sharing systems, not supported by general-purpose operating systems. • Soft real-time • utility in industrial control of robotics • Useful in applications (multimedia, virtual reality) requiring advanced operating-system features.

  24. Distributed OS Distributed system - Processing is carried out independently in more than one location, but with shared and controlled access to some common facilities. Requires network infrastructure. Distribute the computation among several physical processors. • Loosely coupled system – each processor has its own local memory; processors communicate with one another through various communications lines, such as high-speed buses or telephone lines. • Advantages of distributed systems. Resources Sharing Computation speed up – load sharing Reliability Communications

  25. Operating System • Characteristics of an Operating System • Multi-User: Allows two or more users to run programs at the same time. Some operating systems permit hundreds or even thousands of concurrent users. • Multi Processing: Supports running a program on more than one CPU. • Multi Tasking: Allows more than one program to run concurrently. • Multithreading: Allows different parts of a single program to run concurrently. • Real time: Responds to input instantly. General-purpose operating systems, such as DOS and UNIX, are not real-time.

  26. DOS Commands • The command prompts: • cd < directory name> • cd is the basic DOS command, it allows you to change directory. • dir [ name of directory] • dir allows you to list all contents of the specified directory. • copy <source> <destination> • Allows you to copy a file from a <source>folder to a <destination folder>. • del<file> • delete specific file.

  27. DOS Commands • move <source> <destination> • Allows you to move a file from a <source>folder to a <destination folder>. • ren <source> <destination> • Rename the specified file. • edit <filename> • Opens the default DOS editor to allow modification of specified file. • cls • Clear DOS screen. • exit • Leave the DOS terminal.

  28. Process • A Process – a program in execution; process execution must progress in sequential fashion. • A process includes: program counter, stack, data section. • Process Management concerns with the control of programs within the system. • The term process refers to a program that is loaded into computer memory and is being executed i.e. is utilizing CPU time. • Operating system can allocate system resources, so the process will execute in either user mode or system mode (system mode has direct access to resources).

  29. Process • A program is passive unit; a processis active unit of work. • Attributes held by a process includes: • hardware state, • memory, • CPU, • progress (executing) • WHY HAVE PROCESSES? • Resource sharing ( logical (files) and physical(hardware) ). • Computation speedup - taking advantage of multiprogramming – i.e. example of a customer/server database system. • Modularity.

  30. Process • New The process has just arrived. • Running Instructions being executed. This running process holds the CPU. • Waiting For an event (hardware, human, or another process.) • Ready The process has all needed resources - waiting for CPU only. • Suspended Another process has explicitly told this process to sleep. It will be awakened when a process explicitly awakens it. • Terminated The process is being torn apart.

  31. Process

  32. Process • PROCESS CONTROL BLOCK: • CONTAINS INFORMATION ASSOCIATED WITH EACH PROCESS: • It's a data structure holding: • PC, CPU registers, • memory management information, • accounting ( time used, ID, ... ) • I/O status ( such as file resources ), • scheduling data ( relative priority, etc. ) • Process State (so running, suspended, etc. is simply a field in the PCB ).

  33. Process

  34. Process • Process Scheduling • CPU scheduling is the basis of multiprogramming operating systems. • By switching the CPU among processes, the operating system can make the computer more productive. • If there are several runnablejobs, the operating system has to decide which job to run next, a process known as Process Scheduling.

  35. Process • The computer operator simply submitted the jobs in the order that they were delivered to him or her, and each job ran to completion. We can call this algorithm First come first served, or FIFO (first in first out). • However, even this primitive system had problems. Suppose there are five jobs waiting to be run. Four of the five jobs will take about ten seconds each to run, and one will take ten minutes, but the ten-minute job was submitted first. • In a FIFO system, the fast jobs will all be held up for a long time by a large job that happened to be delivered first.

  36. Process • This permitted the operator to run jobs using a shortest job first(SJF) algorithm. • As the name implies, instead of running jobs in the order that they are delivered, the operator would search through all available jobs and run that job which had the shortest run time. • This is probably the fastest job-scheduling algorithm. • If there are more processes, the rest will have to wait until the CPU is free and can be rescheduled.

  37. Process • The act of Scheduling a process means changing the active PCB pointed by the CPU. Also called a context switch. • A context switch is essentially the same as a process switch - it means that the memory, as seen by one process is changed to the memory seen by another process. • SCHEDULING QUEUES: • (Process is driven by events that are triggered by needs and availability ) • Ready queue = contains those processes that are ready to run. • I/O queue (waiting state ) = holds those processes waiting for I/O service.

  38. Process • LONG TERM SCHEDULER • Run seldom ( when job comes into memory ) • Controls degree of multiprogramming • Tries to balance arrival and departure rate through an appropriate job mix. • There are always more processes than CPU that can be executed by operating system. These processes are kept in large storage devices like disk later processing. The long-term scheduler select processes from this pool and loads them into memory. In memory these processes belong to a ready Queue. Queue is a type of data structure.

  39. Process • SHORT TERM SCHEDULER • Code to take a process off the ready queue and run that process (also called dispatcher). • a) Always takes the first process on the queue (no intelligence required) • Places the process on the processor. .

  40. Process • It allocates processes that belong to ready queue to CPU for immediate processing. • Its main objective is to maximize CPU utilization. Compared to the other two schedulers, it is more frequent. • It must select a new process for execution quite often because a CPU execute a process only for millisecond before it goes for I/O operation. .

  41. Process • MEDIUM TERM SCHEDULER • Mixture of CPU and memory resource management. • Swap out/in jobs to improve mix and to get memory. • Controls change of priority.

  42. Process Most of the processes require some I/O operation. In that case, it may become suspended for I/O operation after running a while. It is beneficial to remove these process (suspended) from main memory to hard disk to make room for other processes. At some later time these process can be reloaded into memory and continued from where it was left earlier. Saving the suspended processes is said to be swapped out or rolled out. The process is swapped in and swapped out by medium term scheduler. .

  43. Process The medium term scheduler has nothing to do with suspended processes. But the moment the suspending condition is fulfilled the medium term scheduler get activated to allocate the memory and swap in the process and make it ready for commenting CPU resources. In order to work properly, the medium term scheduler must be provided with information about the memory requirement of swapped out processes, which is usually recorded at time of swapping and stored in related process control block. .

  44. Process

  45. Process Scheduling First come first served scheduling The process that requests the CPU first is allocated the CPU first. The average waiting time for FCFS policy is often quite long. Example: Consider the following set of processes that arrive at time 0. Process CPU Burst Time (ms) P1 24 P2 3 P3 3 Suppose that processes arrive in the order: P1, P2, P3, we get the result Waiting time for P1 = 0; P2 = 24; P3 = 27 Ave. waiting time: (0 + 24 + 27) /3 = 17 ms.

  46. Process Scheduling First come first served scheduling If the processes arrive in the order: P2, P3, P1 Waiting time for P1 = 6; P2 = 0; P3 = 3 Ave. waiting time : (6 + 0 + 3)/3 = 3

  47. SJF Scheduling • Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time.

  48. JOB CPU bound: Processes that perform computations with little I/O operations. Scientific and engineering computations usually fall in this category. I/O bound: Processes that perform I/O operations with little computation. Commercial data processing applications usually fall in this category.

  49. Process creation • PARENT & CHILD PROCESSES • Parent can run concurrently with child, or wait for completion. • Child may share all (fork/join) or part of parent's variables. • Death of parent may force death of child. • Resource sharing between Parent and Child processes can be any one of the following type: • 1. Parent and children share all resources. • 2. Children share subset of parent’s resources. • 3. Parent and child share no resources. • Execution may be one of the following two types: • 1. Parent and children execute concurrently. • 2. Parent waits until children terminate.

  50. Process termination When processes terminate following two things can happen: • Output data from child to parent (via wait). • Process’ resources are de-allocated by operating system. Parent may terminate execution of children processes (abort) when : • Child has exceeded allocated resources. • Task assigned to child is no longer required. • Parent is exiting. • Operating system does not allow child to continue if its parent terminates. • Cascading termination.

More Related