0% found this document useful (0 votes)
24 views1 page

The Final

Uploaded by

arasivedhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

The Final

Uploaded by

arasivedhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

PROCESS SYNCHRONIZATION Signal The signal operation increments the Types of Operating System OOD DESIGN

SOFTWARE value of its argument S.


Histroy of os Features of Operating Several synchronization mechanisms are signal(S) (OS) Encapsulation is the bundling of data Encapsulatiom #include <iostream> #include <iostream>. Abstraction
Operating systems have been evolving (attributes) and methods (functions) that
through the years. In the 1950s, computers
System available to provide cooperation and {
operate on the data into a single unit called a
using namespace std;
class Car {
#include <string>
using namespace std;
Here is a list important features of OS: communication among S++; Following are the popular types of OS private: class Animal {
were limited to running one program at a class. It restricts direct access to some of the
Protected and supervisor mode processes. } (Operating System): int speed; public:
time like a calculator, but later in the object’s components, which is a means of double fuelLevel; virtual string makeSound() const = 0; // Pure virtual
Allows disk access and file systems Device The common element in all synchronization Types of Semaphores Batch Operating System
following decades, computers began to preventing accidental interference and Public: function
drivers schemes is to allow a process to finish work There are two main types of semaphores i.e. Some computer processes are very lengthy Car() : speed(0), fuelLevel(100.0) {} };
include more and more software programs, misuse of the data.
Networking Security on a critical counting semaphores and binary and time-consuming. To speed the same void accelerate(int amount) { class Dog : public Animal {
sometimes called libraries, that formed the Abstraction speed += amount; public:
Program Execution part of the program before other processes semaphores. Details about process, a job with a similar type of needs
basis for todays operating systems. Abstraction involves hiding the complex fuelLevel -= amount * 0.1; string makeSound() const override {
Memory management Virtual Memory have access to it. This is applicable both to these are given as follows: are batched together and run as a group. } return "Bark";
implementation details and showing only
Multitasking multiprocessors Counting Semaphores The user of a batch operating system never void brake() { }
The first Operating System was created by the essential features of the object. This speed = 0; };
Handling I/O operations and to two or more processes in a These are integer value semaphores and directly interacts with the computer. In this
General Motors in 1956 to run a single IBM helps in managing complexity by allowing } class Cat : public Animal {
Manipulation of the file system single-processor (time-shared) processing have an unrestricted value domain. These type of OS, every user prepares his or her void refuel(double amount) { public:
mainframe computer, its name was the IBM the designer to focus on the interactions at a
Error Detection and handling system. It is called a semaphores are used job on an offline device like a punch card fuelLevel += amount; string makeSound() const override {
704. IBM was the first computer higher level. } return "Meow";
Resource allocation critical region because it is a critical section to coordinate the resource access, where the and submit it to the computer operator.
manufacturer to develop operating systems Inheritance void display() { }
Information and Resource Protection and its execution must be handled as a unit. semaphore count is the number of available Multi-Tasking/Time-sharing Operating cout << "Speed: " << speed << ", Fuel Level: " << };
and distribute them in its computers in the Inheritance is a mechanism where a new
Synchronization is sometimes implemented resources. If the systems fuelLevel << endl;
1960s. JOB SCHEDULER as a lock-and-key arrangement: Before a resources are added, semaphore count Time-sharing operating system enables
class inherits properties and behaviors }
int main() {
Animal* dog = new Dog();
Following is the timeline about Operating Generally A user views a job either as a (methods) from an existing class. This }; Animal* cat = new Cat();
process can work automatically incremented and if the people located at a different terminal(shell) int main() { cout << dog->makeSound() << endl;
System evaluation: series of global job steps—compilation, promotes code reuse and establishes a
on a critical region, it must get the key. And resources are removed, the to use a single computer system at the same Car myCar; cout << cat->makeSound() << endl;
Stanford Research Institute developed the loading and execution. natural hierarchy between classes myCar.accelerate(10); delete dog;
once it has the key, all other processes are count is decremented. time. The processor time (CPU) which is
oN-Line System (NLS) in the late 1960s, Therefore, each job (or program) passes Polymorphism myCar.brake(); delete cat;
locked out until Binary Semaphores shared among multiple users is termed as myCar.refuel(20); return 0;
which was the first operating system that through a hierarchy of managers. Polymorphism allows objects of different
it finishes, unlocks the entry to the critical The binary semaphores are like counting time sharing. myCar.display(); }
resembled the desktop operating system we First one it encounters is the Job Scheduler; classes to be treated as objects of a common return 0;
region, and returns the key so that another semaphores but their value is restricted to 0 Real time OS
use today. this is also called the high-level scheduler. super class. It enables a single interface to } Output
process can get the and 1. The wait A real time operating system time interval Output Bark
Microsoft bought QDOS (Quick and Dirty It is only concerned with selecting jobs represent different underlying data types
key and begin work.Several locking operation only works when the semaphore to process and respond to inputs is very Speed: 0, Fuel Level: 119 Meow
Operating System) in 1981 and branded it as from a queue of incoming jobs and placing and allows methods to use objects of
mechanisms have been developed, including is 1 and the signal operation succeeds when small. Examples: Military Software
Microsoft Operating System (MS-DOS). As them in the various types. #include <iostream>. Composition #include <iostream>. Polymorphisam
1. test-and-set semaphore is 0. Systems, Space Software Systems are the #include <string>
of 1994, Microsoft had stopped supporting process queue, whether batch or interactive, Composition #include <vector>
2. WAIT and SIGNAL It is sometimes easier to implement binary Real time OS example. #include <string> using namespace std;
MS-DOS. based on each job‘s characteristics. Composition is a design principle where a class Animal {
3. Semaphores. semaphores than counting semaphores. Distributed Operating System using namespace std; public:
Unix was developed in the mid-1960s by The Job Scheduler‘s goal is to put the jobs class is composed of one or more objects of class Book {
Semaphores Advantages of Semaphores Distributed systems use many processors virtual string makeSound() const = 0; // Pure virtual function
the Massachusetts Institute of Technology, in a sequence that will use all of the other classes, rather than inheriting from private: };
Semaphores are integer variables that are Some of the advantages of semaphores are located in different machines to provide string title; class Dog : public Animal {
AT&T Bell Labs, and General Electric as a system‘s resources them. This promotes flexibility and
used to solve the critical section problem by as follows: very fast computation to its users. string author; public:
joint effort. Initially it was named as fully as possible. reusability. public: string makeSound() const override {
using two atomic Semaphores allow only one process into the Network Operating System return "Bark";
MULTICS, which stands for Multiplexed The Job Scheduler strives for a balanced Examples code below Book(string title, string author) : title(title),
operations, wait and signal that are used for critical section. They follow the mutual Network Operating System runs on a server. author(author) {} }
Operating and Computing System. mix of jobs that require large amounts of process synchronization. exclusion It provides the capability to serve to manage string getTitle() const {
};
class Cat : public Animal {
FreeBSD is also a popular UNIX derivative, I/O interaction The definitions of wait and signal are as principle strictly and are much more data, user, groups, security, application, and return title; public:
originating from the BSD project at and jobs that require large amounts of } std::string getAuthor() const { string makeSound() const override {
follows − efficient than some other methods of other networking functions. return author; return "Meow";
Berkeley. All modern Macintosh computers computation. Wait synchronization. Mobile OS } }
run a modified version of FreeBSD (OS X). Its goal is to keep most components of the The wait operation decrements the value of There is no resource wastage because of Mobile operating systems are those OS }; };
void animalSound(const Animal& animal) {
Windows 95 is a consumer-oriented computer system busy most of the time. its argument S, if it is positive. If S is busy waiting in semaphores as processor which is especially that are designed to cout << animal.makeSound() << endl;
class Library {
graphical user interface-based operating If the Job Scheduler selected several jobs to negative or zero, then time is not power smartphones, tablets, and wearables private:
}
int main() {
system built on top of MS-DOS. It was run and they had a lot of I/O (I/O bound no operation is performed. wasted unnecessarily to check if a condition devices. vector<Book> books; Dog dog;
released on August 24, 1995 by Microsoft jobs), then wait(S) is fulfilled to allow a process to access the Cat cat;
public: animalSound(dog); // Outputs: Bark
as part of its Windows 9x family of the I/O devices would be kept very busy. { critical void addBook(const Book& book) { animalSound(cat); // Outputs: Meow
operating systems. The CPU might be busy handling the I/O, so while (S<=0); section. books.push_back(book); return 0;
Solaris is a proprietary Unix operating system originally } }
developed by Sun Microsystems in 1991. After the Sun acquisition
little S- -; Semaphores are implemented in the Output
by Oracle in 2010 it was renamed Oracle Solaris.
computation might get done. } machine independent code of the Microsoft void listBooks() const { Bark
Mela
for (const auto& book : books) {

Virtual Memory Offers lesser hard drive space for your use. 1.What is an Operating System? PROCESS SCHEDULER
Virtual Memory is a storage mechanism which It reduces system stability. An Operating System (OS) is After a job has been placed on the READY
offers user an illusion of having a very big main It allows larger applications to run in systems system software that manages computer queue by the Job Scheduler, the Process
memory. It is done by treating a part of that don’t offer enough physical RAM alone to hardware, software resources and provides Scheduler
secondary memory as the main memory. In run them. common services for computer programs. takes over it.
Virtual memory, the user can store processes It doesn’t offer the same performance as RAM. 2. What are the four types of operating system? The Process Scheduler is the low-level
with a bigger size than the available main It negatively affects the overall performance of a Batch Operating System scheduler that assigns the CPU to execute the
memory. system. Multitasking/Time Sharing Operating System processes of
Occupy the storage space, which may be used Multiprocessing Operating system those jobs placed on the READY queue by the
Therefore, instead of loading one long process otherwise for long term data storage. Real Time Operating System Job Scheduler.
in the main memory, the OS loads the various Summary 3. What are the functions of an Operating It determines which jobs will get the CPU,
parts of more than one process in the main Virtual Memory is a storage mechanism which System? when, and for how long. It also decides when
memory. Virtual memory is mostly implemented offers user an illusion of having a very big main Memory Management processing
with demand paging and demand segmentation. memory. Processor Management should be interrupted, determines which queues
Advantages of Virtual Memory Virtual memory is needed whenever your Device Management the job should be moved to during its execution,
Here, are pros/benefits of using Virtual computer doesn’t have space in the physical File Management and recognizes when a job has concluded and
Memory: memory 4. Which is the first operating system in world? should be terminated.
A demand paging mechanism is very much OS/360 officially known as IBM To schedule the CPU, the Process Scheduler
Virtual memory helps to gain speed when only a similar to a paging system with swapping where System/360 Operating System based on batch alternate between CPU cycles and I/O cycles.
particular segment of the program is required processes stored in the secondary memory and processing system developed eby IBM for their Note:
for the execution of the program. pages are loaded only on demand, not in then-new system/360 mainframe computer, In a highly interactive environment, there‘s also
It is very helpful in implementing a advance. announced in 1964, was the first operating a third layer of the Processor Manager called the
multiprogramming environment. Important Page replacement methods are 1) system that was developed. middle-level scheduler.
It allows you to run more applications at once. FIFO 2) Optimal Algorithm 3) LRU Page When the system is over-loaded, the
It helps you to fit many large programs into Replacement. 5. What are the main Operating System? middle-level scheduler finds it is advantageous
smaller programs. In FIFO (First-in-first-out) method, memory The Windows, OS X and Linux logos. to remove
Common data or code may be shared between selects the page for a replacement that has been The Windows GUI. active jobs from memory to reduce the degree of
memory. in the virtual address The OS X GUI. multiprogramming, which allows jobs to be
Process may become even larger than all of the of the memory for the longest time. 6. What is Memory Management? completed faster.
physical memory. The optimal page replacement method selects Memory Management is the The jobs that are swapped out and eventually
Data / code should be read from disk whenever that page for a replacement for which the time to process of controlling and coordinating swapped back in are managed by the
required. the next reference is the longest. computer memory, assigning portions called middle-level
The code can be placed anywhere in physical LRU method helps OS to find page usage over a blocks to various running programs to optimize scheduler.
memory without requiring relocation. short period of time. overall system performance. Memory In a single-user environment, there‘s no
More processes should be maintained in the Virtual memory helps to gain speed when only a management resides in hardware, in the OS distinction made between job and process
main memory, which increases the effective use particular segment of the program is required for (Operating System), and in programs and scheduling
of CPU. the execution of the program. applications. because only one job is active in the system at
Each page is stored on a disk until it is required Applications may run slower if the system is 7. What is most commonly used memory any given Time
after that, it will be removed. using virtual memory. management technique?
It allows more applications to be run at the same Paging is a technique in the main
time. memory of computer system is organized in the
There is no specific limit on the degree of form of equal sized blocks called pages. In the
multiprogramming. technique, the address of occupied pages of
Large programs should be written, as virtual physical memory are stored in a table, its known
address space available is more compared to as page table.
physical memory. 8. What is virtual memory with example?
Disadvantages of Virtual Memory An imaginary memory area
Here, are drawbacks/cons of using virtual supported by some operating systems (for
memory: examples, windows but not DOS) in
conjunction with the hardware. The purpose of
Applications may run slower if the system is virtual memory is to enlarge the address space,
using virtual memory. the set of addresses a program can utilize.
Likely takes more time to switch between Example, virtual memory might
applications. contain twice as many

You might also like