Unit - 1
Introduction
Q1) What is Parallel System of an operating system?
A1)
- Parallel Processing Systems are intended to accelerate the execution of programs by isolating the program into numerous pieces and processing those fragments simultaneously.
- Such systems are multiprocessor systems called as tightly coupled systems.
- Parallel systems manage the synchronous utilization of numerous computer resources that can incorporate a single computer with various processors, various computers associated by a network to frame a parallel processing cluster or a blend of both.
- Parallel systems are harder to program than computers with a single processor in light of the fact that the engineering of parallel computers fluctuates appropriately and the procedures of numerous CPUs must be composed and synchronized.
- A few models for interfacing processors and memory modules exist, and every topology requires an alternate programming model.
- The three models that are most regularly utilized in structuring parallel computers incorporate synchronous processors each with its very own memory, asynchronous processors each with its own memory and asynchronous processors with a typical, shared memory.
- Parallel operating systems are essentially worried about dealing with the resources of parallel machines.
- This task faces numerous difficulties: application software engineers request all the performance possible, numerous equipment configurations exist and change all around quickly, yet the operating system should progressively be good with the standard adaptations utilized in computers.
- Today, new applications emerge and request faster computers. Business applications are the most utilized on parallel computers.
- A computer that runs such an application; ought to have the option to process enormous amount of data in modern ways. These applications incorporate designs, virtual reality, and decision support, parallel databases, medical diagnosis, etc.
- We can say with almost certainly that business applications will characterize future parallel computers design however scientific applications will stay significant users of parallel processing innovation.
Q2) Explain Time Sharing System of an operating system.
A2)
- Time-sharing systems are not accessible in 1960s.
- Time-sharing or performing multiple tasks is a legitimate expansion of multiprogramming. That is processors time is shared among numerous users at the same time is called time-sharing.
- The primary contrast between Multi-programmed Batch Systems and Time-Sharing Systems is, in Multi-programmed batch systems its goal is expand processor use, while in Time-Sharing Systems its goal is minimize response time.
- Numerous jobs are executed by the CPU by switching between them, however the switches happen in such a less time, so that the user can gets a prompt response.
- For instance, in a transaction processing, processor execute every user program in a short burst or quantum of calculation.
- That is if n users are available, every user can get time quantum.
- At the point when the user presents the instruction, the response time is seconding all things considered.
- Operating system utilizes CPU scheduling and multiprogramming to give every user a little part of a time.
- Computer systems that were structured essentially as batch systems have been altered to time-sharing systems.
- For instance, IBM's OS/360.
Time-Sharing Operating System
- As the name itself recommends, in a time-sharing system or performing various tasks system, different jobs can be executed on a system simultaneously by sharing the CPU time among them.
- It is viewed as a logical expansion of multiprogramming on the grounds that the two does synchronous execution yet vary in their prime aims.
- The fundamental goal of time-sharing systems is to limit reaction time yet not boosting the processor use (which is the target of multiprogramming systems).
- The time-sharing systems were created to give an intuitive utilization of the computer system.
- A time-shared system utilizes CPU planning and multiprogramming to give every user a little segment of a period shared computer.
- It enables numerous users to share the computer resources all the while. As the system switches quickly from one user to the next, a brief timeframe opening is given to every user for their executions.
- The time-sharing operating system guarantees that every one of the assignments get the chance to get to the CPU individually and for a fixed little interval of time. This interval is known as the time quantum.
- E.g.: Unix Systems
Advantages of Time-Sharing OS:
- Each user gets an equivalent chance
- Less chances of duplication of programming
- CPU inert time can be diminished
Disadvantages of Time-Sharing OS:
- Unwavering quality issue
- One must need to deal with security and respectability of user programs and information.
- Information correspondence issue
Fig 1. Time-Sharing Operating System
Q3) Explain Multi programmed Batch System of an operating system.
A3)
- This sort of OS is utilized to execute more than one job at the same time by a single processor.
- It builds CPU by sorting out jobs with the goal that the CPU consistently has one job to execute.
- The idea of multiprogramming is depicted as pursues:
- Every one of the jobs that enter the system are kept in the job pool (in a disk). The operating system stacks a lot of jobs from job pool into main memory and starts to execute.
- During execution, the job may need to wait for some task, for example, an I/O operation, to finish. In a multiprogramming system, the operating system basically changes to another activity and executes. At the point when that job needs to wait, the CPU is changed to another job, etc.
- At the point when the first job completes the process of waiting and it recovers the CPU.
- For whatever length of time that in any event one job needs to execute, the CPU is never idle.
- Multiprogramming operating systems utilize the component of job scheduling and CPU scheduling.
Q4) Explain the types of OS?
A4) Types of Operating system
● Batch Operating System
● Multitasking/Time Sharing OS
● Multiprocessing OS
● Real Time OS
● Distributed OS
● Network OS
● Mobile OS
Batch Operating System
Some computer processes are very lengthy and time-consuming. To speed the same process, a job with a similar type of needs are batched together and run as a group.
The user of a batch operating system never directly interacts with the computer. In this type of OS, every user prepares his or her job on an offline device like a punch card and submit it to the computer operator.
Multi-Tasking/Time-sharing Operating systems
Time-sharing operating system enables people located at a different terminal(shell) to use a single computer system at the same time. The processor time (CPU) which is shared among multiple users is termed as time sharing.
Real time OS
A real time operating system time interval to process and respond to inputs is very small. Examples: Military Software Systems, Space Software Systems.
Distributed Operating System
Distributed systems use many processors located in different machines to provide very fast computation to its users.
Network Operating System
Network Operating System runs on a server. It provides the capability to serve to manage data, user, groups, security, application, and other networking functions.
Mobile OS
Mobile operating systems are those OS which is especially that are designed to power smartphones, tablets, and wearables devices.
Some most famous mobile operating systems are Android and iOS, but others include BlackBerry, Web, and watchOS.
Q5) What are the services provided by OS?
A5)
An OS provides services to each the users and to the programs.
- It provides programs Associate in Nursing atmosphere to execute.
- It provides users the services to execute the programs during a convenient manner.
Following square measure many common services provided by Associate in Nursing OS Associate in Nursing
- Program execution
- I/O operations
- File System manipulation
- Communication
- Error Detection
- Resource Allocation
- Protection
Program execution
Operating systems handle several styles of activities from user programs to system programs like printer spooler, name servers, digital computer, etc. every of those activities is encapsulated as a method.
A method includes the entire execution context (code to execute, knowledge to govern, registers, OS resources in use). Following square measure, the foremost activities of Associate in Nursing OS with relevancy program management −
- Loads a program into memory.
- Executes the program.
- Handles program's execution.
- Provides a mechanism for method synchronization.
- Provides a mechanism for method communication.
- Provides a mechanism for impasse handling.
I/O Operation
An I/O scheme includes of I/O devices and their corresponding driver code. Drivers hide the peculiarities of specific hardware devices from the users.
- An OS manages the communication between user and device drivers.
- I/O operation suggests that scan or write operation with any file or any specific I/O device.
- Operating system provides the access to needed|the specified|the desired} I/O device once required.
File system manipulation
A file represents a group of connected data. Computers will store files on the disk (secondary storage), for long-run storage purpose. Samples of storage media embody mag tape, disk and storage device drives like CD, DVD. Every of those media has its own properties like speed, capacity, knowledge transfer rate and knowledge access strategies.
A classification system is often organized into directories for simple navigation and usage. These directories could contain files and alternative directions. Following square measure, the foremost activities of Associate in Nursing OS with relevancy file management −
- Program must scan a file or write a file.
- The OS offers the permission to the program for operation on file.
- Permission varies from read-only, read-write, denied so on.
- Operating System provides Associate in Nursing interface to the user to create/delete files.
- Operating System provides Associate in Nursing interface to the user to create/delete directories.
- Operating System provides Associate in Nursing interface to form the backup of classification system.
Communication
In case of distributed systems that square measure a group of processors that don't share memory, peripheral devices, or a clock, the OS manages communications between all the processes. Multiple processes communicate with each other through communication lines within the network.
The OS handles routing and association ways, and therefore the issues of competition and security. Following square measure the foremost activities of Associate in Nursing OS with relevancy
- Two processes usually need knowledge to be transferred between them
- Both the processes may be on one pc or on totally different computers, however square measure connected through a electronic network.
- Communication could also be enforced by 2 strategies, either by Shared Memory or by Message Passing.
Error handling
Errors will occur anytime and anyplace. a mistake could occur in computer hardware, in I/O devices or within the memory hardware. Following square measure, the foremost activities of Associate in Nursing OS with relevancy error handling −
- The OS perpetually checks for potential errors.
- The OS takes Associate in Nursing applicable action to make sure correct and consistent computing.
Resource Management
In case of multi-user or multi-tasking atmosphere, resources like main memory, computer hardware cycles and files storage square measure to be allotted to every user or job. Following square measure, the foremost activities of Associate in Nursing OS with relevancy resource management −
- The OS manages every kind of resources victimisation scheduler.
- Computer hardware planning algorithms square measure used for higher utilization of CPU.
Protection
Considering a ADPS having multiple users and multiprogramming of multiple processes, the assorted processes should be shielded from every other's activities.
Protection refers to a mechanism or the way to manage the access of programs, processes, or users to the resources outlined by a ADPS. Following square measure, the foremost activities of Associate in Nursing OS with relevancy
- The OS ensures that each one access to system resources is controlled.
- The OS ensures that external I/O devices square measure shielded from invalid access tries.
- The OS provides authentication options for every user by suggests that of passwords.
Q6) Illustrate the Evolution of OS?
A6) The following is a timeline of an operating system's evolution:
Fig 2: Evolution of OS
Serial Processing
By the 1940s and 1950s, programmers were embedded into hardware components without the use of an operating system. The scheduling and setup time are the issues here. By squandering computational time, the user logs in for machine time. When loading the compiler, saving the compiled programme, source programme, linking, and buffering, setup time is involved. If there is an intermediate error, the process is restarted.
The Batch System
It is used to improve computer utilization and application. On cards and tapes, jobs were scheduled and submitted. Then, using Job Control Language, they were successively executed on the monitors. The first computers employed in the batch operation method created a computer batch of jobs that didn't stop or pause. The software is written on punch cards and then transferred to the tape's processing unit. When the computer finishes one job, it immediately moves on to the next item on the tape. Professional operators are taught how to communicate with the machine where users drop off jobs and then return to pick up the results after the project is completed.
Despite the fact that it is inconvenient for the users, it is designed to keep the pricey computer as busy as possible by running a continuous stream of operations. The memory protection prevents the memory space that makes up the monitor from being changed, and the timer prevents the job from monopolizing the system. When the input and output devices are in use, the processor remains idle due to poor CPU utilization.
Multi-programmed Batch System
It's utilised when there are numerous jobs to run that need to be kept in main memory. The processor choose which application to run based on job scheduling.
Time-Shared Operating System
Substitute batch systems were developed using this method. Like an electric teletype, the user communicated directly with the computer via printing ports. Few users shared the computer instantly, and each job was completed in a fraction of a second before moving on to the next. The fast server may act on a large number of users' processes at the same time by creating iterations while they are receiving full attention. Multiple programmes use timesharing systems to apply to the computer system by sharing the system interactively.
Multiple communicative jobs are managed via multi-programming. The processor's time is divided among numerous users, and multiple users can access the system via terminals at the same time. Programs with the command-line user interface, in which the user has written responses to prompts or written instructions, required printing ports. As if it were a roll of paper, the interaction is scrolled down.
Printing terminals that displayed fixed-size characters were replaced with video terminals. Some are used to create shapes on the screen, but the majority are scrolled like a glass teletype. In the mid-1970s, personal computers became adaptable. The Altair 8800 was the first commercially viable personal computer, and it shocked the business world.
Macintosh Operating System
It was based on decades of research into graphical operating systems and applications for personal computers. The photo depicts a Sutherland pioneer programme sketchpad that was developed in 1960 employing many of the characteristics of today's graphical user interface, but the hardware components cost millions of dollars and took up a room.
After many research gaps, the Macintosh was commercially and fiscally viable thanks to a project on massive computers and hardware improvements. Many research laboratories are still working on research prototypes like sketchpads. It served as the foundation for anticipated products.
Q7) Describe the history of OS?
A7) History of OS
The operating system can be classified into four generations, as follows:
First Generation (1945-1955)
It marks the start of the development of electronic computing systems as a replacement for mechanical computers. Because of the flaws in mechanical computing devices, humans' calculation speed is limited, and they are prone to making mistakes. Because there is no operating system in this generation, the computer system is given instructions that must be carried out immediately.
Plug Boards are an example of a type of operating system and device.
Second Generation (1955-1965)
In the second generation, the batch processing system was implemented, which allows a job or task to be done in a series and then completed sequentially. The computer system in this generation does not have an operating system, although there are various operating system functionalities available, such as FMS and IBSYS.
Batch systems are an example of the type of operating system and devices employed.
Third Generation (1965-1980)
In the third generation, the operating system was designed to service numerous users at the same time. Interactive users can communicate with a computer via an online terminal, making the operating system multi-user and multiprogramming.
Multiprogramming is an example of a type of operating system and devices employed.
Fourth Generation (1980-Now)
The operating system is employed in this age for computer networks where users are aware of the existence of computers connected to one another.
The era of distributed computing has already begun, and users are comforted by a Graphical User Interface (GUI), which is an incredibly comfortable graphical computer interface.
The demand for traditional operating systems has increased as a result of the introduction of new wearable devices such as Smart Watches, Smart Glasses, VRGears, and others.
With the introduction of innovative gadgets such as Smart Watches, Smart Glasses, VR gears, and other wearable devices, the demand for unorthodox operating systems is also increasing.
Personal computers are an example of a type of operating system and device.
Q8) What do you mean by system call?
A8) In an operating system software plays out every one of the following functions:
- Process management: Process management causes OS to create and delete processes. It likewise gives mechanisms for synchronization and communication among processes.
- Memory management: Memory management module plays out the role of assignment and de-allotment of memory space to programs needing the resources.
- File management: It deals with all the file-related task, for example, storage organization, recovery, naming, sharing, and protection of files.
- Device Management: Device management keeps tracks of all the devices. This module is in charge of the task also known as the I/O controller. It additionally plays out the undertaking of designation and de-distribution of the devices.
- I/O System Management: One of the primary objects of any OS is to conceal the identity of that hardware devices from the user.
- Secondary-Storage Management: Systems have a few degrees of storage which incorporates primary storage, secondary storage, and cache storage. Instructions and data must be put away in primary storage or cache so a running program can reference it.
- Security: Security module ensures the data and information of a computer system against malware danger and authorized access.
- Command interpretation: This module is interpreting directions given by the acting system and assign resources to process that directions.
- Networking: A distributed system is a collection of processors which don't share memory, hardware devices, or a clock. The processors speak with each other through the network.
- Job accounting: Keeping track of time and resource utilized by different job and users.
- Communication management: Manage the coordination and task of compilers, interpreters, and other software resource of the different users of the computer systems.
Q9) What are the types of system calls?
A9) System calls are divided into five categories.
Fig 3: Types of system call
The following are the various sorts of system calls:
Process control
Processes such as process creation, process termination, and so on are handled by these system calls.
Functions
● End and Abort
● Load and Execute
● Create Process and Terminate Process
● Wait and Signal Event
● Allocate and free memory
File management
File manipulation is handled by these system calls, which include creating, reading, and writing to files.
Functions
● Create a file
● Delete file
● Open and close file
● Read, write, and reposition
● Get and set file attributes
Device management
Device manipulation, such as reading from device buffers and writing into device buffers, is handled by these system calls.
Functions
● Request and release device
● Logically attach/ detach devices
● Get and Set device attributes
Information maintenance
These system calls control the flow of data between the operating system and the user programme.
Functions
● Get or set time and date
● Get process and device attributes
Communication
These system calls can be used to communicate between processes. They're also in charge of setting up and disabling communication connections.
Functions
● Create, delete communications connections
● Send, receive message
● Help OS to transfer status information
● Attach or detach remote devices
Q10) What are the advantages and disadvantages of Batch Operating System?
A10)
Advantages of Batch Operating System:
- It is exceptionally hard to estimate or realize the time required by any job to finish. Processors of the batch systems realize to what extent the job would be when it is in line.
- Various users can share the batch systems
- The inert time for batch system is extremely less
- It is easy to oversee huge work more than once in batch systems
Disadvantages of Batch Operating System:
- The computer administrators should have complete information with batch systems
- Batch systems are difficult to debug
- It is at some point expense
- Different jobs should sit tight for an obscure time if any jobs fail
Q11) What is a file?
A11) A file is a collection of correlated information which is recorded on secondary or non-volatile storage like magnetic disks, optical disks, and tapes. It is a method of data collection that is used as a medium for giving input and receiving output from that program.
In general, a file is a sequence of bits, bytes, or records whose meaning is defined by the file creator and user. Every File has a logical location where they are located for storage and retrieval.
Objective of File management System
Here are the main objectives of the file management system:
● It provides I/O support for a variety of storage device types.
● Minimizes the chances of lost or destroyed data
● Helps OS to standardized I/O interface routines for user processes.
● It provides I/O support for multiple users in a multiuser systems environment.
File structure
A File Structure needs to be predefined format in such a way that an operating system understands. It has an exclusively defined structure, which is based on its type.
Three types of files structure in OS:
● A text file: It is a series of characters that is organized in lines.
● An object file: It is a series of bytes that is organized into blocks.
● A source file: It is a series of functions and processes.
File Attributes
A file has a name and data. Moreover, it also stores meta information like file creation date and time, current size, last modified date, etc. All this information is called the attributes of a file system.
Here, are some important File attributes used in OS:
● Name: It is the only information stored in a human-readable form.
● Identifier: Every file is identified by a unique tag number within a file system known as an identifier.
● Location: Points to file location on device.
● Type: This attribute is required for systems that support various types of files.
● Size. Attribute used to display the current file size.
● Protection. This attribute assigns and controls the access rights of reading, writing, and executing the file.
● Time, date and security: It is used for protection, security, and also used for monitoring
Q12) Write the properties of the file?
A12) Here, are important properties of a file system:
● Files are stored on disk or other storage and do not disappear when a user logs off.
● Files have names and are associated with access permission that permits controlled sharing.
● Files could be arranged or more complex structures to reflect the relationship between them.
Q13) What are the functions of a file?
A13) Functions of File
● Create a file, find space on disk, and make an entry in the directory.
● Write to file, requires positioning within the file
● Read from file involves positioning within the file
● Delete directory entry, regain disk space.
● Reposition: move read/write position.
Q14) Write the different types of file?
A14) File Type
It refers to the ability of the operating system to differentiate various types of files like text files, binary, and source files. However, Operating systems like MS_DOS and UNIX has the following type of files:
Character Special File
It is a hardware file that reads or writes data character by character, like mouse, printer, and more.
Ordinary files
● These types of files stores user information.
● It may be text, executable programs, and databases.
● It allows the user to perform operations like add, delete, and modify.
Directory Files
● Directory contains files and other related information about those files. Its basically a folder to hold and organize multiple files.
Special Files
● These files are also called device files. It represents physical devices like printers, disks, networks, flash drive, etc.
Q15) Describe the file access method?
A15) Let's look at various ways to access files stored in secondary memory.
Sequential Access
Fig 4: Sequential access
Most of the operating systems access the file sequentially. In other words, we can say that most of the files need to be accessed sequentially by the operating system.
In sequential access, the OS read the file word by word. A pointer is maintained which initially points to the base address of the file. If the user wants to read first word of the file then the pointer provides that word to the user and increases its value by 1 word. This process continues till the end of the file.
Modern word systems do provide the concept of direct access and indexed access but the most used method is sequential access due to the fact that most of the files such as text files, audio files, video files, etc need to be sequentially accessed.
Direct Access
The Direct Access is mostly required in the case of database systems. In most of the cases, we need filtered information from the database. The sequential access can be very slow and inefficient in such cases.
Suppose every block of the storage stores 4 records and we know that the record we needed is stored in 10th block. In that case, the sequential access will not be implemented because it will traverse all the blocks in order to access the needed record.
Direct access will give the required result despite of the fact that the operating system has to perform some complex tasks such as determining the desired block number. However, that is generally implemented in database applications.
Fig 5: Database system
Indexed Access
If a file can be sorted on any of the filed, then an index can be assigned to a group of certain records. However, A particular record can be accessed by its index. The index is nothing but the address of a record in the file.
In index accessing, searching in a large database became very quick and easy but we need to have some extra space in the memory to store the index value.