Skip to document
This is a Premium Document. Some documents on Studocu are Premium. Upgrade to Premium to unlock it.

CSCI 340 Notes

Another class taken notes on various topics.
Course

Operating Systems Principles (CSCI 340)

16 Documents
Students shared 16 documents in this course
Academic year: 2021/2022
Uploaded by:
0followers
11Uploads
2upvotes

Comments

Please sign in or register to post comments.

Preview text

CSCI 340 Operating System

Definition: An Operating System (OS) is a program that manages the computer hardware. It also provides a basis for Application programs and acts as an intermediary between computer Users and computer Hardware. Examples of Operating systems are Windows, Linux, Ubuntu, MacOS X, iOS, Android.

Types of OS: - Batch OS: Batch operating system is an operating system in which the system performs multiple jobs of similar types of functions. This group of multiple jobs with similar tasks is also called a batch. Each batch consists of jobs of the same type like a batch of C++ files, java files, etc. Every job is the collection of programs, input data, and control instruction. One after another batches gest processed inside the CPU. O was very simple and its task was to process jobs one after another. Examples of Batch OS are the Payroll system, Bank Statements, etc.

- Time-Sharing OS: A time-sharing operating system is an operating system that allows many users to share computer resources. In other words, time sharing refers to the allocation of computer resources in time slots to several programs simultaneously. Also known as Multitasking Operating system. The task can be from a single user or different users. The time that each task gets to execute is also called quantum. After the time interval is over OS switches over to the next task. Example: Multics or Unix.

- Distributed OS: In distributed operating system multiple autonomous interconnected computers communicate with each other using a shared communication network. Independent systems possess their own memory and CPU. These are referred to as loosely coupled systems or distributed systems. These systems’ processors differ in size and function. The major benefit of working with these types of operating systems is that it is always possible that one user can access the files or software which are not actually present on his system but some other system that is connected within this network. I. remote access is enabled within the devices connected to that network. Example LOCUS etc.

- Network OS: These systems run on a server and provide the capability to manage data, users, groups, security, applications, and other networking functions. These types of operating systems allow shared access files, printers, security, applications, and other networking functions over a small private network. One more important aspect of Network OS is that all the users are well aware of the underlying configuration, of all other users within the network, their individual connections, etc. and that’s why these computers are popularly known as tightly coupled systems. Examples: MS Window server 2003, 2008, UNIX, Linux, macOS x, Novell, Netware, and BSD, etc.

- Real-Time OS: The time interval required to process and respond to inputs is very small. This time interval is called response time. Real Time Operating systems are used when there are time requirements that are very strict like missile systems, air traffic control systems, robots, etc. There are two types of real-time operating systems.

a- Hard Real-Time Operating System: These OSs are meant for applications where time constraints are very strict and even the shortest possible delay is not acceptable. These systems are built for saving life like automatic parachutes or airbags which are required to be readily available in case of any accident. Virtual memory is rarely found in these systems.

b- Soft Real-Time Operating System: These OSs are meant for applications where time constraints are less strict.

Examples of Real Time Operating Systems are scientific experiments, medical imaging systems, industrial control systems, weapon systems, robots, air traffic control systems, etc.

- Multi Programming/Multi-Processing/Multi-Tasking/Multi-Threading OS: Multi Programming : In a modern computing system, there are usually several concurrent application processes which want to execute. Now it is the responsibility of the Operating System to manage all the processes effectively and efficiently. One of the most important aspects of an Operating System is to multi program.

job and starts executing it. As soon as a job completes its I/O operation and comes back for CPU tasks, the CPU is allocated to it.

  • In this way, no CPU time is wasted by the system waiting for the I/O task to be completed.

Therefore, the ultimate goal of multi-programming is to keep the CPU busy as long as there are processes ready to execute. This way, multiple programs can be executed on a single processor by executing a part of a program at one time, a part of another program after this, then a part of another program, and so on, hence executing multiple programs. Hence, the CPU never remains idle.

Multi-Processing: In a uni-processor system, only one process executes at a time. Multiprocessing is the use of two or more CPUs (processors) within a single Computer system. The term also refers to the ability of a system to support more than one processor within a single computer system. Now since there are multiple processors available, multiple processes can be executed at a time. These multiprocessors share the computer bus, sometimes the clock, memory, and peripheral devices also.

Multiprocessing system’s working – - With the help of multiprocessing, many processes can be executed simultaneously. Say processes P1, P2, P3, and P4 are waiting for execution. Now in a single processor system, firstly one process will execute, then the other, then the other, and so on. - But with multiprocessing, each process can be assigned to a different processor for its execution. If it's a dual-core processor (2 processors), two processes can be executed simultaneously and thus will be two times faster, similarly, a quad-core processor will be four times as fast as a single processor.

Why use multiprocessing – - The main advantage of a multiprocessor system is to get more work done in a shorter period of time. These types of systems are used when very high speed is required to process a large volume of data. Multi processing systems can save money in comparison to single processor systems because the processors can share peripherals and power supplies.

  • It also provides increased reliability in the sense that if one processor fails, the work does not halt, it only slows down. e. if we have 10 processors and 1 fails, then the work does not halt, rather the remaining 9 processors can share the work of the 10th processor. Thus the whole system runs only 10 percent slower, rather than failing altogether.

Multiprocessing refers to the hardware (i., the CPU units) rather than the software (i., running processes). If the underlying hardware provides more than one processor then that is multiprocessing. It is the ability of the system to leverage multiple processors’ computing power.

Difference between Multi programming and Multi processing – - A System can be both multi programmed by having multiple programs running at the same time and multiprocessing by having more than one physical processor. The difference between multiprocessing and multi programming is that Multiprocessing is basically executing multiple processes at the same time on multiple processors, whereas multi programming is keeping several programs in main memory and executing them concurrently using a single CPU only. - Multiprocessing occurs by means of parallel processing whereas Multi programming occurs by switching from one process to other (phenomenon called as context switching).

Multi-Tasking: As the name itself suggests, multi tasking refers to execution of multiple tasks (say processes, programs, threads etc.) at a time. In the modern operating systems, we are able to play MP3 music, edit documents in Microsoft Word, surf the Google Chrome all simultaneously, this is accomplished by means of multi tasking. Multitasking is a logical extension of multi programming. The major way in which multitasking differs from multi programming is that multi programming works solely on the concept of context switching whereas multitasking is based on time sharing alongside the concept of context switching.

Multi tasking system’s working – - In a time sharing system, each process is assigned some specific quantum of time for which a process is meant to execute. Say there are 4

Multi threading is the ability of a process to manage its use by more than one user at a time and to manage multiple requests by the same user without having to have multiple copies of the program.

Multi threading system’s working – Example 1 – - Say there is a web server which processes client requests. Now if it executes as a single threaded process, then it will not be able to process multiple requests at a time. Firstly one client will make its request and finish its execution and only then, the server will be able to process another client request. This is really costly, time consuming and tiring task. To avoid this, multi threading can be made use of. - Now, whenever a new client request comes in, the web server simply creates a new thread for processing this request and resumes its execution to hear more client requests. So the web server has the task of listening to new client requests and creating threads for each individual request. Each newly created thread processes one client request, thus reducing the burden on web server.

Example 2 – - We can think of threads as child processes that share the parent process resources but execute independently. Now take the case of a GUI. Say we are performing a calculation on the GUI (which is taking very long time to finish). Now we can not interact with the rest of the GUI until this command finishes its execution. To be able to interact with the rest of the GUI, this command of calculation should be assigned to a separate thread. So at this point of time, 2 threads will be executing i. one for calculation, and one for the rest of the GUI. Hence here in a single process, we used multiple threads for multiple functionality.

Goals of OS: - Convenience - Efficiency - Both

Functions of OS: - It is an interface between User and Hardware - Allocation of resources - Management of memory, security, etc.

Starting a Computer: In order to start running (whether it is started up or

rebooted), a computer needs to have an initial program to run; called a bootstrap program. When the CPU is started, it branches to a fixed memory location. This hardwired address points to the ROM, which contains a small program called the bootstrap loader (program). This program initializes all aspects of the system, which include locating the operating-system kernel and loading it into memory. The OS then starts the execution of the first process (schedules the first process), and waits for some event to occur.

More Detailed (in class) : ROM, POST, MBR

A process that is in the Ready queue: all that the process needs in order to execute is the control over the CPU.

Interrupts: The interrupt is a signal emitted by hardware or software when a

process or an event needs immediate attention. It alerts the processor to a high-priority process requiring interruption of the current working process. In I/O devices one of the bus control lines is dedicated for this purpose and is called the Interrupt Service Routine (ISR).

When a device raises an interrupt at let’s say process i, the processor first completes the execution of instruction i. Then it loads the Program Counter (PC) with the address of the first instruction of the ISR. Before loading the Program Counter with the address, the address of the interrupted instruction is moved to a temporary location. Therefore, after handling the interrupt the processor can continue with process i+1.

While the processor is handling the interrupts, it must inform the device that its request has been recognized so that it stops sending the interrupt request signal. Also, saving the registers so that the interrupted process can be restored in the future, increases the delay between the time an interrupt is received and the start of the execution of the ISR. This is called Interrupt Latency.

supervised mode only while executing OS routines. It switches to user mode before executing application programs.

System call:

geeksforgeeks/introduction-of-system-call/

Dual Mode Operation: A mode bit, is added to the hardware of the computer to

indicate the current mode. User-mode (1) the operation is done on behalf of the user. System (monitor) -mode (0) the operation is done on behalf of the OS.

Privileged Instruction

I/O instructions

Operating System Components:

javatpoint/components-of-operating-system

Command Interpreter System:

Command Implementation

MS-DOS at a boot time

Terminate and stay resident system call

CI - Multitasking system

Simple Structure

Monolithic Structure

Unix

Modern Structure

Layered Structure

MicroKernel

Windows 10

**- Kernel

  • Executive
  • Environmental subsystems
  • HAL - Hardware Abstraction Layer**

Apple

**- macOS

  • iOS**

Darwin :

Was this document helpful?
This is a Premium Document. Some documents on Studocu are Premium. Upgrade to Premium to unlock it.

CSCI 340 Notes

Course: Operating Systems Principles (CSCI 340)

16 Documents
Students shared 16 documents in this course
Was this document helpful?

This is a preview

Do you want full access? Go Premium and unlock all 11 pages
  • Access to all documents

  • Get Unlimited Downloads

  • Improve your grades

Upload

Share your documents to unlock

Already Premium?
CSCI 340 Operating System
Definition: An Operating System (OS) is a program that manages the computer
hardware. It also provides a basis for Application programs and acts as an
intermediary between computer Users and computer Hardware. Examples of
Operating systems are Windows, Linux, Ubuntu, MacOS X, iOS, Android.
Types of OS:
-Batch OS: Batch operating system is an operating system in which the system
performs multiple jobs of similar types of functions. This group of multiple jobs
with similar tasks is also called a batch. Each batch consists of jobs of the same
type like a batch of C++ files, java files, etc. Every job is the collection of
programs, input data, and control instruction. One after another batches gest
processed inside the CPU. O.S was very simple and its task was to process jobs
one after another. Examples of Batch OS are the Payroll system, Bank
Statements, etc.
-Time-Sharing OS: A time-sharing operating system is an operating system
that allows many users to share computer resources. In other words, time
sharing refers to the allocation of computer resources in time slots to several
programs simultaneously. Also known as Multitasking Operating system. The
task can be from a single user or different users. The time that each task gets to
execute is also called quantum. After the time interval is over OS switches over
to the next task. Example: Multics or Unix.
- Distributed OS: In distributed operating system multiple autonomous
interconnected computers communicate with each other using a shared
communication network. Independent systems possess their own memory and
CPU. These are referred to as loosely coupled systems or distributed systems.
These systems’ processors differ in size and function. The major benefit of
working with these types of operating systems is that it is always possible that
one user can access the files or software which are not actually present on his
system but some other system that is connected within this network. I.e. remote
access is enabled within the devices connected to that network. Example
LOCUS etc.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.