0% found this document useful (0 votes)
23 views

Operating Systems Notes

The document discusses system calls and the role of the operating system in managing them. When a program makes a system call, the OS takes control and performs the requested operation before returning control back to the program. System calls are used for process management, memory management, file/device access, and other services.

Uploaded by

Rakshit Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Operating Systems Notes

The document discusses system calls and the role of the operating system in managing them. When a program makes a system call, the OS takes control and performs the requested operation before returning control back to the program. System calls are used for process management, memory management, file/device access, and other services.

Uploaded by

Rakshit Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Operating system sees the system call:

When the OS sees the system call then it


recognises that the program need help at this time
so it temporarily stop the program execution and give
all the control to special part of itself called ‘Kernel’.
Now ‘Kernel’ solve the need of program.
Operating system performs the operations:
Now the operating system perform the operation
which is requested by program .
Example : reading content from a file etc.
Operating system give control back to the program:
After performing the special operation,
OS give control back to the program for further
execution of program .

Services Provided by System Calls:=


*Process creation and management
*Main memory management
*File Access, Directory, and File system management
*Device handling(I/O)
*Protection
*Networking, etc.

**Process control: end, abort, create, terminate, allocate, and free memory.
**File management: create, open, close, delete, read files,s, etc.
*Device management
*Information maintenance
*Communication
asks
wrong
The primary difference is that threads within the same
process run in a shared memory space, while
processes run in separate memory spaces. Threads are
not independent of one another like processes are, and
as a result, threads share with other threads their code
section, data section, and OS resources (like open files
and signals). But, like a process, a thread has its own
program counter (PC), register set, and stack space.

Since all threads of the same process share address


space and other resources so any changes to the main
thread may affect the behavior of the other threads of the
process

User-level threads are limited to a single processor.

A thread library provides the programmer with an API for


creating and managing threads. There are two primary ways of
implementing a thread library. The first approach is to provide a
library entirely in user space with no kernel support. All code
and data structures for the library exist in user space. This
means that invoking a function in the library results in a local
function call in user space and not a system call. The second
approach is to implement a kernel-level library supported
directly by the operating system. In this case, code and data
structures for the library exist in kernel space. Invoking a
function in the API for the library typically results in a system
call to the kernel.

Three main thread libraries are in use today: POSIX Pthreads,


Windows, and Java.
Each ULT has a process that keeps track of the thread using the Thread table.
Each KLT has Thread Table (TCB) as well as the Process Table (PCB).
ULT - Can be implemented on an OS that doesn’t support
multithreading.

Kernel Level Threads has its own thread table where it keeps track of the
system.
Advantages of User-Level Threads

Implementation of the User-Level Thread is easier than Kernel Level


Thread.
Context Switch Time is less in User Level Thread.
User-Level Thread is more efficient than Kernel-Level Thread.
Because of the presence of only Program Counter, Register Set,
and Stack Space, it has a simple representation.
Disadvantages of User-Level Threads

There is a lack of coordination between Thread and Kernel.


Inc case of a page fault, the whole process can be blocked.
Advantages of Kernel-Level Threads

It has up-to-date information on all threads.


Applications that block frequency are to be handled by the
Kernel-Level Threads.
Whenever any process requires more time to process, Kernel-Level
Thread provides more time to it.
Disadvantages of Kernel-Level threads

Kernel-Level Thread is slower than User-Level Thread.


Implementation of this type of thread is a little more complex than a
user-level thread.
What is Microkernel?

A microkernel is one of the classifications of the kernel.


Being a kernel it manages all system resources. But in a
microkernel, the user services and kernel services are
implemented in different address spaces. The user
services are kept in user address space, and kernel
services are kept under kernel address space, thus also
reduces the size of kernel and size of an operating system
as well.

It is also portable, secure, and reliable. Examples of


microkernel-based operating systems include L4, QNX,
and MINIX

Eclipse IDE is a good example of Microkernel


Architecture.
acquire
However, counting semaphore can be used when
we need to have more than one process in the
critical section at the same time.
What is a File System?
A file system is a method an operating system uses to store,
organize, and manage files and directories on a storage
device. Some common types of file systems include:

> FAT (File Allocation Table): An older file system used by


older versions of Windows and other operating systems.

> NTFS (New Technology File System): A modern file


system used by Windows. It supports features such as file
and folder permissions, compression, and encryption.

> EXT (Extended File System): A file system commonly used


on Linux and Unix-based operating systems.

> HFS (Hierarchical File System): A file system used by


macOS.

> APFS (Apple File System): A new file system introduced


by Apple for their Macs and iOS devices.

You might also like