Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
24 views
OS Winter 2019
Uploaded by
cohoti1106
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
Download now
Download
Save OS Winter 2019 For Later
Download
Save
Save OS Winter 2019 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
24 views
OS Winter 2019
Uploaded by
cohoti1106
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
Download now
Download
Save OS Winter 2019 For Later
Carousel Previous
Carousel Next
Download
Save
Save OS Winter 2019 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 26
Search
Fullscreen
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) AsoMEC - 27001 - 2013 Certified) WINTER - 2019 EXAMINATION Subject Name: Operating System Model Answer Subject Code: 22516 Important Instructions to examiners ny The answers should be examined by key words and not as word-to-word as given in the model answer scheme. The model answer and the answer written by candidate may vary but the examiner may try to assess the understanding level of the candidate. The language errors such as grammatical, spelling etrors should not be given more Importance (Not applicable for subject English and Communication Skills, 4) While assessing figures, examiner may give credit for principal components indicated in the figure, The figures drawn by candidate and model answer may vary. The examiner may give credit for any equivalent figure drawn. 5) Credits may be given step wise for numerical problems. In some cases, the assumed constant values may vary and there may be some difference in the candidate's answers and model answer. 6) In case of some questions credit may be given by judgement on part of examiner of relevant answer based on candidate's understanding. 7) For programming language papers, credit may be given to any other program based on equivalent concept. @ | Sub Answer Marking No | Q Scheme N. i ‘Attempt any Five _of the followin; 10M ‘a | Define real fime operating system. List its any four applications of |__2M_ it, ‘Ans | Real time Operating System: 1 Mark A real time system has well defined fixed time constraints. Processing | Definition; should be done within the defined constraints -Hard and Soft real time | 1 Mark : system, for any 4 OR correct The real-time operating system used for a real-time application means _| application for those applications where data processing should be done in the fixed s and small quantum of time. Types of real time operating system 1, Hard real-time 2. Soft real-time Applications 1. Flight Control System 2. Simulations. 3. Industrial control 4. Military applications 1/26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) b_| Explain any 4 services provided by OS. 2M ‘Ans [1.User Interface: All operating systems have a user interface that | 1 marks for allows users to communicate with the system. Three types of user | explaining interfaces are available: any 4 a. Command line interface (CLI) services b. Batch interface ©. Graphical user interface (GUD) 2. Program execution: The operating system provides an environment where the user can conveniently run programs. It also performs other important tasks like allocation and deallocation of memory, CPU scheduling ete. It also provides service to end process execution either normally or abnormally by indicating error. 3. VO operations: When a program is running, it may require input/output resources such as a file or devices such as printer. So the operating system provides a service to do 1/0. 4.File system manipulation: Programs may need to read and write data from and to the files and directories. Operating system manages the secondary storage. Operating system makes it casier for user programs to accomplish their task such as opening a file, saving a file and deleting, a file from the storage disk. 5.Communication: In the system, one process may need to exchange information with another process. Communication can be implemented via shared memory or through message passing, in which packets of information are moved between processes by the operating system. 6.Error detection: Operating systems detects CPU and memory hardware such as a memory error or power failure, a connection failure ona network or lack of paper in the printer ete. 7.Resource allocation: Operating system manages resource allocation to the processes. These resources are CPU, main memory, file storage and /O devices. 8.Accounting: Operating system keeps track of usages of various computer resources allocated to users. 9.Protection & security: When several separate processes execute concurrently, one process should not interfere with the other processes or operating system itself. Protection provides controlled access to system resources. Security is provided by user authentication such as password for accessing information.MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) Draw process state diagram, 2M ‘Ans ext» terminated VO or event completion edule SPAIN Ary evant walt wating process state diagram 2 Marks:- for correct well labelled diagram (1 mark: specifying correct states in the diagram) Explain any four scheduling criteria. 2M “Ans 1. CPU utilization: In multiprogramming the main objective is to keep CPU as busy as possible. CPU utilization can range from 0 to 100 percent. 2.Throughput: It is the number of processes that are completed per unit time. It is a measure of work done in the system. When CPU is busy in executing processes, then work is being done in the system. Throughput, depends on the execution time required for any process. For long processes, throughput can be one process per unit time whereas for short processes it may be 10 processes per unit time. 3. Turnaround time: The time interval from the time of submission of a process to the time of completion of that process is called as turnaround time. It is the sum of time period spent waiting to get into the memory, waiting in the ready queue, executing with the CPU, and doing VO operations. 4.Waiting time: It is the sum of time periods spent in the ready queue by a process. When a process is selected from job pool, it is loaded into the main memory (ready queue). A process waits in ready queue till CPU is allocated to it. Once the CPU is allocated to the process, it starts its execution and if required request for resources. When the resources are not available that process goes into waiting state and when /O request completes, it goes back to ready queue. In ready queue again it waits for CPU allocation. 5.Response time: The time period from the submission of a request until the first response is produced is called as response time. It is the time when system responds to the process request not the completion of ‘Any four scheduling criteria: 1/2 mark each 3) 26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) ‘a process. In the system, a process can Produce some output fairly early and can continue computing new results while previous results are being output to the user. € | Define virtual memory 2M ‘Ans | Virtual memory is a memory management capability of an operating | 2 marks for system (OS) that uses hardware and software to allow a computer to| any compensate for physical memory shortages by temporarily transferring | relevant data from random access memory (RAM) to disk storage. definition OR Virtual memory is the separation of user logical memory from physical memory. This separation allows an extremely large virtual memory to be provided for programmers when only a smaller physical memory is available. Virtual memory makes the task of programming much easier, because the programmer no longer needs to worry about the amount of physical memory available, or about what code can be placed in overlays, but can concentrate instead on the problem to be programmed. {| Write syntax for following commands: i)Sleep ii) Kill 2M ‘Ans | i)sleep T mark Syntax: each for sleep NUMBER[SUFFIX] correct sleep OPTION syntax fi) kill Syntax: kill pid £_| Describe any four file attributes 2M ‘Ans | File attributes: ‘Any four * Name: The symbolic file name is the only information kept in | attributes: human readable form. % mark * Identifier: File system gives a unique tag or number that| each identifies file within file system and which is used to refer files internally. * Type: This information is needed for those systems that support different types. * Location: This information is a pointer to a device and to the location of the file on that device. * Size: The current size of the file (in bytes, words or blocks) and possibly the maximum allowed size are included in this attribute, * Protection: Access control information determines that who can do reading, writing, executing and so on. + Time, Date and User Identification: This information may be kept for creation, Last modification and last use. These data can be useful for protection, security and usage monitoring. 4aj26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) z ‘Attempt any Three of the following: 12M a | Enlist types of operating system. Explain mulfiprogramming OS in 4M detail. ‘Ans | Types of operating system 1 Mari 1.Batch Systems Listing; 2.Multiprogramming 1 Mark:- 3.Multitasking Diagram 4,Time-Sharing Systems 2 Marks: 5.Desktop Systems Explanatio 6.Distributed system ” 7.Clustered system 8.Real Time system: Multiprogramming: © In multiprogramming, more than one program lies in the memory. ‘+ The scheduler selects the jobs to be placed in ready queue from a number of programs. + The ready queue is placed in memory and the existence of more than one program in main memory is known as multiprogramming, * Since there is only one processor, there multiple programs cannot be executed at a time. + Instead the operating system executes part of one program, then the part of another and so on. * Example of multiprogramming: user can open word, excel, access and other applications in a system. Operating Sytem Fig- Multiprogramming with three programs b_| List components of OS. Explain process management in detail. aM ‘Ans | List of System Components: 1 Marl 1. Process management Listing; 3 Marks 2. Main memory management 3. File management 4, VO system management 5. Secondary storage management Explanation 5126MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) Process Management: The operating system manages many kinds of activities ranging from user programs to system programs like printer spooler, name servers, file server etc. Each of these activities is encapsulated in a proc + A process includes the complete execution context (code, data, PC, registers, OS resources in use etc.) * The basic unit of software that the operating system deals with in scheduling the work done by the processor is either a process or a thread, depending on the operating system. «It’s tempting to think of a process as an application, but that gives an incomplete picture of how processes relate to the operating system and hardware. + The application you see (word processor or spreadsheet or game) is, indeed, a process, but that application may cause several other processes (o begin, for tasks like communications with other devices or other computers. + There are also numerous processes that run without giving you direct evidence that they ever exist. A process, then, is software that performs some action and can be controlled by a user, by other applications or by the operating system * Its processes, rather than applications, that the operating system controls and schedules for execution by the CPU, In a single- tasking system, the schedule is straightforward. + The operating system allows the application to begin running, suspending the execution only long enough to deal with interrupts and user input. + The five major activities of an operating system in regard to process management are 1. Creation and deletion of user and system proc 2. Suspension and resumption of processes. 3. A mechanism for process synchronization. 4, A mechanism for process communication, 5,_A mechanism for deadlock handling. ¢_| With neat diagram explain inter process communication model. aM ‘Ans | Inter-process communication: Cooperating processes require an Inter- | _ Define process communication (IPC) mechanism that will allow them to| — inter exchange data and information. Process There are two models of IPC communica 1. Shared memory tion -1 mark; diagram of model - 1 marl explanation 6126MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) process A shai process & kernel In this, all processes who want to communicate with other processes can access a region of the memory residing in an address space of a process creating a shared memory segment. All the processes using the shared memory segment should attach to the address space of the shared memory. All. the processes can exchange information by reading and/or writing data in shared memory segment. The form of data and location are determined by these processes who want to communicate with each other. These processes are not under the control of the operating system. The processes are also responsible for ensuring that they are not writing to the same location simultaneously. After establishing shared memory segment, all accesses to the shared memory segment ate treated as routine memory access and without assistance of kernel, 2. Message Passing In this model, communication takes place by exchanging messages between cooperating processes. It allows processes to communicate and synchronize their action without sharing the same address space. It is particularly useful in a distributed environment when communication process may reside on a different computer connected by a network. Communication requires sending and receiving messages through the kernel =2 marksMAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsOMEC - 27001 - 2013 Certified) process A + The processes that want to communicate with each other must have a communication link between them. Between each pair of processes exactly one communication link. d_| Describe 1/0 Burst and CPU Burst cycle with neat diagram. aM ‘Ans | CPU burst cycle: It is a time period when process is busy with CPU. _ | Explanatio VO burst cycle: It is a time period when process is busy in working | n: 2 marks, with /0 resources. Diagram:2 marks * A process execution consists of a cycle of CPU execution and VO wait + A process starts its execution when CPU is assigned to it, so process execution begins with a CPU burst cycle. * This is followed by an I/O burst eycle when a process is busy doing /O operations. * A process switch frequently from CPU burst cycle to /O burst cycle and vice versa, + The complete execution of a process starts with CPU burst cycle, followed by V/O burst cycle, then followed by another CPU burst, cycle, then followed by another I/O burst cycle and so on. + The final CPU burst cycle ends with a system request to terminate execution.MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) ane x ‘Attempt any Three of the following: 12M ‘a_| Explain “PS” command with any four options. aM. ‘Ans it is used to display the characteristics of @ process. This | four ps command: command when execute without options with a user at a particular terminal Syntax: $ ps [options] Example: $ ps output: PID TTY TIME CMD 12330 pts/@ 0:00:00 bash 21621 pts/@ 00:00:00 ps Each line in the output shows PID, the terminal with which the process is associated, the cumulative processor time that has been consumed since the process has been started and the process name. Options: -£: ILis used to display full listing of attributes of a process. It includes UID (user ID),PPID(Parent ID).C(amount of CPU time consumed by the process) and STIME(chronological time that has elapsed since the it lists the processes associated process started). Example: $ ps -f UID PID PPID TINE CND root 1 0 00:00:01 /sbin/ini root 2 @ 00:00:00 [kthreadd root Ye 00:00:08 [ksofting -u: Shows the activities of any specified user at any time, Example: $ ps -u abe options-IM eachMAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) PID TTY TIME CMD 1053 ? 00:00:06 systemd 1062 ? @0:08:0¢ (sd-pam) 1074 ttyl ——-@0:00:0@ zsh -a: It shows the processes of all users. Example: $ ps -a PID TTY TIME CMD 27011 pts/@ 40: @3:88 man 27016 pts/@ 90:00:20 less 27499 pts/1 90:00:20 ps -€: It displays processes including user and system processes. example: $ ps -e CMD Ar: arte ksoftirqd/0 eee Peeters sacs b_| Explain deadlock? What are necessary conditions for deadlock? aM Ans | In multiprogramming environment, several processes may compete for a finite number of resources. A process requests resources and if the resources are not available then the process enters into the waiting state. Sometimes a waiting process is never again able to change its status because the resources requested by it are held by other waiting processes. This situation is called as deadlock. When a process request for resources held by another waiting process which in tum is waiting for resources held by another waiting process and not a single process can execute its task, then deadlock occurs in the system, Example: Consider a system with three disk drives and three processes. When each process request one disk drive, system allocates one disk drive to each process, Now there is no more drive available in the system. If all three processes request for one more disk drive, then all three processes will go into the waiting state and system will go in deadlock state, Because any one process from the three can execute only when one of them will release the disk drive allocated to it. Necessary Conditions: 1. Mutual exclusion: At least one resource must be held in a non- sharable mode; that is, only one process at a time can use the resource, 2. Hold and Wait: A process must be holding at least one resource and waiting to acquire additional resources that are currently being held by Deadlock description- 2M, necessary conditions - 1/2 M each 10] 26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) other processes. 3. No pre-emption: Resources cannot be pre-empted i.e a resource can be released only voluntarily by the process holding it. 4. Circular wait: A set {Po,P)...Pa} of waiting processes must exist such that Po is waiting for a resource held by P1,P: is waiting for a resource held by P3,...,P,.. is waiting for a resource held by P,, and P, is waiting for a resource held by Py Each process is waiting for the resources held by other waiting processes in circular form, © _| Explain partitioning and its types. 4M ‘Ans [An important operation of memory management is to bring programs | Explanation into main memory for execution by the processor. Partitioning is a | of fixed technique that divides a memory into multiple partitions. These | partitioning partitions can be of different size or same size. -2M, ‘Types of partitioning «Fixed partitioning ic. static partitioning # Variable partitioning i.e. dynamic partitioning Fixed Partitioning: Main memory is divided into multiple partitions of fixed size at the time of system generation. A process may be loaded into a partition of equal size or greater size. Partitions can be of equal size or unequal size. Equal size partitioning: Main memory is divided into equal size partitions. Any process with less or equal size can be loaded in any available partition. OR Unequal size partitioning: Main memory is divided into multiple partitions of unequal size. Each process can be loaded into the smallest partition within which the process will fit. Variable partitioning: When a process enters in main memory, it is allocated exact size that is required by that process. So in this method, partitions can vary in size depending on memory space required by a process entering in main memory. Operating system maintains a table indicating which parts of memory are available and which are occupied. When new process arrives and it needs space, system searches for Variable 11] 26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous ASOMEC - 27001 - 2013 Certified) available memory space in main memory. If it is available, then memory is allocated to the process by creating a partition in memory. For example: Consider following table with process and memory space. Process ‘Memory space PL 20M P2, 14M PS 18M ‘d_| Describe sequential and direct access method. aM. ‘Ans | Sequential access: Information from the file is processed in order Le. | description one record after another. It is commonly used access mode. For | of sequential example, editors and compilers access files in sequence. ‘access-2M, A read operation read information from the file in a sequence i.e. read | Direct next reads the next portion of the file and automatically advances a file | access-2M pointer, ‘A write operation writes information into the file in a sequence i.e. write next appends to the end of the file and advances to the end of the newly written material. Such a file can be reset to the beginning. In some operating systems, a program may be able to skip forward or backward n records for some integer n. [ ‘Lastiond er areme ‘As shown in above diagram, a file can be rewind (moved in backward direction) from the current position to start with beginning of the file or it can be read or write in forward direction. Direct access: It is also called as relative access. A file is made up of fixed length logical records that allow programs to read and write records rapidly in no particular order. Direct access method is based on disk model of a file which allows random access to any file block. For direct access a file is viewed as a numbered sequence of blocks or records. So we can directly read block 14, then block 53 and so on. This method is used for immediate access to large amount of information. Database can be accessed with direct access method. For example, when 12] 26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous ASOMEC - 27001 - 2013 Certified) ‘a query concerning a particular subject arrives, we compute which block contains the answer and then read that block directly to provide the desired information. Read n operation is used to read the nth block from the file whereas write n is used to write in that block. The block numbers provided by the user to the operating system is a relative block number. A relative block number is an index relative to the beginning of the file. The first relative block of file is 0; the next is 1 and so on. Actual absolute disk address of the block is different from the relative address. The use of relative block numbers allow the operating system to decide where the file should be placed and helps t prevent the user from accessing Portions of the file system that may not be part of his file. 4 2M a 4M ijereate a folder OSY _ ii) create a file FIRST in OSY folder ) List/display all files and directories. iv) Write command to clear the screen ‘Ans i) create a folder OSY: Each correet Smkdir OSY command- IM ii)create a file FIRST in OSY folder: Sed OSY Scat>FIRST or $ touch FIRST iii) List/display all files and directories: Sls iv) to clear screen: Sclear | What is purpose of system call? State two system calls with their | 4M function: ‘Ans ] System call provides an interface between a running program and | purpose of operating system. It allows user to access services provided by | system cal operating system. This system calls are procedures written using C, | 2M, Two (C+ and assembly language instructions. Each operating system has its | svstem calls own name for each system call. Each system call is assoc number that identifies itself. System calls: Process Control: Program in execution is a process. A process to be executed must be loaded in main memory. while executing it may need to wait, terminate or create & terminate child processes. end, abort # load, execute «create proces ted with a , terminate process BIMAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘utonemons) sortEe - 27001 - 2013 Certified) * get process attributes, set process attributes © wait for time © wait event, signal event ‘allocate and free memory File Management: System allows us to create and delete files. For create and delete operation system call requires the name of the file and other attributes of the file. File attributes include file type, file size, protection codes, accounting information and so on. Systems access these attributes for performing operations on file and directories. Once the file is created, we can open it and use it, System also allows performing reading, writing or repositioning operations on file. «create file, delete file open, close «read, write, reposition + get file attributes, set device attributes ‘+ logically attach or detach devices 3. Device Management: When a process is in running state, it requires several resources to execute. These resources include main memory, disk drives, files and so on. If the resource is available, itis assigned to the process. Once the resource is allocated to the process, process can read, write and reposition the device. request device, release device «read, write, reposition get device attributes, set device attributes logically attach or detach devi 4. Information Maintenance: Transferring information between the user program and the operating system requires system call. System information includes displaying current date and time, the number of current user, the version number of the operating system, the amount of free memory or disk space and so on. Operating system keeps information about all its processes that can be accessed with system alls such as get process attributes and set process attributes. ‘© get time or date, set time or date get system data, set system data ‘get process, file, or devices attributes «set process, file, or devices attributes 5. Communication: Processes in the system, communicate with each other. Communication is done by using two models: message passing and shared memory. For transferring messages, sender process connects itself to receiving process by specifying receiving process waf26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) name or identity, Once the communication is over system close the connection between communicating processes. ‘create, delete communication connection + send, receive messages transfer status information + attach or detach remote devices. © _| State and describe types of scheduler. aM ‘Ans | There are three types of scheduler: © Long term scheduler © Short term scheduler ‘+ Medium term scheduler 1, Long term scheduler: It selects programs from job pool and loads them into the main memory. It controls the degree of multiprogramming. The degree of multiprogramming is the number of processes loaded (existing) into the main memory. System contains 1/0 bound processes and CPU bound processes. An I/O bound process spends more time for doing I/O operations whereas CPU bound process spends more time in doing computations with the CPU, So It is the responsibility of long term scheduler to balance the system by loading some 1/0 bound and some CPU bound processed into the main ‘memory. Long term scheduler executes only when a process leaves the system, so it executes less frequently. When long term scheduler selects a process from job pool, the state of process changes from new to ready state 2. Short term scheduler: It is also known as CPU scheduler. This scheduler selects processes that are ready for execution from the ready queue and allocates the CPU to the selected process Frequency of execution of short term scheduler is more than other schedulers. When short term scheduler selects a process, the state of process changes from ready to running state. 3.Medium term scheduler: When a process is in running state, due to some interrupt it is blocked. System swaps out blocked process and store it into a blocked and swapped out process queue. When space is available in the main memory, the operating system looks at the list of swapped out but ready processes. The medium term scheduler selects ‘one process from that list and loads it into the ready queue. The job of medium term scheduler is to select a process from swapped out Process queue and to load it into the main memory. This scheduler works in close communication with long term scheduler for loading process into the main memory. list-IM, description of each-I ‘d__[ Explain Round Robin algorithm with suitable example. aM 15] 26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) ‘Ans Tt is preemptive scheduling algorithm. A small unit of time known as a time quantum or time slice is used for pre-emption of a currently running process. Ready queue is implemented as a circular queue. CPU is assigned to the entire processes one by one, on first come first serve basis, for a specific time period. Every process executes for specified time period and CPU is given to the next process when time quantum expires. ‘A new process is added at the tail of the ready queue when it enters the system. CPU scheduler selects first process from head of the ready queue and executes it for a specified time quantum. Once the time quantum expires, dispatcher is invoked to pre-empt current running process and CPU is given to the next process placed at the head of the ready queue. The running process may have a CPU burst time less or greater than time quantum. If burst time of running process is less than the time quantum then, the process itself releases the CPU. The scheduler then selects next process from ready queue and executes it. If burst time of running process is longer than time quantum then, context switch occurs and the process is place at the tail of ready queue for remaining burst time execution. Example: Process Burst Time P; 24 Pp 3 Ps 3 Time quantum: 4 ms The resulting RR schedule is as follows: 10 14 18 2 2% 30 0 4 7 CPU is allocated to process P; for 4 ms. Since it requires another 20 milliseconds, it is preempted after the first time quantum and the CPU is given to the next process in the queue, process P2, Process P2 does not need 4 milliseconds, so it quits before its time quantum expires. The CPU is then given to the next process, process P;, Once each process has received 1 time quantum, the CPU retums to process P1 for an additional time quantum ‘explanation of round robin -2M, example-2M Explain PCB with diagram. aM ‘Ans: Each process is represented as @ process control block (PCB) in the operating system. It contains information associated with specific process, Process State: It indicates current state of a process. Process state can be new, ready, running, waiting and terminated. Process number: Each process is associated with a unique number ‘explanation- 2M, diagram2M 16] 26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsoMEC - 27001 - 2013 Certified) Which is known process identification number. Program Counter: It indicates the address of the next instruction to be executed for the process. CPU Registers: The registers vary in number and type depending on the computer architecture. Register includes accumulators, index registers, stack pointers and general purpose registers plus any condition code information. Memory Management Information: It includes information such as value of base and limit registers, page tables, segment tables, depending on the memory system used by OS. Accounting Information: This information includes the amount of CPU used, time limits, account holders, job or process number and so on. It also includes information about listed 1/0 devices allocated to the process such as list of open files. Each PCB gives information about a particular process for which it is designed. process state process number program counter registers memory limits list of open files 5 ‘Attempt any Two of the following: 12M a_| Enlist the operating system tools. Explain any two in detail. oM ‘Kans_| Following are the operating tool For List=2 ‘* User Management Marks and © Security policy Explanatio * Device Management many two ‘+ Performance Monitor for 4 Marks Task Scheduler A) User management: ‘© User management includes everything from creating a user to deleting a user on your system. User management can be done in three ways on a Linux system. ‘+ Command line tools include commands like useradd, userdel, uusermod, passwd, ete, These are mostly used by the server administrators. Useradd: With useradd commands you can add a user. 726MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘utonemons) sormEC - 27001 - 2013 Certified) ‘Syntax: _useradd -m -d /home/
- © "
"
Example: useradd -m -d /home/xyz -c "xyz" xyz File /etc/default/useradd contains some user default options. The command useradd -D can be used to display this file, Syntax: useradd -D Userdel: To delete a user account userdel command is used. Syntax: userdel -r
Usermod: The command usermod is used to modify the properties of an existing user. Syntax: usermod -c <'newName’>
Example: usermod -c ‘vppoly’ john Using passwd command Passwd: A user can set the password with the command passwd, Old password has to be typed twice before entering the new one Syntax: passwd
Example: passwd vppoly B) Device Management: Device management is the process of managing the implementation, operation and maintenance of a physical and/or virtual devi All Linux device files are located in the /dev directory, which is an integral part of the root (/) filesystem because these device files must be available to the operating system during the boot process. Example: Is -1 /dev Above example gives the list of device file from kernel. Udev supplies a dynamic device directory containing only the nodes for devices which are connected to the system. It creates or removes the device node files in the /dev directory. C) Performance Monitor: It is very tough job for every system or network administrator to monitor and debug Linux System Performance problems every day. The commands discussed below are some of the most fundamental commands when it comes to system analysis and debugging Linux server issues such as: 1) vmstat: Virtual memory statistics The vmstat command reports information about processes, memory, paging, block 10, traps, ~—aand-——cpu_—_ activity. $ vmstat 3 2)top: Process activity monitoring command 18] 26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsOMEC - 27001 - 2013 Certified) top command display Linux processes. It provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-intensive tasks running on the server and updates the list every five seconds. Stop 3) free: Show Linux server memory usage free command shows the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. # free 4) iostat: Montor Linux average CPU load and disk activity iostat command report Central Processing Unit (CPU) statisties and input/output statistics for devices, partitions and network filesystems (NFS). # iostat 5) netstat Linux network and statistics monitoring tool netstat command displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. # netstat tulpn b_| Explain multithreading model in detail. OM. ‘Ans [Many systems provide support for both user and kemel threads, | Each resulting in different multithreading models model=2M Following are three multithreading model: Many-to-One Model ‘+ The many-to-one model maps many user-level threads to one kernel thread. ‘© Thread management is done by the thread library in user space, so it is efficient; but the entire process will block if a thread makes a blocking system call. ‘* Also, because only one thread can access the kemel at a time, multiple threads are unable to nm in parallel on multiprocessors. + Example: Green threads- a thread library available for Solaris, 19] 26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘utonemons) sormEC - 27001 - 2013 Certified) ‘Advantages: ‘* More concurrency because of multiple threads can run in parallel on multiple CPUs. ‘* Less complication in the processing. Disadvantages: ‘© Thread creation involves light-weight process creation. © Kernel thread is an overhead. ‘© Limiting the number of total threads. One-to-One Model ‘+ The one-to-one model maps each user thread to a kernel thread. ‘* It provides more concurrency than the many-to-one model by allowing another thread to run when a thread makes a blocking system call; it also allows multiple threads to run in parallel on multiprocessors. ‘* The only drawback to this model is that creating a user thread requires creating the corresponding kernel thread. ‘* Because the overhead of creating kemel threads can burden the performance of an application, most implementations of this model restrict the number of threads supported by the system. ‘+ Linux, along with the family of Windows operating systems, implement the one-to-one model. Advantages: ‘+ Mainly used in language system, portable libraries, ‘© One kemel thread controls multiple user thread, Disadvantages: ‘© Parallelism is not supported by this model, One block can blocks all user threads. Many-to-Many Model ‘© The many-to-many model multiplexes many user-level threads to a smaller or equal number of kernel threads. ‘* The number of kemel threads may be specific to either a particular application or a particular machine (an application may be allocated more kere] threads on a multiprocessor than on a uniprocessor). 20126MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) * The one-to-one model allows for greater concurrency, but the developer has to be careful not to create too many threads within an application (and in some instances may be limited in the number of threads she can create). * The many-to-many model suffers from neither of these shortcomings: developers can create as many user threads as necessary, and the corresponding kemel threads can run in parallel on a multiprocessor. ‘© Also, when a thread performs a blocking system call, the kernel can schedule another thread for execution. Advantages: Many threads can be created as per user’s requirement. ‘+ Multiple kernel or equal to user threads can be created. Disadvantages: © True concurrency cannot be achieved. ‘+ Multiple threads of kemel is an overhead for operating system Explain LRU page replacement algorithm for following reference OM string. 70120304230321201701 Calculate the page fault. “Ans LRU: TRU ‘* The Least Recently Used (LRU) page replacement policy | explanation replaces the page that has not been used for the longest |=2M period of time. Calculation ‘+ LRU replacement associates with each page the time of that |=4M page's last use. ‘+ When a page must be replaced, LRU chooses the page that has not been used for the longest period of time ‘© The LRU policy is often used as a page-replacement algorithm and is considered to be good. ‘+ An LRU page-replacement algorithm may require substantial hardware assistance 21j26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) Counters: ‘© In the simplest case, we associate with each page-table entry a time-of-use field and add to the CPU a logical clock or counter. The clock is incremented for every memory reference, Whenever a reference to a page is made, the contents of the clock register are copied to the time-of-use field in the page- table entry for that page. ‘+ In this way, we always have the "time" of the last reference to each page. We replace the page with the smallest time value. Stack: ‘* Another approach to implementing LRU replacement is to keep a stack of page numbers. ‘+ Whenever a page is referenced, it is removed from the stack and put on the top. ‘* In this way, the most recently used page is always at the top of the stack and the least recently used page is always at the bottom, Reference String: 70120304230321201701 (Frame size have not mentioned in question so assume frame size as 3 or 4) LRU: Assume frame size=3 70120304230321201701 aad [2 Taal Tal a 4 ooo o *folola 3 -| [3] To fol* Wa {3} | 3} 2f af a} | sla} lal | Page Fault=12 _ _ _ Assume frame siz 70120304230321201701 aia (3 13 1 7 ooo oto [i+ [fo T* fol ala fal i] Tsay | tal al “BETTI Page fault=08 ‘Attempt any Two of the following: a _| The jobs are scheduled for execution as follows: (1m-gantt chart, 2m calculation 22/26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous (SOMEC - 27001 - 2013 Certified) Process | Arrival Time | Burst Time of AWT) PI 0 7 P2 1 4 P3 2 10 Pa 3 6 PS, 4 8 i) SIF ii) FCFS Also find average waiting time using Gantt chart. ‘Ans Note: reemptive SIF art: P2 Pa PS 11 17 35 Process | Arrival | Burst | Waiting Time ___| Time _| Time PL 0 7 P2, 1 4 P3 2 10 P4 3 6 PS 4 8 Average waiting Time=(0+6+23+08+13)/5 = 50/5=10 OR PI P4 PS P3 5 1 7 23 35 Process | Arrival | Burst | Waiting Time Time __| Time PI 0 7 Gs P2 1 4 1-1-0 P3 2 10 P4 3 6 P5 4 8 Average Waiting Time=4+0+23+8+13/5-9.6 23/26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous AsonEC - 27001 - 2013 Certified) Process | Arrival Time PI 0 P2 1 P3 2 P4 3 PS 4 8 27-4=23, Average waiting Time=0+6+9+18+23/5 =56/5=11.2, b | List free space management techniques? Describe any one in oM detail, ‘Ans [A file system is responsible to allocate the free blocks to the file Listing= therefore it has to keep track of all the free blocks present in the disk. | Explanation ‘There are mainly four approaches by using which, the free blocks in| =3M the disk are managed. And © Bit Vector Diagram=2 M © Linked List ‘© Grouping * Counting Bit Vector: ‘© The free-space list is implemented as a bit map or bit vector. ‘* Each block is represented by I bit. If the block is free, the bit is 1; if the block is allocated, the bit is 0. For example, consider a disk where blocks 2, 3,4, 5, 8, 9, 10, 11, 12, 13 are free and the rest of the blocks are allocated. «The free-space bit map would be : 0011110011111100 ofi}2]sfa}s|e]7]s]o| 10) a) a)as] ia] ofofrfalifafofofafifafafafafo]?® 0-Free block 1= Allocated block ‘The main advantage of this approach is its relative simplicity and its efficiency in finding the first free block or n consecutive free blocks on the disk, 2al26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘Autonomous soMEC - 27001 - 2013 Certified) Linked List ‘© In this approach, the free disk blocks are linked together ie. a free block contains a pointer to the next free block. The block number of the very first disk block is stored at a separate location on disk and is also cached in memory. ‘© In this approach, link all the disk blocks together, keeping a pointer to the first free block. ‘© This block contains a pointer to the next free disk block, and so on. poLleiCeafeal 2aLles(ee erty 120 e091 Enlist different file allocation methods? allocation method in detail. ‘contiguous ‘Ans From the user's point of view, a file is an abstract data type. It can be created, ‘opened, written, read, closed and deleted without any real concern for its implementation. The implementation of a file is a problem for the operating system. ‘The main problem is how to allocate space to these files so that disk space is effectively utilized and files can be quickly accessed. Three major methods of allocating disk space are in wide use: © Contiguous © Linked + Indexed Contiguous Allocation + The contiguous allocation method requires each file to occupy a set of contiguous addresses on the disk. Disk addresses define a linear ordering on the disk. Contiguous allocation of a file is defined by the disk address of the first block and its length. If the file is ‘n’ blocks long and starts at location “b’, then it occupies blocks b, b+1, b+2, -- --- b+nel, The directory entry for each file indicates the address of the starting block and the length of the area allocated for this file. + Contiguous allocation supports both sequential and direct, Im- listing, 2m for diagram, 3m for explanation 25] 26MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION ‘utonemons) somEC - 27001 - 2013 Certified) access. For direct access to block ‘i’ of a file, which starts at block ‘b’, we can immediately access block bti. The difficulty with contiguous allocation is finding space for a new file. For direct access to block ‘i’ of a file, which starts at block *b’, we can immediately access block bi. The difficulty with contiguous allocation is finding space for a new file. If file to be created are ‘n’ blocks long, we must search free space list for ‘n’ free contiguous blocks. — So ES =a = . :; = sO wl f S 3 sOpey vow aD zo Advantages of Contiguous File Allocation Method: 1 2. Supports both sequential and direct access methods. Contiguous allocation is the best form of allocation for sequential files, Multiple blocks can be brought in at a time to improve I/O performance for sequential processing It is also easy to retrieve a single block from a file. For example, if a file starts at block ‘n’ and the ith block of the file is wanted, its location on secondary storage is simply n + i. Reading all blocks belonging to each file is very fast. Provides good performance. Disadvantages of Contiguous File Allocation Method: 1 Suffers from external fragmentation. ‘Very difficult to find contiguous blocks of space for new files. Also with pre-allocation, it is necessary to declare the size of the file at the time of creation which many a times is difficult to estimate. Compaction may be required and it can be very expensive, 26126
You might also like
OSY Document 3
PDF
No ratings yet
OSY Document 3
26 pages
osy winter 17
PDF
No ratings yet
osy winter 17
30 pages
Osy w22 Odd
PDF
No ratings yet
Osy w22 Odd
6 pages
Os winter 2023
PDF
No ratings yet
Os winter 2023
26 pages
2018 Winter Model Answer Paper PDF
PDF
0% (1)
2018 Winter Model Answer Paper PDF
32 pages
Lmfkljslgegj Merged (1)
PDF
No ratings yet
Lmfkljslgegj Merged (1)
65 pages
OSY All Model Ans Paper
PDF
No ratings yet
OSY All Model Ans Paper
101 pages
f5aff700-ed19-4f24-8519-1f2cfcf1a913
PDF
No ratings yet
f5aff700-ed19-4f24-8519-1f2cfcf1a913
28 pages
w23-ANS
PDF
No ratings yet
w23-ANS
28 pages
osy-w-23-osy-22516-winter-2023
PDF
No ratings yet
osy-w-23-osy-22516-winter-2023
28 pages
f37c6c42-7ebd-471c-ac4f-4e98a65ccd4d
PDF
No ratings yet
f37c6c42-7ebd-471c-ac4f-4e98a65ccd4d
28 pages
2016 Summer Model Answer Paper
PDF
No ratings yet
2016 Summer Model Answer Paper
35 pages
New Osy
PDF
No ratings yet
New Osy
57 pages
Osy Answer Paper
PDF
No ratings yet
Osy Answer Paper
47 pages
OS Winter2019
PDF
No ratings yet
OS Winter2019
27 pages
osy w19 22 23
PDF
No ratings yet
osy w19 22 23
75 pages
OSY-MAW
PDF
No ratings yet
OSY-MAW
47 pages
OSY Kit
PDF
0% (1)
OSY Kit
110 pages
22516-2019-Winter-Model-Answer-Paper (Msbte Study Resources)
PDF
100% (3)
22516-2019-Winter-Model-Answer-Paper (Msbte Study Resources)
26 pages
Model Asnwer Paper
PDF
No ratings yet
Model Asnwer Paper
80 pages
Osy Model
PDF
No ratings yet
Osy Model
100 pages
Important Instructions To Examiners:: Define Real Time Operating System, Along With Any Two Applications of It
PDF
No ratings yet
Important Instructions To Examiners:: Define Real Time Operating System, Along With Any Two Applications of It
27 pages
Sample 19
PDF
No ratings yet
Sample 19
26 pages
OS Winter 2022
PDF
No ratings yet
OS Winter 2022
21 pages
f2850d89-ea08-469d-9f87-c440300f0702
PDF
No ratings yet
f2850d89-ea08-469d-9f87-c440300f0702
27 pages
1.Overview of Operating System
PDF
No ratings yet
1.Overview of Operating System
17 pages
Osy w19 Odd
PDF
No ratings yet
Osy w19 Odd
7 pages
Os Win-22
PDF
No ratings yet
Os Win-22
21 pages
OS Winter2022
PDF
No ratings yet
OS Winter2022
22 pages
2016 Winter Model Answer Paper
PDF
No ratings yet
2016 Winter Model Answer Paper
32 pages
W18 Operating System
PDF
No ratings yet
W18 Operating System
35 pages
Introduction To OS Lecture 2
PDF
No ratings yet
Introduction To OS Lecture 2
54 pages
Osy Model Ams
PDF
No ratings yet
Osy Model Ams
53 pages
Winter 2023
PDF
No ratings yet
Winter 2023
27 pages
Operating System: Rahul Saha
PDF
No ratings yet
Operating System: Rahul Saha
20 pages
OSY Model All.pdf
PDF
No ratings yet
OSY Model All.pdf
53 pages
osy winter 16
PDF
No ratings yet
osy winter 16
32 pages
ilovepdf_merged
PDF
No ratings yet
ilovepdf_merged
53 pages
Summer-24
PDF
78% (9)
Summer-24
26 pages
S-24 Merged
PDF
No ratings yet
S-24 Merged
262 pages
OSY S24-W23-W22-W219
PDF
No ratings yet
OSY S24-W23-W22-W219
100 pages
ilovepdf_merged
PDF
No ratings yet
ilovepdf_merged
50 pages
W 22 Operating-System
PDF
No ratings yet
W 22 Operating-System
21 pages
Operating System UNIT 2
PDF
No ratings yet
Operating System UNIT 2
36 pages
Operating System Winter 2019
PDF
No ratings yet
Operating System Winter 2019
27 pages
Unit 1
PDF
No ratings yet
Unit 1
9 pages
Osy Summer 17
PDF
No ratings yet
Osy Summer 17
33 pages
Operating System: Time: 3 HRS.) (Marks: 100
PDF
100% (1)
Operating System: Time: 3 HRS.) (Marks: 100
17 pages
Model Answer: Important Instructions To Examiners
PDF
No ratings yet
Model Answer: Important Instructions To Examiners
33 pages
Unit1pdf 2024 01 01 09 02 09
PDF
No ratings yet
Unit1pdf 2024 01 01 09 02 09
61 pages
Wa0003.
PDF
No ratings yet
Wa0003.
7 pages
Study Material for exam
PDF
No ratings yet
Study Material for exam
11 pages
CGPDTM OS Qs_SET-1
PDF
No ratings yet
CGPDTM OS Qs_SET-1
5 pages
Operating System Unit 4
PDF
No ratings yet
Operating System Unit 4
18 pages
Bos Unit 1
PDF
No ratings yet
Bos Unit 1
9 pages