You are on page 1of 12

Operating system questions

By admin | January 17, 2005

1. What are the basic functions of an operating system? - Operating system controls and coordinates the use of the hardware among the various applications programs for various uses. Operating system acts as resource allocator and manager. Since there are many possibly conflicting requests for resources the operating system must decide which requests are allocated resources to operating the computer system efficiently and fairly. Also operating system is control program which controls the user programs to prevent errors and improper use of the computer. It is especially concerned with the operation and control of I/O devices. 2. Why paging is used? - Paging is solution to external fragmentation problem which is to permit the logical address space of a process to be noncontiguous, thus allowing a process to be allocating physical memory wherever the latter is available. 3. While running DOS on a PC, which command would be used to duplicate the entire diskette? diskcopy 4. What resources are used when a thread created? How do they differ from those when a process is created? - When a thread is created the threads does not require any new resources to execute the thread shares the resources like memory of the process to which they belong to. The benefit of code sharing is that it allows an application to have several different threads of activity all within the same address space. Whereas if a new process creation is very heavyweight because it always requires new address space to be created and even if they share the memory then the inter process communication is expensive when compared to the communication between the threads. 5. What is virtual memory? - Virtual memory is hardware technique where the system appears to have more memory that it actually does. This is done by time-sharing, the physical memory and storage parts of the memory one disk when they are not actively being used. 6. What is Throughput, Turnaround time, waiting time and Response time? - Throughput number of processes that complete their execution per time unit. Turnaround time amount of time to execute a particular process. Waiting time amount of time a process has been waiting in the ready queue. Response time amount of time it takes from when a request was submitted until the first response is produced, not output (for timesharing environment). 7. What is the state of the processor, when a process is waiting for some event to occur? - Waiting state 8. What is the important aspect of a real-time system or Mission Critical Systems? - A real time operating system has well defined fixed time constraints. Process must be done within the defined constraints or the system will fail. An example is the operating system for a flight control computer or an advanced jet airplane. Often used as a control device in a dedicated application such as controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems. Real-Time systems may be either hard or soft real-time. Hard real-time: Secondary storage limited or absent, data stored in short term memory, or read-only memory (ROM), Conflicts with time-sharing systems, not supported by general-purpose operating systems. Soft real-time: Limited utility in industrial control of robotics, Useful in applications (multimedia, virtual reality) requiring advanced operating-system features. 9. What is the difference between Hard and Soft real-time systems? - A hard real-time system guarantees that critical tasks complete on time. This goal requires that all delays in the system be bounded from the retrieval of the stored data to the time that it takes the operating system to finish any request made of it. A soft real time system where a critical real-time task gets priority over other tasks and retains that priority until it completes. As in hard real time systems kernel delays need to be bounded 10. What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem? - Thrashing is caused by under allocation of the minimum number of pages required by a process, forcing it to continuously page fault. The system can detect thrashing by evaluating the level of CPU utilization as compared to the level of multiprogramming. It can be eliminated by reducing the level of multiprogramming. 11. What is multi tasking, multi programming, multi threading? - Multi programming: Multiprogramming is the technique of running several programs at a time using timesharing. It allows a computer to do several things at the same time. Multiprogramming creates logical parallelism. The concept of multiprogramming is that the operating system keeps several jobs in memory simultaneously. The operating system selects a job from the job pool and starts executing a job, when that job needs to wait for any i/o operations the CPU is switched to another job. So the main idea here is that the CPU is never idle. Multi tasking: Multitasking is the logical extension of multiprogramming .The concept of multitasking is quite similar to multiprogramming but difference is that the switching between jobs occurs so frequently that the users can interact with each program while it is running. This concept is also known as time-sharing systems. A timeshared operating system uses CPU scheduling and multiprogramming to provide each user with a small portion of time-shared system. Multi threading: An application typically is implemented

as a separate process with several threads of control. In some situations a single application may be required to perform several similar tasks for example a web server accepts client requests for web pages, images, sound, and so forth. A busy web server may have several of clients concurrently accessing it. If the web server ran as a traditional single-threaded process, it would be able to service only one client at a time. The amount of time that a client might have to wait for its request to be serviced could be enormous. So it is efficient to have one process that contains multiple threads to serve the same purpose. This approach would multithread the web-server process, the server would create a separate thread that would listen for client requests when a request was made rather than creating another process it would create another thread to service the request. To get the advantages like responsiveness, Resource sharing economy and utilization of multiprocessor architectures multithreading concept can be used. 12.What is hard disk and what is its purpose? - Hard disk is the secondary storage device, which holds the data in bulk, and it holds the data on the magnetic medium of the disk.Hard disks have a hard platter that holds the magnetic medium, the magnetic medium can be easily erased and rewritten, and a typical desktop machine will have a hard disk with a capacity of between 10 and 40 gigabytes. Data is stored onto the disk in the form of files. 13.What is fragmentation? Different types of fragmentation? - Fragmentation occurs in a dynamic memory allocation system when many of the free blocks are too small to satisfy any request. External Fragmentation: External Fragmentation happens when a dynamic memory allocation algorithm allocates some memory and a small piece is left over that cannot be effectively used. If too much external fragmentation occurs, the amount of usable memory is drastically reduced. Total memory space exists to satisfy a request, but it is not contiguous. Internal Fragmentation: Internal fragmentation is the space wasted inside of allocated memory blocks because of restriction on the allowed sizes of allocated blocks. Allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used 14.What is DRAM? In which form does it store data? - DRAM is not the best, but its cheap, does the job, and is available almost everywhere you look. DRAM data resides in a cell made of a capacitor and a transistor. The capacitor tends to lose data unless its recharged every couple of milliseconds, and this recharging tends to slow down the performance of DRAM compared to speedier RAM types. 15. What is Dispatcher? - Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves: Switching context, Switching to user mode, Jumping to the proper location in the user program to restart that program, dispatch latency time it takes for the dispatcher to stop one process and start another running. 16.What is CPU Scheduler? - Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. CPU scheduling decisions may take place when a process: 1.Switches from running to waiting state. 2.Switches from running to ready state. 3.Switches from waiting to ready. 4.Terminates. Scheduling under 1 and 4 is non-preemptive. All other scheduling is preemptive. 17. What is Context Switch? - Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task is known as a context switch. Context-switch time is pure overhead, because the system does no useful work while switching. Its speed varies from machine to machine, depending on the memory speed, the number of registers which must be copied, the existed of special instructions(such as a single instruction to load or store all registers). 18. What is cache memory? - Cache memory is random access memory (RAM) that a computer microprocessor can access more quickly than it can access regular RAM. As the microprocessor processes data, it looks first in the cache memory and if it finds the data there (from a previous reading of data), it does not have to do the more time-consuming reading of data from larger memory. 19.What is a Safe State and what is its use in deadlock avoidance? - When a process requests an available resource, system must decide if immediate allocation leaves the system in a safe state. System is in safe state if there exists a safe sequence of all processes. Deadlock Avoidance: ensure that a system will never enter an unsafe state. 20. What is a Real-Time System? - A real time process is a process that must respond to the events within a certain time period. A real time operating system is an operating system that can run real time processes successfully

Explain the meaning of Kernal.


The kernel is the essential center of a computer operating system, the core that provides basic services for all other parts of the operating system. As a basic component of an operating system, a kernel provides the lowest-level abstraction layer for the resources. The kernel's primary purpose is to manage the computer's resources and allow other programs to run and use the resources like the CPU, memory and the I/O devices in the computer. The facilities provides by the kernel are :

Memory management the kernel has full access to the system's memory and must allow processes to access safely this memory as they require it. Device management To perform useful functions, processes need access to the peripherals connected to the computer, which are controlled by the kernel through device drivers System calls To actually perform useful work, a process must be able to access the services provided by the kernel.

Types of Kernel:

Monolithic kernels Every part which is to be accessed by most programs which cannot be put in a library is in the kernel space: Device drivers Scheduler Memory handling File systems Network stacks Microkernls In Microkernels, parts which really require to be in a privileged mode are in kernel space: -Inter-Process Communication, -Basic scheduling -Basic memory handling -Basic I/O primitives

Due to this, some critical parts like below run in user space:

The complete scheduler Memory handling File systems Network stacks

Kernel is the core module of an operating system. It is the kernel that loads first and retain in main memory of the computer system. It provides all essential operations /services those are needed by applications. Kernel takes the responsibility of managing the memory, task, disk and process.

What is a command interpreter?


The part of an Operating System that interprets commands and carries them out. A command interpreter is the part of a computer operating system that understands and executes commands that are entered interactively by a human being or from a program. In some operating systems, the command interpreter is called the shell. The BIOS is looking for the files needed to load in case of Windows is the Command.com. The required files are Command.com, IO.sys, and Msdos.sys to get Windows started. They reside in the Root of the C Drive. A command interpreter is a program which reads the instructions given by the user. It then translates these instructions into the context of the operating system followed by the execution. Command interpreter is also known as shell

The part of an Operating System that interprets commands and carries them out. A command interpreter is the part of a computer operating system that understands and executes commands that are entered interactively by a human being or from a program. In some operating systems, the command interpreter is called the shell. The BIOS is looking for the files needed to load in case of Windows is the Command.com. The required files are Command.com, IO.sys, and Msdos.sys to get Windows started. They reside in the Root of the C Drive. A command interpreter is a program which reads the instructions given by the user. It then translates these instructions into the context of the operating system followed by the execution. Command interpreter is also known as shell

What is a daemon?
In Unix and some other operating systems, a daemon is a computer program that runs in the background; It is not under the direct control of a user. They are usually initiated as background processes. Daemons have names that end with the letter "d". E.g. syslogd, sshd In a Unix, the parent process of a daemon is usually the init process (PID=1). Processes usually become daemons by forking a child process and then having their parent process immediately exit, thus causing init to adopt the child process. Daemon is a program that runs in the background without users interaction. A daemon runs in a multitasking operating system like UNIX. A daemon is initiated and controlled by special programs known as processes. Usually daemons have a suffix letterd. For instance, syslogd, a daemon for handling the system log.

Explain the basic functions of process management.

The basic functions of the OS wrt the process management are :


Allocating resources to processes, enabling processes to share and exchange information, protecting the resources of each process from other processes and Enabling synchronization among processes.

A process is an integral part of operating system. The resources are allocated by the operating system to the processes. The functions are: - Allocation and protection of resources - Synchronization enabling for all processes - Processes protection
What is a named pipe?

A connection used to transfer data between separate processes, usually on separate computers. Its a pipe that an application opens by name in order to write data into or read data from the pipe. They are placed in the /dev directory and are treated as special files. Using a named pipe facilitates interprocess communications. A named pipe is an extension of the concept pipe in multitasking operating system. Inter process communication is implemented using a named pipe. A pipe / traditional pipe is unnamed. The reason is it persists as long as the process is executing. Where as a named pipe is system-persistent and exists more than a process running time. It can be removed if not required in future.
What is pre-emptive and non-preemptive scheduling?

Tasks are usually assigned with priorities. At times it is necessary to run a certain task that has a higher priority before another task although it is running. Therefore, the running task is interrupted for some time and resumed later when the priority task has finished its execution. This is called preemptive scheduling. Eg: Round robin In non-preemptive scheduling, a running task is executed till completion. It cannot be interrupted. Eg First In First Out Preemptive scheduling: The preemptive scheduling is prioritized. The highest priority process should always be the process that is currently utilized. Non-Preemptive scheduling: When a process enters the state of running, the state of that process is not deleted from the scheduler until it finishes its service time.
What is a semaphore?

A semaphore is a variable. There are 2 types of semaphores: Binary semaphores Counting semaphores Binary semaphores have 2 methods associated with it. (up, down / lock, unlock) Binary semaphores can take only 2 values (0/1). They are used to acquire locks. When a resource is available, the process in charge set the semaphore to 1 else 0. Counting Semaphore may have value to be greater than one, typically used to allocate resources from a pool of identical resources.
What is difference between binary semaphore and mutex?

The differences between binary semaphore and mutex are:

Mutex is used exclusively for mutual exclusion. Both mutual exclusion and synchronization can be used by binary. A task that took mutex can only give mutex. From an ISR a mutex can not be given. Recursive taking of mutual exclusion semaphores is possible. This means that a task that holds before finally releasing a semaphore, can take the semaphore more than once. Options for making the task which takes as DELETE_SAFE are provided by Mutex, which means the task deletion is not possible when holding the mutex.

A semaphore is hardware or a software tag variable whose value indicates the status of a common resource. Its purpose is to lock the resource being used. A process which needs the resource will check the semaphore for determining the status of the resource followed by the decision for proceeding. In multitasking operating systems, the activities are synchronized by using the semaphore techniques.
Explain the meaning of mutex.

A mutex and the binary semaphore are essentially the same. Both can take values: 0 or 1. However, there is a significant difference between them that makes mutexes more efficient than binary semaphores. A mutex can be unlocked only by the thread that locked it. Thus a mutex has an owner

concept. Mutex is the short form for Mutual Exclusion object. A mutex allows multiple threads for sharing the same resource. The resource can be file. A mutex with a unique name is created at the time of starting a program. A mutex must be locked from other threads, when any thread that needs the resource. When the data is no longer used / needed, the mutex is set to unlock.
What are the different types of memory?

The types of memory in a computer system are:


Cache Memory - This is a small amounts of memory used to speed up system performance. Main memory - This is the RAM (random access memory) Secondary memory - This is a magnetic storage that keeps applications and data available to be used, and may also serves as virtual memory depending upon the operating system

The memory types are: SIMM - Single-Line Memory Modules: Used to store single row of chips which are soldered onto Printed Circuit Board. DIMM Dual-Line Memory Modules: Used to store two rows of chips which are soldered onto printed circuit board and enables to contain two times memory than SIMM DRAM Dynamic Random Access Memory: It holds data for short time period and will be refreshed periodically. SDRAM - Static RAM Holds data and refreshing does not required. It is faster than DRAM. Flash Memory: A non volatile, rewritable and solid state memory which performs the functions of both RAM and hard disk combined. Data is retained in the memory, in case of power loss. It is ideal for printers, cellular phones, digital cameras, pagers. Shadow RAM: Allows the moving of selected parts of BIOS code that is available in ROM to the faster RAM.
Explain the meaning of virtual memory.

Virtual memory is an approach to make use of the secondary storage devices as an extension of the primary storage of the computer. It is the process of increasing the apparent size of a computer's RAM by using a section of the hard disk storage as an extension of RAM. Logically-assigned memory that may or may not exist physically. Through the use of paging and the swap area, more memory can be referenced and allocated than actually exists on the system, thus giving the appearance of a larger main memory than actually exists. Most operating systems of desktop computers have a common part known as virtual memory. The use of virtual memory is so common because of its benefits provided to user at a lower cost. Today most of the computers have RAM of capacity 64 or 128 MB to be used by the CPU resources. This amount of RAM is not sufficient to run all applications that are used by most users in their expected way and all at once. For example, an e-mail program, a

web browser and a word processor is loaded into RAM simultaneously; the 64 MB space is not enough to store all these programs. In the absence of virtual memory, a message Sorry, you cannot load any more applications. Please close an application to load a new one. would be displayed. With the use of virtual memory, a computer can look for empty areas of RAM which is not being used currently and copies them on to the hard disk device. This process frees up RAM to load new applications. As it is done automatically, the user do not even know that it is happening, and the user feels like RAM has unlimited space even though the RAM capacity is 32 MB. The fact that hard disk space is much cheaper than RAM chips allows virtual memory also as a nice economic benefit. The RAM images are stored in the hard disk and known as page file. It contains the pages of RAM, and the data moves back and forth between the pages file and RAM by the operating system. The page files on a machine with Windows operating system have a .SWP extension. The read/write speed of a hard disk drive is slower than RAM. The hard disks technology is not upgraded to access small pieces of data at a given point of time. If the reliance of a system is too heavy on virtual memory, a significant performance drop would be noticed. The key for this is to have sufficient amount of RAM to handle all aspects that tend to work simultaneously. The feel of slowness of virtual memory is a slight pause at the time of changing tasks. Virtual memory works beautifully with sufficient RAM availability. If not, the operating system must swap information back and forth between RAM and the hard disk constantly. This process is called trashing, and also causes the feel to the user that the computer system is incredibly slow. Virtual Memory is a feature of an operating system. Virtual memory enables memory address space usage by a process which is independent of other processes running at the same time and uses memory space which is larger than RAM. It relegates temporarily some content that is available in RAM to disk.
What is RTOS?

A certain capability within a specified time constraint is guaranteed by an operating system called real time operating system. For example, certain object availability for a robot when it is assembled is ensured by a real time operating system. For making an object available within a designated time, the operating system would terminate with a failure. This is called a hard real time operating system. The assembly line will be continued for functioning, but the output of production might be lower as the objects appearance is failed in a designated time, which causes the robot to be temporarily unproductive. This is called soft real time operating system. Some of the real time operating systems qualities can be valuated by operating systems such as Microsofts Windows 2000, IBMs OS/390 up to some extent. It means that, if an operating system does not qualify certain characteristics of the operating system enables to be considered as a solution to a certain real time application problem. There is a requirement of real time operating system in small embedded systems which are bundled as part of micro devices. The requirements of real time operating systems are considered for some kernels. Since device drivers also needed for a suitable solution, a real time operating system is larger than just a kernel.
What is the difference between hard real-time and soft real-time OS?

Critical task completion on time is guaranteed by a hard real time system. The tasks

needed for delays in the system are to be bounded by retrieving the stored data at the time which takes the operating system to complete any request. A critical task obtains a priority over other tasks and maintaining that priority until the completion of the task. This is performed by a soft real time system. The system kernel delays need to be bounded as in the case of hard real time system.
What type of scheduling is there in RTOS?

The tasks of real time operating system have 3 states namely, running, ready, blocked. Only one task per CPU is being performed at a given point of time. In systems that are simpler, the list is usually short, two or three tasks at the most. The designing of scheduler is the real key. Usually to minimize the worst-case length of time spent in the schedulers critical section, the data structure of the ready list in the scheduler is designed. This is done during the inhibition of preemption. All interrupts are disabled in certain cases. The data structure choice depends on the tasks on the ready list can perform at the maximum.
What is interrupt latency?

The time between a device that generates an interrupt and the servicing of the device that generated the interrupt is known as interrupt latency. Many operating systems devices are serviced soon after the interrupt handler of the device is executed. The effect of interrupt latency may be caused by the interrupt controllers, interrupt masking, and the methods that handle interrupts of an operating system.
What is priority inheritance?

Priority inversion problems are eliminated by using a method called priority inheritance. The process priority will be increased to the maximum priority of any process which waits for any resource which has a resource lock. This is the programming methodology of priority inheritance. When one or more high priority jobs are blocked by a job, the original priority assignment is ignored and execution of critical section at the highest priority level of jobs it blocks is performed. The job returns to the original priority level soon after executing the critical section. This is the basic idea of priority inheritance protocol.
What is spin lock?

In a loop a thread waits simply (spins) checks repeatedly until the lock becomes available. This type of lock is a spin lock. The lock is a kind of busy waiting, as the threads remains active by not performing a useful task. The spin locks are to release explicitly, although some locks are released automatically when the thread blocks.
What is an operating system? What are the functions of an operating system?
An operating system is an interface between hardware and software. OS is responsible for managing and co-ordinating the activities of a computer system. Functions of an operating system: Every operating system has two main functions 1. Operating system makes sure that the data is saved in the required place on the storage media. Programs are loaded into the memory properly, and the file system of OS will keep the files in the order. 2. OS enables the hardware and software to interact and perform functionality like, printing, scanning, mouse operations, web cam operations. OS allows application softwares to interact with the hardware.

What is paging? Why paging is used?

Paging is a memory management technique in which the memory is divided into fixed size pages. Paging is used for faster access to data. When a program needs a page, it is available in the main memory as the OS copies a certain number of pages from your storage device to main memory. Paging allows the physical address space of a process to be noncontiguous.
OS performs an operation for storing and retrieving data from secondary storage devices for use in main memory. Paging is one of such memory management scheme. Data is retrieved from storage media by OS, in the same sized blocks called as pages. Paging allows the physical address space of the process to be non contiguous. The whole program had to fit into storage contiguously. Paging is to deal with external fragmentation problem. This is to allow the logical address space of a process to be noncontiguous, which makes the process to be allocated physical memory.

Difference between a process and a program


- A program is a set of instructions that are to perform a designated task, where as the process is an operation which takes the given instructions and perform the manipulations as per the code, called execution of instructions. A process is entirely dependent of a program. - A process is a module that executes modules concurrently. They are separate loadable modules. Where as the program perform the tasks directly relating to an operation of a user like word processing, executing presentation software etc.

What is the meaning of physical memory and virtual memory?

Physical memory is the actual real memory used in RAM. Virtual memory as the name suggests is not real. The OS uses virtual memory as a memory management technique in which non-contiguous memory is presented to software as contiguous memory. If the RAM falls short of memory to accommodate more running processes, the OS allocates a portion of your hard drive to act as though it were RAM. That's what is referred to as virtual memory.
Physical memory is the only memory that is directly accessible to the CPU. CPU reads the instructions stored in the physical memory and executes them continuously. The data that is operated will also be stored in physical memory in uniform manner. Virtual memory is one classification of memory which was created by using the hard disk for simulating additional RAM, the addressable space available for the user. Virtual addresses are mapped into real addresses.

What is the difference between socket and pipe?

A socket is a part of the OSI model that enables communication between different layers. Pipes are used in processing in the CPU. Communication in socket is bi directional while its unidirectional in pipes. Pipes increase productivity By processing multiple processes simultaneously.
Sockets: Socket is a part of OSI layer model. Communication among different layers is performed through sockets. Application layer serves through some sockets to the presentation layer and upper application layer. Sockets are used in Secure Socket Layer networks. Communication is in bi-directional in sockets. Pipes: Pipes are related to processing in CPU. Pipes are the segments for processes in execution. By processing multiple processes simultaneously, the productivity can be improved. Communication is uni-directional in pipes.

What are the difference between THREAD, PROCESS and TASK?


A program in execution is known as process. A program can have any number of processes. Every process has its own address space.

Threads uses address spaces of the process. The difference between a thread and a process is, when the CPU switches from one process to another the current information needs to be saved in Process Descriptor and load the information of a new process. Switching from one thread to another is simple. A task is simply a set of instructions loaded into the memory. Threads can themselves split themselves into two or more simultaneously running tasks.

Difference between NTFS and FAT32

NTFS of New Technology File System is a high performance and secured file system as compared to FAT32 or File Allocation Table. NTFS is more reliable and has better disk utilization. FAT32 is designed for small disks and folder structures.
Difference between NTFS and FAT32
The differences are as follows: NTFS: - Allows the access local to Windows 2000, Windows 2003, Windows NT with service pack 4 and later versions may get access for some file. - Maximum partition size is 2TB and more. - Maximum size of file is upto 16TB - File and folder encryption is possible. FAT 32: - Allows the access local to Windows 95, Windows 98, Windows ME, Windows 2000, Windows xp on local partition. - Maximum partition size is 2TB - Maximum size of file is upto 4GB - File and folder encryption is not possible.

Differentiate between RAM and ROM

RAM is Random Access Memory that is volatile in nature. This means that when the system is turned OFF, the contents are wiped. ROM is Read Only Memory in which once content is written, persists.
RAM: - Volatile memory - Electricity needs to flow continuously - Program information is stored in RAM - RAM is read / write memory - Cost is high ROM: - Permanent memory - Instructions are stored in ROM permanently. - BIOS has information to boot the system - ROM is read only memory - Access speed is less

What is DRAM? In which form does it store data?

DRAM or Dynamic Random Access memory stores data in the form of 0s and 1s. The processor can access any part of memory randomly. It is called dynamic because it is refreshed every few milliseconds unlike RAM which is refreshed only when the POWER is OFF.
DRAM Dynamic Random Access Memory. One of the read / write memory. DRAM is cheap and does the given task. DRAM has cells made up of a capacitor and a transistor, where the data resides. Capacitors need to recharge for every couple of milliseconds. The process of recharging cells tends to performance slow down of DRAM as compared with speedier RAM types.

What is cache memory? Explain its functions.

Cache memory is a high speed memory in the CPU that is used for faster access to data.

It provides the processor with the most frequently requested data. Cache memory increases performance and allows faster retrieval of data.
Cache memory is RAM. The most recently processing data is stored in cache memory. CPU can access this data more quickly than it can access data in RAM. When the microprocessor starts processing the data, it first checks in cache memory. The size of each cache block ranges from 1 to 16 bytes. Every location has an index that corresponds to the location which has data to access. This index is known as address. The locations have tags; each contains the index and the datum in the memory that is needed to be cached.

Differentiate between Complier and Interpreter

A complier converts the programming language code to machine readable form during compilation. An interpreter converts each line of code to machine format at run time. A complier is more used and efficient as it produces a complete machine language program, which can then be executed.
- The program syntax is checked by the compiler; where as the keywords of the program is checked by the interpreter. - The complete program is checked by the compiler, where as the interpreter checks simultaneously in the editor. - Color coding is provided to the program by the interpreter, and enables self debugging while authoring a program. - Interpreter converts each source code line into machine code and executes on the fly. - Compiler takes more time for analyzing and processing the program, where as the interpreter takes very less time for analyzing and processing the program

Describe different job scheduling in operating systems.

Job scheduling schedules or decides which process will get to acquire the resource based on some parameters. FIFO- The process that comes first is executed first. Shortest job First- The time taken to complete the job of all processes is computed and the shortest length process is executed first. Round Robin- Each process gets a time share for running and is later prevented to get the next process running. Priority scheduling- here, the process on highest priority gets the resource.
Job scheduling is an activity for deciding the time for a process to receive the resources they request. First Come First Served: In this scheduling, the job that is waiting for a long time is served next. Round Robin Scheduling: A scheduling method, in which every process gets a time slice for running and later it is preempted and the next process gets running. This process is known as time sharing, which provides the effect of all the processes running at the same time. Shortest Job First: It is a non-preemptive scheduling, in which the jobs were chosen which will execute in the shortest possible time. Priority Scheduling: A scheduling method which assigns the highest priority process is assigned to the resource.

What is a Real-Time System?

Real time systems respond to inputs immediately. For example a mobile phone sends an email as soon as a phone call is made. They are called as real time because they behave and respond as though in real life.
Real-time system is the study of hardware and software, which are subject to the operational deadlines from event to the system response. A real-time systems application can be considered as mission critical. The deadlines are relative to their events. Regardless of system load, a real system must be met.

What do you mean by deadlock?

When two or more processes wait for a resource to be freed which is controlled by another process, a deadlock situation occurs. It usually occurs in a multiprocessing environment. Example, one client application needs access to a table to acquire a lock which is held by another client application that in turn may attempt to obtain the lock that is held by the first application.
Dead lock is a situation of two or more processes waiting for each other to finish their tasks. In this situation no progress or no advancement is made. It is a standstill resulting from two evenly matched processes, which are waiting in cyclic configuration.

Difference between Primary storage and secondary storage

Primary memory is the main memory (RAM) where the operating system resides. Secondary memory can be external devices like CD; floppy magnetic discs etc. secondary storage cannot be directly accessed by the CPU and is also external memory storage.
- Primary memory storages are temporary; whereas the secondary storage is permanent. - Primary memory is expensive and smaller, where as secondary memory is cheaper and larger - Primary memory storages are faster, where as secondary storages are slower. - Primary memory storages are connected through data buses to CPU, where as the secondary storages are connect through data cables to CPU

You might also like