Semaphores

For the solution to the critical section problem one synchronization tool is used which is known as semaphores. A semaphore ‗S‘ is an integer variable which is accessed through two standard operations such as wait and signal. These operations were originally termed ‗P‘ (for wait means to test) and ‗V‘ (for single means to increment). […]

Critical Section Problem

Consider a system consisting of n processes (P0, P1, ………Pn -1 ) each process has a segment of code which is known as critical section in which the process may be changing common variable, updating a table, writing a file and so on. The important feature of the system is that when the process is […]

Operating System Services

An operating system provides an environment for the execution of the program. It provides some services to the programs. The various services provided by an operating system are as follows: Program Execution: The system must be able to load a program into memory and to run that program. The program must be able to terminate […]

virtual machines OS

Virtual Machines

By using CPU scheduling & virtual memory techniques an operating system can create the illusion of multiple processes, each executing on its own processors & own virtual memory. Each processor is provided a virtual copy of the underlying computer. The resources of the computer are shared to create the virtual machines. CPU scheduling can be […]

System structure

Simple structure There are several commercial system that don‘t have a well- defined structure such operating systems begins as small, simple & limited systems and then grow beyond their original scope. MS-DOS is an example of such system. It was not divided into modules carefully. Another example of limited structuring is the UNIX operating system. […]

System Programs

System programs provide a convenient environment for program development & execution. They are divided into the following categories. File manipulation: These programs create, delete, copy, rename, print & manipulate files and directories. Status information: Some programs ask the system for date, time & amount of available memory or disk space, no. of users or similar […]

System Calls

System calls provide the interface between a process & the OS. These are usually available in the form of assembly language instruction. Some systems allow system calls to be made directly from a high level language program like C, BCPL and PERL etc. systems calls occur in different ways depending on the computer in use. […]

Basic Functions of Operation System

The various functions of the operating system are as follows: 1. Process Management: A program does nothing unless its instructions are executed by a CPU. A process is a program in execution. A time-shared user program such as a compiler is a process. A word processing program being run by an individual user on a […]

Write a C program to read name and marks of n number of students from user and store them in a file. If the file previously exits, add the information of n students

#include <stdio.h> int main() { char name[50]; int marks, i,n; printf(“Enter number of students”); scanf(“%d”, &n); FILE *fptr; fptr=(fopen(“C:\\student.txt”,”a”)); if (fptr==NULL){ printf(“Error!”); exit(1); } for(i=0;i<n;++i) { printf(“For student%d\nEnter name: “,i+1); scanf(“%s”,name); printf(“Enter marks”); scanf(“%d”, &marks); fprintf(fptr, “\nName: %s\nMarks=%d\n”, name, marks); } fclose(fptr); Return 0; } The fclose function causes the stream pointed to be flushed […]