0% found this document useful (0 votes)
19 views7 pages

Operating System

Uploaded by

Hamayon Wazir
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)
19 views7 pages

Operating System

Uploaded by

Hamayon Wazir
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/ 7

Boot loader or bootstrap program or bios:

Bios: bios stand for input output system the main task of boot loader is to copy transfer contents from
hard disk to ram.

Polling:

In polling the kernel check all the ports of a system to see if a hardware have been attached usually we
used to set a certain threshold e.g of 15 seconds.

interupt

All the modern operating system are interrupt based os, in which device controller hardware is installed
on each port which trigger or alarm when something is attached or key are typed.

Every device controller has a divice driver installed.

Interrupt has the highest priority in os.

A device controller is a physical part of a computer system that makes sense of the signals going to, and
coming from the CPU for the different input/output devices.

The Device Controller receives the data from a connected device and stores it temporarily in some
special purpose registers (i.e. local buffer) inside the controller. Then it communicates the data with a
Device Driver.

Loss interuped

When sometime the buffer is full it is called loss interuped. So an interrupt which was never handled by
the cpu is interrupt loss

Hardware interrupt are called interrupt but there are also interrupt which is generated by software is
called monitor call.

Trap is an interrupt that is specifically generated for exception handling.

Device controlors has also a small amount of memory called the buffer
Five state of process:

New in this stage the memory resources are given

Ready : in this stage the resources are aready given it is ready for the process

Running: in this stage process uses cpu for executing

Waiting: in running stage if a process request hardware resources then it is in the waiting stage

When resources are given it is once again in the ready stage..

Exit once the process is completed then this stage is called exit or terminate.

System cals are a set of functions provided by the os to access the hardware.

Interrupt vector table: whenever an interrupt happen in os it has a specific id, in the interrupt vector
table, os matches the id and executes the corresponding system call.

Win32 and possex functionality homework.

Character device: any device part of the hardware that read/write data characterly is character divice

Keyboard,Nic

Block: read write data in blocks.

You have two spaces in os, user space and kernel space,

Dual-Mode Operation:

• The dual-mode operation (enabled by the mode bit) ensures the separation of privileges.
Critical system functions run in kernel mode, while user applications run in user mode.

• If a user-mode program tries to perform an illegal operation, such as directly accessing


hardware, an exception is raised, and the operating system handles it.

The mode bit helps the system isolate user-level applications from the sensitive parts of the operating
system (kernel), thereby preventing malicious or faulty user programs from crashing the system or
accessing protected resources.

• Mode bit = 0 typically indicates kernel mode.

• Mode bit = 1 indicates user mode.


• • When a user program makes a system call (like requesting to read a file), the CPU
switches from user mode to kernel mode by changing the mode bit.
• • Once the system call completes, the CPU switches back to user mode, restoring the
restricted privileges of the user application.

Synchronous i/o:

Operation: In synchronous I/O, the program initiates an I/O operation (such as reading a file or
sending a message) and then waits until the operation is complete before proceeding with the next
instruction. During this time, the CPU remains idle and cannot execute other tasks.

Blocking: The calling thread is blocked while waiting for the I/O operation to finish. The program
cannot continue executing until the data has been fully transferred.

Asynchronous I/O (Non-blocking I/O):

• Operation: In asynchronous I/O, the program initiates an I/O operation and immediately
continues with other tasks without waiting for the operation to finish. The program is notified
(via a callback or an event) when the I/O operation completes, at which point it processes the
result.

• Non-blocking: The calling thread is not blocked and can continue executing other code while the
I/O operation is handled in the background by the operating system or another thread.

Comparison Table:

Aspect Synchronous I/O Asynchronous I/O

Blocking Yes (blocking) No (non-blocking)

Execution Flow Waits for I/O to complete Continues execution immediately

Complexity Simple to implement and understand More complex, requires event handling

Performance Lower, as the CPU is idle during wait Higher, CPU can perform other tasks

Use Case Suitable for simple applications Ideal for high-performance or real-time systems

DMA: direct memory access

Normal working is that data is bring to memory from harddisk and then it’s processed segment wise.
The cpu process 4kb /s in every type of data.

Graphic card like devices bypass the cpu they directly process from ram because they have their own
processors.

How does dma make our computer fast?

Since the data is processed parallel to cpu this makes our computer fast.

How does dma works.?

Can we use dma for those devices that doesn’t have their own processors. ?

Dma is the mechanism of bypassing the cpu and directly processing the data from ram. These devices
needs to have their own processor.

System call: system calls are functions that directly interact with the hardware normally programmers
use api to interact with the system call. By api you means sugar coated methods.

Storage heriarchy: magnatic tape → magnatic disk → optical disk → SSD’s → Ram→ cache → registers

Cache memory:

Cache memory serve as a bridge between ram and cpu. Cpu always check an instruction in cache
memory before executing it, if an instruction is not found in cache we bring the complete tab from ram
cache. For the rest of the instructions in tab , they will be found in cache

Describe the working working of cache memory?

How does the use of cache memory make the computer fast?

What is cache miss and cache hit?

If an instruction is found in cache it is a cache hit. If an instruction is not found it is called as cache miss.

Multiprogramming : Executing more than one program at a time is called multi programming all modern
os are multiproramme in nature.

Timesharing: In timesharing system we divide the time between different processes to achieve
multiprogramming.

If we divide one second on 4 process , each process will take 250 ms.,

On a single processer system we will get the impression of multiprogramming.


It allocate the time based on priority bases.

Services provide by the OS:

Process management: in process management we have process creation and processs deleting ,
multithreading,allocating and retreivig back the resources to process, managing process ‘priority ,
handling synchronization.

Memory management: In memory management we have loading/unloading programs and memory ,


managing virtual memory, managing paging( creating partition of ram).

Storage management: Creating file system on hard disk , managing virtual memory on hard disk,
performing swapping on hard disk, managing file and directories on hard disk.

I/o management: sending and receiving data from i/o devices , handling interrupts from device
controllers, communicating with device drivers.

Protection and Security : Managing permeation of file and directories, protecting from viruses and
worms, implementing access policies.

How to pass parameters to system calls?

1) Use register, put the data in the register and pass the data into the location of function
in vector table. We pass the name of the register into interupt service routine.
2) Use Table in memory: the parameter for example print(“Hello world”) hellow world will
be stored in ram.. we will save the address of the data in register, register goes to
interrupt service routine. Window use this process.
3) Os Stack: there are two stack, Os Stack and process stack.. We put the data in the os
stack and the interrupt service routing pop the data from the stack.. in linux the 3rd
method is used.

Linux Manual Pages.

Types of system call:

Process Control: end(normal termination),abort(abnormal termination) ,load( to copy a program from


hard disk to ram), execute(to execute the program after it is loaded in ram), create process( we can
create new process during runtime, it is called child process the function is used fork())
Terminate process( it is used to kill a child process)

Get process and set process attribute:


A process id , it’s priority , how many child process it’s have, what sort of resources it have, sort of
permission

Wait for time: it is used when we want the process to wait for particular time
Wait for event: it is used to wait for a child process to complete its task. When process waits , its data is
stored in ram or hard disk on basis of its priority.

Operating Structure

Simple Structure..

Bios driver: this was the driver which were used to shift with the system.

In todays operatin system we don’t have concept of bios drivers we have device drivers.

In old structure: the haricarchy was application program→ system programs→os device driver→ bios
driver and application program was also allowed to directly access the bios driver.

Simple structure is the oldest technique of os structuring which is now obsolete. Ex: ms dos

This operating system used to be uni program.

Simple structuring were not efficient at all.

Layered Operating system

…. Disk management→ i/o Layer → memory manager→ Kernel

It is best for debugging., but slow. Another major issue was the dependency..

MicroKernel:

Microkernel is a small size operating system, remove unnecessary layers from os.

Used mostly in embedded systems.

In embedded system a software is already installed at hardware.

Module/component based approach


In this approach we can attach a module to a software at runtime, we are able to update an exicting
software in this case the os, and the module is compiled implicitly , we don’t need to compile the Os
again.

A module based approach allow the os add new functionality at runtime.

Quiz Wednesday

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy