Tit Bits of Operating System

 

Define Operating System.

·        An Operating System can be defined as an interface between user and hardware. It is responsible for the execution of all the processes, Resource Allocation, CPU management, File Management and many other tasks.

·        The purpose of an operating system is to provide an environment in which a user can execute programs in convenient and efficient manner.


Difference between User and Kernel mode.

User Mode

Kernel Mode

In user mode, the application program do not have direct access to system resources. In order to access the resources, a system call must be made. 

In kernel mode, the program has direct and unrestricted access to system resources.

In user mode, only single process fails if an interruption occurs.  

In Kernel mode, the whole operating system might go down if an interruption occurs

User mode is also known as the unprivileged mode, restricted mode, or slave mode.

Kernel mode is also known as the master mode, privileged mode, or system mode.

The mode bit is set to 1 in the user mode

The mode bit is set to 0 in the kernel mode.

 

Mention OS Services.

  • Program execution
  • Control Input/output devices
  • Program creation
  • Error Detection and Response
  • Accounting
  • Security and Protection
  • File Management
  • Communication

Compare and contrast a Program and a Process.


Program

Process

It is a set of instructions that has been designed to complete a certain task.

It is an instance of a program that is being currently executed.

It is a passive entity.

It is an active entity.

It resides in the secondary memory of the system.

It is created when a program is in execution and is being loaded into the main memory.

It requires memory space to store instructions.

It requires resources such as CPU, memory address, I/O during its working.


State the types of system calls.

There are commonly five types of system calls. These are as follows:


Define Batch Operating System.

Users using batch operating systems do not interact directly with the computer. Each user prepares their job using an offline device like a punch card and submitting it to the computer operator. Jobs with similar requirements are grouped and executed as a group to speed up processing. The batch operating system grouped jobs that perform similar functions. These job groups are treated as a batch and executed simultaneously.


Advantages and Disadvantages of Multiprocessor Systems.

Most computer systems are single processor systems i.e they only have one processor. Multiprocessor systems have multiple processors working in parallel that share the computer clock, memory, bus, peripheral devices etc.

 

Advantages:

  • Increased Processing Power: Multiprocessor systems are capable of executing multiple tasks simultaneously, which increases the overall processing power of the system.
  • Improved Performance: By dividing the workload among multiple processors, the system can perform tasks more efficiently, resulting in improved performance.
  • Higher Reliability: In a multiprocessor system, if one processor fails, the remaining processors can take over the workload, improving the reliability of the system.

Disadvantages:

  • Complexity: Multiprocessor systems are more complex than single-processor systems, requiring specialized hardware and software to coordinate the work of multiple processors.
  • Cost: Multiprocessor systems are typically more expensive than single-processor systems due to the additional hardware and software required.

Benefits of Treads.

A thread is a single unit of execution within a process. A process can have multiple threads, each of which can perform a different task.

  • Enhanced throughput of the system
  • Effective Utilization of Multiprocessor system
  • Faster context switch
  • Responsiveness
  • Communication
  • Resource sharing

Define Deadlock.

A Deadlock is a situation where each of the computer process waits for a resource which is being assigned to some another process. In this situation, none of the process gets executed since the resource it needs, is held by some other process which is also waiting for some other resource to be released.

Write short notes about Busy waiting and Spinlock.

Busy wait is a loop in a program that repeatedly checks if a condition is true, without giving up control of the CPU. It is an inefficient way to wait for a condition to become true, as it wastes CPU cycles that could be used for other tasks.

Spinlock is a locking mechanism. It enables a thread to wait for the lock to become ready, i.e., the thread can wait in a loop or spin until the lock is ready. It is only held for a short time, and it is useful in a multiprocessor system. The thread holds the spinlock until it is released after acquiring the lock.

Comments

Popular posts from this blog

Reading input in C using scanf()