0% found this document useful (0 votes)
18 views100 pages

OS

The document is a guide for engineering students focusing on Operating Systems, covering various topics such as fundamental concepts, process management, memory management, I/O and file management, and Linux. It includes a detailed syllabus with chapters outlining essential functions and characteristics of operating systems, types of scheduling, synchronization, and resource management. The guide is published by Technical Publications and is intended for S.E. (Artificial Intelligence & Data Science) Semester - III students.

Uploaded by

Mandar Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
18 views100 pages

OS

The document is a guide for engineering students focusing on Operating Systems, covering various topics such as fundamental concepts, process management, memory management, I/O and file management, and Linux. It includes a detailed syllabus with chapters outlining essential functions and characteristics of operating systems, types of scheduling, synchronization, and resource management. The guide is published by Technical Publications and is intended for S.E. (Artificial Intelligence & Data Science) Semester - III students.

Uploaded by

Mandar Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 100
‘A Gulde For Engineering Students OPERATING SYSTEMS SUBJECT CODE: 217521 S.E. (Artificial Intelligence & Data Science) Semester - Ill © Copyright with Technical Publications All publishing rights (printed and ebook version) reserved with Technical Publications No port of this book should be reproduced in any form, Electronic, Mechanical, Photocopy or any information storage and retrieval system without prior permission in writing, from Technical Publicotions, Pune. Published by : Amit Residency, Office No.1, 412, Shoniwor Peth, Pune - 411030, M.S. INDIA Ph.: +91-020-24495496/97 Email: [email protected] Website: swwwtechnicalpublications.in Printer : Yosiej Printers & Binders, Sr.No. 10/1A,Ghule Industial Estate, Nanded Village Road, Tal. - Havel, Dist. - Pune - 411041. ISBN 978-93-5585-227-4 wu 9789355859974 [1] w © scanned with OKEN Scanner SYLLABUS Operating Systems - (217521) Credit Examination Scheme : 03 Mid_Semester (TH) : 30 Marks End_Semester (TH) : 70 Marks UnitI Fundamental Concepts of Operating system Operating system functions and characteristics, historical evolution of operating systems, issues in operating system design, User's view of the OS, Types of OS : Batch, time sharing, multiprogramming, distributed, network and real-time systems, Operating-System Services, Types of System Calls, System Programs. BASH Shell scripting : Basic shell commands, shell as a scripting language. (Chapter - 1) Unit II Process Management Process concept, Process Control Block(PCB), Process Operations, Process Scheduling : Types of process schedulers, Types of scheduling : Preemptive, Non preemptive. Scheduling’ algorithms : FCFS, SIF, RR, Priority, Inter process Communication(IPC). Threads : multithreaded model, implicit threads, threading issues. (Chapter - 2) Unit HI Process Coordination . Synchronization : Principles of Concurrency, Requirements for Mutual Exclusion, Mutual Exclusion ; Hardware Support, Operating System Support (Semaphores and Mutex), Programming Language Support (Monitors). Classical synchronization problems : Readers/Writers Problem, Producer and Consumer problem, Inter-process communication (Pipes, shared memory : system V) Deadlock : Deadlock Characterization, Methods for Handling Deadlocks, Deadlock Prevention, Deadlock Avoidance, Deadlock Detection, Recovery from Deadlock. (Chapter - 3) (ii) © scanned with OKEN Scanner Unit IV Memory Management’ Memory Management : Memory Management Requirements, Memory Partitioning : Fixed Partitionmg, Dynamic Partitioning, Buddy System, Relocation, - Paging, ‘Segmentation. Virtual Memory : Hardware and Control Structures, Operating System Software. (Chapter - 4) Unit V_V/O and File Managemient VO Management : VO Devices, Organization of /O function, VO Buffering, Disk SchedulingDisk Scheduling policies like FIFO, LIFO, STTF, SCAN, C-SCAN. File Management : Concept, Access methods, Directory Structure, Protection, File System implementation. . Directory Implementation, Allocation methods, Free Space management. (Chapter - 5) Unit VI Linux History Of Unix and Linux , Overview Of Linux - Linux Goals, Interfaces to Linux, The Shell, Linux Utility Programs, Kemel structure, Processes in Linux - Process ‘management system calls in Linux, Implementation of process and threads in Linux, Process scheduling Linux, Booting. (Chapter - 6) (vy © scanned with OKEN Scanner TABLE OF CONTENTS Chapter - 1 Fundamental Concepts of Operating System (1-1) to (1 - 24) 1.1 Operating System Functions and Characteristics . 1.2. Historical Evolution of Operating Systems. 1.3. Types of OS... 1.4 Operating-System Services 1.5 Types of System Calls. 1.6. System Programs..... 1.7 BASH Shell Scripting. Chapter -2 Process Management @- 1) to @- 32) 2.1. Process Concep' 2.2 Process Operations. 2.3. Process Scheduling. 2.4 Types of Scheduling 2.5 Scheduling Algorithms... 2.6 IPC... 2.7. Threads... wv) © scanned with OKEN Scanner 2.8 Multithreading Model Unit il Chapter-3 Process Coordination (3-1) to (3-3. 2.9 Threading Issue... 3.1. Synchronization ; Principles of Concurrericy .. 3.2. Mutual Exclusion : Hardware Support. 3.3. Operating System Support : Semaphores and Mutex... 3.4 Programming Language Support : Monitors... 3.5. Classical Synchronization Problems.. 3.6 Inter-Process Communication 3.7 Deadlock... 3.8 Deadlock Prevention. 3.9 Deadlock Avoidance... 3.10 Deadlock Detection and Recovery from Deadlock Chapter -4 Memory Management (4-1) to (4-31) 4.1 Memory Management Requirements... 4.2. Memory Partitionin, and Dynamic Partitioning... : Fixed Partitioning 4S io Buddy System .. 4.4 Paging. (vi) © scanned with OKEN Scanner 4.5. Segmentation. 4.6 Virtual Memory : Hardware and Control Structures . 4,7. Operating System Softwar Chapter-5 I/O and File Management (5 - 1) to (5 - 39) 5.1 1/0 Devices, Organization of I/O Function... 5-1 5.2 1/0 Buffering... 5.3 Disk Scheduling.. 5.4. File Management Concept. 5.5 Access Methods... 5.6 Directory Structure... 5.7. Protection... 5.8 File System Implementation .. 5.9 Directory Implementation .. 5.10 Allocation Methods... 5.11 Free Space Management Chapter-6 Linux (6-1) to (6-18) 6.1. History of Unix and Linux. 6-2 6.2 Shell... 6-3 6.3. Linux Utility Programs and Kernel Structure, 6-4 a See © scanned with OKEN Scanner 6.4. Processes in Linux. 6.5 Booting Solved Model Quest aPopers SSM F Oe “4 © scanned with OKEN Scanner Fundamental Concepts of Operating System Operating System Functions and Characte: Q.1 What is operating system ? State and explain the basic functions of operating system. Ans.: © OS definition : Operating System is a program that controls the execution of application programs. It is an interface between applications and hardware. © OS provides different types of view. For user, it is abstract view because it provides features which are important for users. OS is intermediary between user and the computer system. The major design goals/ functions of an operating system are : 1. Efficient use of a computer system 2. User convenience 3. Ability to evolve © An operating system is software that manages the computer hardware. The hardware must provide appropriate mechanisms to ensure the correct operation of the computer system and to prevent user programs from interfering with the proper operation of the system. Efficient use © For efficient use of resources, it must be monitored by operating system. Proper scheduling of resources is also required. |e Computer contains different type's resources like CPU, memory and /O. device etc. Proper monitoring is required on these resources to avoid the overhead. As per the resource, scheduling is required. © scanned with OKEN Scanner aden COMPAS Operating soy | PU and memory. If memory , wen for Cl is tention #0 ss han reew program into the Memory, They on oe Scam sat be by ence User convenient jc afected by computing environment of the re wi 4 manure of computations ner other systems ane ~a ts interfaces with by is we recur and we change the computing environment of page factors ae considered while considering yt stem. 1 Good service 2. Base of use 3. New programming moj 4. Eyoluion 5. User friendly OS. Aallity to evolve ed in such a way as to permit the effec 4 An OS should be constructed in su : ite development, testing and introduction of new system functions without au the same time interfering with service, a2 Describe in detail the functions of OS as a resource manager, ‘ans: © A computer is a set of resources, These resource provides ‘aris fintions tothe use. Functions like data movement, storing of ‘ogra, operation on data are control by an operating system, + Fig. Q21 shows OS as a resource manager. «The opering system is responsible for managing the all resources, A portion of the OS is in main memory. This portion of the OS is called er + User program and data is also stored in remaining parts of the memory, ‘Allocation of matin memory is controlled by operating system withthe ‘ip of memory management hardware. q * VO device is contolled by OS and it decides when an UO device can be wed by progam in execution, Processor is one type of resource and OS conto the execution of user program on the processor. 4 Operating Systems 1-3 _ Fundamental Conceyts of Operating System UO contoler 5 Processor #2” |... #4 Computor system protecting the memory, UO d Resource management in Time and space are the tw. the benefits of resource abstraction ? + Resource abstraction is the process of "hiding the details of how erates, thereby making computer hardware relatively easy ion programmer to use". It provide a single abstract disk interface which will be the same for both the hard disk and floppy disk. * Saves the programmer from needing to leam the dewils of both hardware interfaces a a oy A Gude for Engineering Students illite, © scanned with OKEN Scanner pod Fondamentat Concert of OMTENG Spttig Indware ier 10 = While making va eet over the Iardware by Riding some Hii functionality behind the wbstractcn specie tevel 1 Since most appheation programmers 0 cnr, the abstraction very wefel * Evolution of Operating Syst 32 : Historical Evolution of Operatl ig Systems _ 24 Dincuss evolotion of operating systems Ama : Opeming systems hive been evolving through the Following table shows the history of OS. years, Gonnraton Electronic devices Types of OS and Fes second ‘Thine —__1968-1980 Foush Sine 1980 1.3: Types of OS 5 Describe in brief the evolution of operating system, ‘Ans. + The evolution of operating systems is directly dependent 10 the evelopment of computer systems and how users use them. OS created to process jobs in batches. Later Multitasking and Time-Sharing created to run auhiple jobs and allow user interaction to improve efficiency. Mulitsking trought challenges t0 manage VO operations required by tukipe jobs in which computer vendors resolved with interups 4. Batch systom : ‘Batch system process a collection of jobs, called a batch. Batch is a sequence of usr jobs we, resource ahitraction sigs | rot need such & high level of | Frovided by the operating SYHtem is generally 128 Rantenatet Comey of Oporeting SI petting Seite 1 fob is 4 predefined vequenee of commande, programe and date that ate gembined into single anit ote joe om the Beach A ater ue Batch is independent of sion by conseracting # Sle ith 8 « Bach job define a job control speci sequence of commands spend op preening 4 Jobs with similar needs were batched together Card readers and tape deives are the input device = Dutch Output devices are tape drives, card punches an «primary function of the batch system is to 3 cone after another without requiring the operators intr fo need for human/user interaction with the job when i runs the information required to complete job is kept st « Some computer systems only did one thing at a time. instructions to camry out and these would be ccsried out one afta che ‘other, This is called a serlal system. The mechanics of development ‘and preparation of programs in such environments ate quite slow ot ‘numerous manual operations involved in the process ie the je fe Batch monitor is used to implement batch processing spstem, Sask monitor is also called kermel, Kernel resides in one pat of Se computer main memory. 2. Multiprogramming OS : + CPU remains idle in batch system. At any time either CPU or LO device was idle in batch system. To keep CPU busy. programfjob must be loaded for exceution, It increases she CPU izations. So multiprogramming increases the CPU wnltzation. Resource management is the main sim of multiprogramming operating system, File system, command provessor, LO contol system and transient area are the esscrcal components of a single wser operating system. ‘© Multprogramming operating system divides the transient area to store the multiple programs and provides resource management to the operating system. Sees ‘A Gulde for Englceing Stents Guide for Engincrng Students ot sail @ scanned with OKEN Scanner Program? e Pesan Fig. 2.5.1 Multiprograr "8 OS memory layout Hard dee (Secondary storage devia Fig. 5.2 Working of muitiprogramming OS ‘In multiprogramning operating system, programs are competing fr resources. A function ofthe multiprogramming operating system is CPU scheduling, memory management and UO management ‘A Gude for Enginering Ses cone of OPE ay, et Concepts of Operating System: ‘operating Sus are four programs for execution. All four programs are the memory. CPU select first program for execution. «contain instruction for CPU and UO operation. ‘Also explain advantages and «suppose there Joaded into t ‘Normally program qe Explain time sharing system. disadvantages: sees + « in an nteracive system, many users diel itera with te ‘ter from terminals connected t0 the computer rvecesea?’s time which is shred among multiple users simusaneonsly is termed as time-sharing. «eTime sharing is logical extension of multprogramming OS. Fie Q61 shows time sharing system. Termine! F Terinal Terminal Fig. Q.6.1 Time sharing ‘s Time sharing is a method that allows multiple users to share resources ‘at the same time. Multiple users in various locations can use a specific computer system at a time ‘e Time sharing is essentially @ rapid time division multiplexing of the processor time among several processes. The processor switching is so frequent that it almost seems each process. has its own dedicated processor. ‘= Time sharing OS is designed to provide a quick response to ssub-requests made by users. 4© The processor time is shared between multiple users at time, The processor allows each user program to execute for a small time quantum. Moreover, time sharing systems use multiprogramming and multitasking. “A Gue for Engineering Students lili @ scanned with OKEN Scanner 6__Fandamentel Coney 0f Opting prtig Sets sides immediate feedback The opting ten ov © te ae ree as bei seconds, EPA 0D the mune, ot 3 se The scheduling tecnigue wed by 0 time-sharing Kemel is cag robin scheduling with time slicing. isthe time slice eapses before the process completes sericn subreques, the kernel pre-empts the PFOCESS, MOVES it tothe eng”, “ scheduling queue and schedules another process, of The main ciflrence between Mul-programmed Batch Syston, Time-Sharing Systems is that in case of Multi-programm tyme. te dete ist maximize processor use, wheres ig Sharing Systems, the objective is 1o minimize response time «Features of time sharing system 1. User interaction with program is possible, 2. Tine sang system uses medium tem scheduling suchas rad robin fo the foreground 3. Each acer is given time slice for executing job in round rae fashion + Advantages of time sharing operating systems : 1. Provides the advantage of quick response. 2. Avoids duplication of software. 3. Reduces CPU idle time + Disadvantsges of time sharing operating systems : 1, Problem of relisblty, 2. Question of security and integrity of user programs and data. 3. Problem of data communication 7 What do you mean spooling ? Explain in detail Aas.» When & job completes execution, its i : execution, its memory is released and te pee {or the job gets copied into an outputs pool for later printing. * Spooling en acronym for simultaneo ls = 8 peripheral operation on lie pooling uses the disk as lage butler for outputing data to pris = = A Guide for Enpncering Sens operating Systems 1-9 __ Fundamental Concept of Operating Sy wed and other devices. It can also be used for input, but is for output lis main use is to prevent two users ftom alternating printing lines to the line printer on the same page, getting their output completely mixed together. It also helps in reducing idle time and overlapped LO and PU et refers to putting jobs in a buffer, a special area in memory or on a disk where a device can access them when itis ready « Spooling is useful because device access data at different rates. The buffer provides a waiting station where data can rest while the slower device catches up. ‘© Computer can perform VO in parallel with computation, it becomes possible to have the computer read a deck of cards to a tape, drum or disk and to write out to a tape printer while it was computing. This process is called spooling. “©The most common spoolit application is print spooling. Spooling batch system were the first and are the simplest of the muliprogramming systems. ‘In spooling, VO of one job is overlapped with the computation of Fone job another job. For example, a spooler at a time may tead input and at the same time, it may also print the ousput of another job. + Spooling can also process data at the remote sites. The spooler only has to notify when a process gets completed at the remote site so that spooler can spool next process to the remote side device * Spooling increases the performance of the system by increasing the working rate of the devices. It naturally leads 10 multiprogramming. Advantages of spooling ‘* The spooling operation uses a disk as a very large buffer » Spooling is however capable of overlapping UO operation for one job with processor operations for another job. “A Guide for Engincering Sudewts lit @ scanned with OKEN Scanner unanentsl Cont of Operating ng Operating Systems 1-70 ‘aa Give the featres of real ime operating system and time ghyy, operating system. 7 ‘Ans, : Features of Real Time Operating System = 4. Realtime system fails if it does not give result within the time ting 2 Real nets cannot Keep wang for Inger time without alloggi keel +3, Real time operating system uses priority scheduling algorithm, 1. User interaction with program is possible in time sharing oper system. q 2, Time sharing system uses medium term scheduling such a rouyg robin for the foreground. given time slice for executing 29 Explain distributed OS with neat sketch and give its pros ang cons. ‘Ans. Distributed operating systems depend on networking for th peration. Distributed OS runs on and controls the resources of mule ‘machines. It provides resource sharing across the boundaries of a single igle machine OS. Distributing k like a virtual uniprocessor ; to its users like an ordinary operating system but runs on multiple, independent cpu. + Fig. Q9.1 shows the distributed system, ; scatewsy Flg, 0.9.4 Distributed system Ss SS A Guide for Engineering Sudens dvantages of dstribued 08: 1. Resource sharing : Sharing of Ibvaries, database and hardware resources such as hard disks, printers and CDROM can also be done in a very effective way among all the computers and the users f software resources such as software fers to the degree of tolerance against "Availability is one of the important refers to the fraction of time for done hard disk fails or is unavailable, the program can use some other hard disk. 3, Better price performance ricroprocessor and in price-performance ratio. 4, Shorter responses times and higher throughput. ‘5 Incremental growth : To extend power and functionality of « system ‘by simply adding additional resources fo the system, «+ Examples of distributed operating system are amoeba, chrous, mach and v-syster. Difficulties in distributed OS are 1, There ate no current commercially successful examples. sad can dominate computation costs. io: Reduction in the price of computing power gives good logical extension of the multiprogramming operating . systems. interaction with ‘program is possible in time sharing operating system. During execution of the program, user interacts directly with the program, with more than one progam aa time For example, wer could be working with information from one database on the screen analyzing data, while the computer is sorting information from another database, while a excel sheet is performing calculations on a separate worksheet. ei eer a “Tou Egeng Sens © scanned with OKEN Scanner Fundementel Concepts of Operating 8 Set, sem simultaneously in wer share the computer SYS SI ly in time gp ‘Tame sharing system uses multipogramming oe es sept FOEIN h meme TE operating system. scheduling, Bach wer has at I se sharing systems, e2ch ohn cer is given a sime slice f0r fea tenh executing hisTer job in round — robin fashion. Job continues until the time slice ends. «Fig. Q.10.1 shows multitasking 08 ‘= Concept of viral machine is sed in time sharing system. It creates virtual machine one Pet thet, User interaction with system by using virtual machine, ves the command fr viral machine and result will received back Fig. 2.10.4 Multitasking og wer. «Time sharing system is more complex than multiprogranming operating system, It also takes help of filesystem. File system is stored on te disk so disk management is also requited «+ Major problem sith time sharing system is protection and security of at ‘Time shating system uses medium term scheduling such as round rota for the foreground, Background process users can use a differen, scheduling method, ‘Difference between multprogramming and multitasking operating system is context switching. In multiprogramming system a contet switching oseurs only when the currently executing process stalls for some reasons. Time sharing system gives each user the impression tat te ete sem i dts o ht we, Context switching singly flows seve aplions to be open, but only one is working a 8 ee “A Gull or Engincerig Sade | opting Stems ;_ onty one application prageam Truly speaking. even in true mi runaing at anyone inst switches ffom one program to the next programs seer fo run simultaneously att What is realtime OS 7 Explain its types with salable ecuple ‘s Time constraints is the key parameter is real time systems Jy as robots, satellites. ait tant. Because the ail he progam © a Ans. controls ationomous system suc and hydroelectric dams. 4s When user gives an input t0 the syste Timit and resut is sent back, Real time system result within the time mits, fem is any information processing system which has © vat stimuli within a finite and it must process sith fails if it does not give A realtime syst respond to externally generated inp specified period «Realtime systems are of two types : Hard and soft 1, Hard Real Time Systems A hard realtime system is one where the response specified as an absolute" value. This time is normally dictated the environment, A system is called a hard reabtime if tasks always must execution before their deadlines ct if message always delivered within a specified time interval. «+ Hard real-time is oflen associated with safety critical applications ‘A failure (eg. missing a deadline) in a safety-critical application can lead to loss of human life or severe economical damage, nish be 2, Soft Real Time Systema «© A soft real-time system is one where the response time is normally specified as an average value, This time is normally dictated by business or market, ‘© A. single computation arriving late is ot significant 1 operation of the system, though many late amvals might be « Soft realtime means that only the precedence and sequcoce for the task-operations ate defined, interrupt Iniensies and context latencies are small but there can be few deviations gt Oui or ngnerng Sens illic. @ scanned with OKEN Scanner Fundamental Concepts of Operating System Operating Systems 1-18 ‘peoween expected latencies of the tasks and observed time constraints and a few deadline misses are accepted [114 : operating-System Services 0.12 State and explain different services provided by an operating system. Ans. + 1. Prograt the memory by operat its start execution, . Input ~ output operation : Program is combination of input and cuiputsotement, While executing the program, it requires UO device 3, Error detection : Error is related to the memory, CPU, W/O device ‘and in the user program, Memory is full, stack overflow, file not found, directory not exist, printer is not ready, attempt to access illegal ‘memory are the example of error detection File and directory operation : User wants to read and writes the file and directory 'S. Communication : Communication may’ be inter-process communication and any other type of communication. Data transfer is ‘one type of communication, — 1.5 : Types of System Calls 13 What is system call ? Explain working of system call, ‘Aus. « System calls provide the interface between a running program and the operating sytem. Any single CPU computer can execute only one insivction ata time. Ifa process is running a user program in user mode and needs system service, such as reading a data from a fil, it has to execute a tap instruction to transfer control to the operating system. + Operating system provides services and system call provides interface to these services. System call is written in language C and CH as routines, System calls are performed in a series of steps. sn execution : Before executing the program, it is loaded into ing system. Once program loads into memory, 1+ System calli a technique by which a program executing in user mode a request the keml's service 15 Fundamental Concepts of Operating System operating Systems 1 terface is a function definition that # An application programmer specifies how to obtain a-given service. «# Fig, Q.13.1 shows the working of system call, User im ‘system Call() ‘Applcaion programming interface |__| ‘System cal interface User modelspace Kemel medelspace Free i Main memory Fig, Q.13.1 Working of system call “A Gilde for Engineering Sedona “A Ge for Engineering Stents @ scanned with OKEN Scanner Operating Systems 1-16 Fundamental Concepts of Operating System «When application program calls the stub, tap instruction is executeg and CPU switches to superior rode. Each system call contains it identification number + 5 maintains the twble of system call number. Operating. system executes the system call using that number. “e When the function competes, it switches the processor to user mode and then retus contol to the user process. A system call san elt request to the Kemel mode via softy Then user mode process invokes a system call, the CPU interupt. W ajchos to kemel mode and starts the execution ofthe Kemel funtion, «Making a gtem cil i ike making & special kind of procedure cat, Only system call eners the Kemel and procedure call does not enter int the kere. «Kernel implements many diferent types of system calls. The user mode roves mist pass a parameter called the system call mumber to identity, fhe required system call, All system calls setur an integer value, Inthe emel, positive or O values denote a successful termination of the system call and negative values denote an errr condition. ‘014 Explain three general method for passing parameters to the os. ‘Ans: Three general methods are used to pass parameters to the operating syste a Pass parameters in registers Registers pass starting addresses of blocks of parameters Parameters canbe placed or pushed onto the stack by the program and popped off the stack by the OS. aed 45 Discuss types of system calls. System cal is divided into following types : 1, File management 2. Process management 3, Imerprocess communication 4. VO device management 5; Information processing and maintenance Aas. : A Gale for Engineering Students opening Systeme __1-17 _ Fundamental Concept of Operating System 4, File management « File management system calls are create fil, file, read fie, write file, get ad set fle attribute se() system all, File mame with ‘and deleting a file through system fons on the delete file, open file, close User can create a file using creat autributes are required for creating ‘all, After creating a file, user can performs various operat file ‘© Read, waite, reposition are the ed after finished using. Same type of operation is operation performed on the file. File is ‘performed on clos directory. # Every file has file attributes. of file, accounting: information ete. To perform any op file, set fle atsibute and get file attribute executed to check the attributes. 2, Process management ‘system calls for process management are create, terminate, load, ‘execute, abort, set and get process attributes. Other system call for process, manegement is wait for time, wait event, allocate and free memory. In some situation user want to terminate the currently running process abnormally then system call used. Other reasons for abnormal process termination are error message generated, memory dump, error trap. + Operating system provides debugging facility to determine the problem of dump, Dump is written to secondary storage disk. ‘« Debugger is @ one type of system program. It provides facility for finding and correcting bug. 3, Interprocess communication ‘Pipe, socket, message passing and shared memory are used for interprocess communication, Send message, receive message, create and delete connection, attach remote device are the system calls used in {nterprocess communication. File attsibutes includes name of file, Pe eration on the “A Gude for Engincerng Students itaiicllllliiay @ scanned with OKEN Scanner 1s Fundamental Concepts of Operating System Operating Systems ‘Shared memory : A. process uses memory for communication. ‘Ong ‘process will create a memory portion which other processes can access, ‘A shared segment can be attached multiple times by the same process, Shared memory is the fastest form of IPC bevause data does not need to be copied between processes jcation device that can be used to] © A socket is a bidirectional comenuni ‘communicate with another process on he’same machine or with a cm oe len ee eo coi se nt ding pe sme, Mee ite oa a Fepeneaiony « Sysem cals for device management are request ( ) device release () Sr oh ee en ee ai ina Van pon Des nt wo res Hs a ee rejected. Once request is granted, control is transfer to the process a cast 5 te in ti sp a A a ee eirsekat ora iat dee ota oe oe vn ape cfgaa lb we etnta nin toa eden 1.6 : System Programs 246 Write short note on system programs. ‘Ans. : # Modern operating system consists of a collection of system Programs. System program that provides an application programming environment on top of the hardware. Some of them are simply user interfaces to system cals. They can be divided ino these categories: Operating Systems 1-19 Fundamental Concepts of Operating System 1. File management 2, Status information 3, File modification 4, Programming language support 5, Program loading and execution 6, Communications File management programs are used to create, delete, copy, rename, list, dump on files and directory. Status information system programs covers the date, time, disk space, available memory and users. All this information is formatted and displayed on output device or printed. Text editors are used for file modification. In this, new file is created and content of file is modified. Programming language support includes ‘the compilers, assemblers, interpreters for common programming language like C, C++, Java, Visual Basic. ‘© For program loading and execution, it is loaded into memory then program is executed by processor. Operating system provides different types loaders and linkers to complete execution operation. ‘« Debugging facility is provided by the operating system with the help of application program. It is used for checking errors. ‘+ Communication between two devices are performed by creating temporary connection. Communication is in between process, users and other VO devices, File transfer, remote login, electronic mail, browsing web, downloading multimedia data are the example-of communication. BASH Shell Scripting 147 What is Linux BASH shell ? Ans. © The Linux Bash is alo known as ‘Boure-agtin Shell’ It i @ command language interpreter for the Linux based system. It is a replacement of Bourne sll). 4 The LimoiUinix shell allows us_to interact with the Linux system through the commands It let us invoke an executable file to create 8 running process. exons ‘A Gulde for Engineering Stadents “A Guide for Engineering Sets @ scanned with OKEN Scanner Operating Systems 1-20 __ Fundamental Conepts of Operating System 1 Linux file system. It is designed jg 4 It also allows us to interact with th : I so allows ws 0 intact wi he on tough Bash such a way that we can perform all voyage inte a ell 2S # POE ee ee and flow control, like other| ne en te, Seas oda re Be cong see dex cleo an rn ning some 8 ea i) Chmod ii) Grep Cat iy) Sort. : iy med : Access perissons associated wit a file or directory A Co lemma Poms ed i {file can be changed only by the owner of the fie. nec wih fling emis 2 ec 2) ian 1 1120 pene FE pre i, be Fe Ova i psy whom perio 9 mgd Pe ea eminn wich te ged 2 te in to eee ve 2 acre wich pina 0 cage natn you cng te FAP fra specie pe Te eae fot Sed + pone < Pts 3 se, = indicates File Owner, "4 = indicates tht the permission is to be given, '¥ = indicates the read permission and prime.e is the filename, 1) Grop : It stands for “Get Regular Expression and Print”. The grep command allows user to search one file or multiple files for lines tht contain a pattern, The syntax is ‘sep [options] pattem. [les] Operating Systems 1-21 Fundamental Concepts of Operating System ti Cat : The cat command will also display file contents to a screen file contents to a screen. Syntax : cat filename Also, use eat for quickly creating a short file, by entering the following. $ cst > floname’ ‘After pressing the retum Key, type in the text. To save and exit the file, press CTRL-D. ‘An additional feature of eat is that it allows you to concatenate two files together by entering the following $ cat fle 1 >> file 2 ‘This command appends file to end of file 2 Iw) Sort : ‘The sort utility sorts the lines in a file By default, it sorts the file in, ASCII order, with numbers preceding alphabetic characters. Syntax: sort filename © You can also use the sort command in combination with other commands using pipes. To sort the output from a who command, center $ who | sort 2.19 Explain the significance of following shell commands 4) in i) we il) umask iv) cut v) grep ‘Ans. :i) in: The in command is used to create links. Links are a kind of shorteuts to other files. The general form of command is : S In TARGET LINK_NAME, + There are two types of links, soft links and hard links. By default, hard links are created. If you want to create soft link, use -s option. In this example, both types of links are created for the file ustlisting, In ustisting har_inke S In -s ustlsting soft fink Sisd total 12 eos “A Gale for Engineering Students “A Gul forEnginerng Students @ scanned with OKEN Scanner

You might also like