Ticker

6/recent/ticker-posts

Operating system subjective question for competitive exam(3)

Q1.Explain function of operating system.

Operating system performs the following functions: 1. Booting Booting is a process of starting the computer operating system starts the computer to work. It checks the computer and makes it ready to work. 2. Memory Management It is also an important function of operating system. The memory cannot be managed without operating system. Different programs and data execute in memory at one time. if there is no operating system, the programs may mix with each other. The system will not work properly. 3. Loading and Execution A program is loaded in the memory before it can be executed. Operating system provides the facility to load programs in memory easily and then execute it. 4. Data security Data is an important part of computer system. The operating system protects the data stored on the computer from illegal use, modification or deletion. 5. Disk Management Operating system manages the disk space. It manages the stored files and folders in a proper way. 6. Process Management CPU can perform one task at one time. if there are many tasks, operating system decides which task should get the CPU. 7. Device Controlling operating system also controls all devices attached to computer. The hardware devices are controlled with the help of small software called device drivers.. 8. Providing interface It is used in order that user interface acts with a computer mutually. User interface controls how you input data and instruction and how information is displayed on screen. The operating system offers two types of the interface to the user: 1. Graphical-line interface: It interacts with of visual environment to communicate with the computer. It uses windows, icons, menus and other graphical objects to issues commands. 2. Command-line interface:it provides an interface to communicate with the computer by typing commands.



Q2.What is thread how it is different from process.

Types of System Calls 1. Process control 2. File management 3. Device management 4. Information maintenance 5. Communications Process control A running needs to halt its execution either normally or abnormally. If a system call is made to terminate the running program, a dump of memory is sometimes taken and an error message generated which can be diagnosed by a debugger o end, abort o load, execute o create process, terminate process o get process attributes, set process attributes o wait for time o wait event, signal event o allocate and free memory File management OS provides an API to make these system calls for managing files o create file, delete file o open, close file o read, write, reposition o get and set file attributes Device management Process requires several resources to execute, if these resources are available, they will be granted and control retuned to user process. Some are physical such as video card and other such as file. User program request the device and release when finished o request device, release device o read, write, reposition o get device attributes, set device attributes o logically attach or detach devices Information maintenance System calls exist purely for transferring information between the user program and OS. It can return information about the system, such as the number of current users, the version number of the operating system, the amount of free memory or disk space and so on. o get time or date, set time or date o get system data, set system data o get and set process, file, or device attributes Communications Two common models of communication Message-passing model, information is exchanged through an inter process-communication facility provided by the OS. Shared-memory model, processes use map memory system calls to gain access to regions of memory owned by other processes. o create, delete communication connection o send, receive messages o transfer status information o attach and detach remote devices



Q3.Explain program and process

Process A process is a program at the time of execution. Differences between Process and Program Process is a dynamic object Program is a static object Process is sequence of instruction execution Program is a sequence of instructions Process loaded in to main memory Program loaded into secondary storage devices Time span of process is limited Time span of program is unlimited Process is a active entity Program is a passive entity When a process executed, it changes the state, generally the state of process is determined by the current activity of the process. Each process may be in one of the following states: 1. New : The process is beingcreated. 2. Running : The process is beingexecuted. 3. Waiting : The process is waiting for some event tooccur. 4. Ready : The process is waiting to be assigned to a processor. 5. Terminated : The Process has finishedexecution. Only one process can be running in any processor at any time, But many process may be in ready and waiting states. The ready processes are loaded into a “ready queue”. a) New ->Ready : OS creates process and prepares the process to be executed,thenOSmoved the process into readyqueue. b) Ready->Running : OS selects one of the Jobs from ready Queue and move themfrom ready to Running. c) Running->Terminated : When the Execution of a process has Completed, OSterminatesthatprocess from running state. Sometimes OS terminates the process for someother reasons including Time exceeded, memory unavailable, access violation, protection Error, I/O failure and soon. d) Running->Ready : When the time slot of the processor expired (or) If the processorreceivedanyinterrupt signal, the OS shifted Running -> ReadyState. e) Running -> Waiting : A process is put into the waiting state, if the process need an event occur (or) an I/O Devicerequire. f) Waiting->Ready : A process in the waiting state is moved to ready state when the eventforwhichit has beenCompleted.

Q4.Logical and physical address.

An address generated by the CPU is commonly refereed as Logical Address, whereas the address seen by the memory unit that is one loaded into the memory address register of the memory is commonly refereed as the Physical Address. The compile time and load time address binding generates the identical logical and physical addresses. However, the execution time addresses binding scheme results in differing logical and physical addresses. The set of all logical addresses generated by a program is known as Logical Address Space, where as the set of all physical addresses corresponding to these logical addresses is Physical Address Space. Now, the run time mapping from virtual address to physical address is done by a hardware device known as Memory Management Unit. Here in the case of mapping the base register is known as relocation register. The value in the relocation register is added to the address generated by a user process at the time it is sent to memory Memory-Management Unit (MMU) Hardware device that maps virtual to physical address In MMU scheme, the value in the relocation register is added to every address generated by a user process at the time it is sent to memory The user program deals with logical addresses; it never sees the real physical addresses. The user program never sees the real physical address space, it always deals with the Logical addresses. As we have two different type of addresses Logical address in the range (0 to max) and Physical addresses in the range(R to R+max) where R is the value of relocation register. The user generates only logical addresses and thinks that the process runs in location to 0 to max. As it is clear from the above text that user program supplies only logical addresses, these logical addresses must be mapped to physical address before they are used.

Q5.Explain system program.

System Programs System programs provide a convenient environment for program development and execution. The can be divided into: File manipulation Status information File modification Programming language support Program loading and execution Communications Application programs Most users’ view of the operation system is defined by system programs, not the actual system calls provide a convenient environment for program development and execution Some of them are simply user interfaces to system calls; others are considerably more complex File management - Create, delete, copy, rename, print, dump, list, and generally manipulate files and directories  Status information Some ask the system for info - date, time, amount of available memory, disk space, number of users Others provide detailed performance, logging, and debugging information Typically, these programs format and print the output to the terminal or other output devices Some systems implement a registry - used to store and retrieve configuration information  File modification Text editors to create and modify files Special commands to search contents of files or perform transformations of the text Programming-language support - Compilers, assemblers, debuggers and interpreters sometimes provided Program loading and execution- Absolute loaders, relocatable loaders, linkage editors, and overlay- loaders, debugging systems for higher-level and machine language. Communications - Provide the mechanism for creating virtual connections among processes, users, and computer systems Allow users to send messages to one another’s screens, browse web pages, send electronic-mail messages, log in remotely, transfer files from one machine to another



Post a Comment

0 Comments