KEMBAR78
Operating System Concept | PDF | Operating System | Process (Computing)
0% found this document useful (0 votes)
10 views16 pages

Operating System Concept

The document outlines the key components and services of operating systems, including process management, memory management, file system management, and system calls. It details how processes are managed, the importance of memory and file systems, and the role of system calls in facilitating interactions between programs and the operating system. Additionally, it discusses file permissions and types, as well as the significance of interrupts in operating system functionality.

Uploaded by

arahimhstu7
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)
10 views16 pages

Operating System Concept

The document outlines the key components and services of operating systems, including process management, memory management, file system management, and system calls. It details how processes are managed, the importance of memory and file systems, and the role of system calls in facilitating interactions between programs and the operating system. Additionally, it discusses file permissions and types, as well as the significance of interrupts in operating system functionality.

Uploaded by

arahimhstu7
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/ 16

Operating System Concept

Mohammad Shahadat Hossain


Operating System Components and Services

• Process Management
• Main Memory Management
• File System Management • Kernel
• Command Interpreter
• I/O System Management
• System Calls
• Storage Management • Signals
• Networking
• Security System
Process Management (Scheduling)
A program in running state is called a process. A process is program or a fraction of a
program that is loaded in main memory. A process needs certain resources including
CPU time, Memory, Files, and I/O devices to accomplish its task. The process
management component manages the multiple processes running simultaneously on
the Operating System.

Process Management is responsible for the following activities:-


• Create, load, execute, suspend, resume, and terminate processes.
• Switch system among multiple processes in main memory.
• Provides communication mechanisms so that processes can communicate with
each others
• Provides synchronization mechanisms to control concurrent access to shared data
to keep shared data consistent.
• Allocate/de-allocate resources properly to prevent or avoid deadlock situation.
A process is a program in execution. It consists of the followings:
• Executable program
• Program’s data
• Stack and stack pointer
• Program counter and other CPU registers
• Details of opened files
Memory Management

Memory is a large array of words or bytes, each with its own address. It is a
repository of quickly accessible data shared by the CPU and I/O devices.
Main memory is a volatile storage device which means it loses its contents
in the case of system failure or as soon as system power goes down.
The operating system is responsible for the following activities in
connections with memory management:

• Keep track of which parts of memory are currently being used and by whom.
• Decide which processes to load when memory space becomes available.
• Allocate and deallocate memory space as needed.
File and File System Management
The main purpose of a computer system is to execute programs. These programs,
together with the data they access, must be in main memory during execution. Since
the main memory is too small to permanently accommodate all data and program,
the computer system must provide secondary storage to backup main memory.

Most modern computer systems use disks as the principle on-line storage medium,
for both programs and data. Most programs, like compilers, assemblers, sort
routines, editors, formatters, and so on, are stored on the disk until loaded into
memory, and then use the disk as both the source and destination of their
processing.

The operating system is responsible for the following activities in connection with
disk management:

• Free Space Management • File Creation


• Storage allocation • File Deletion
• Disk scheduling • Read and Write operations
The System Calls
; Written by Shahadat
; Date: 16-Jan-2023
System Calls :
System calls provide an interface to the services global _start:
made by an operating system. The user interacts
section .text:
with the operating system programs through _start:
System calls. These calls are normally made mov eax, 0x04 System Call
available as library functions in high-level mov ebx, 0x01
languages such as C, Java, Python etc. It provides mov ecx, message
a level of abstraction as the user is not aware of mov edx, message_length
the implementation or execution of the call int 0x80
made. Details of the operating system is hidden ; Gracefully Exit
mov eax, 0x01
from the user. Different hardware and software
mov ebx, 1
services can be availed through system calls. int 0x80
System calls are available for the following
operations: section .data:
• Process Management message: db "Hello World!", 0xA
• Memory Management message_length equ $-message
• File Operations
• Input / Output Operations
The System Calls
In computing, a system call is the programmatic way in which a computer program
requests a service from the kernel of the operating system it is executed on. A system
call is a way for programs to interact with the operating system. A computer program
makes a system call when it makes a request to the operating system’s kernel. System
call provides the services of the operating system to the user programs via Application
Program Interface(API). It provides an interface between a process and operating system
to allow user-level processes to request services of the operating system. System calls
are the only entry points into the kernel system. All programs needing resources must
use system calls.

Services Provided by System Calls :


1.Process creation and management
2.Main memory management
3.File Access, Directory and File system management
4.Device handling(I/O)
5.Protection
6.Networking, etc.
The System Calls

Types of System Calls : There are 5 different categories of system calls –

1. Process control: end, abort, create, terminate, allocate and free memory.
2. File management: create, open, close, delete, read file etc.
3. Device management
4. Information maintenance
5. Communication
The Signals or Interrupts
An interrupt is a signal emitted by a device attached to a computer or from a program
within the computer. It requires the operating system (OS) to stop and figure out what to
do next. An interrupt temporarily stops or terminates a service or a current process.

Types of interrupts
Interrupts are classified into two types:

Hardware interrupt
A hardware interrupt is an electronic signal from an external hardware device that
indicates it needs attention from the OS. One example of this is moving a mouse or
pressing a keyboard key. In these examples of interrupts, the processor must stop to
read the mouse position or keystroke at that instant.

In this type of interrupt, all devices are connected to the Interrupt Request Line (IRL).
Typically, a hardware IRQ has a value that associates it with a particular device. This
makes it possible for the processor to determine which device is requesting service by
raising the IRQ, and then provide service accordingly.
The Signals or Interrupts
; Written by Shahadat
Software interrupts ; Date: 16-Jan-2023
A software interrupt occurs when an application
program terminates or requests certain services global _start:
from the OS. Usually, the processor requests a section .text:
software interrupt when certain conditions are _start:
met by executing a special instruction. This mov eax, 0x04
instruction invokes the interrupt and functions mov ebx, 0x01
like a subroutine call. Software interrupts are mov ecx, message
commonly used when the system interacts with mov edx, message_length
device drivers or when a program requests OS int 0x80
services. ; Gracefully Exit
mov eax, 0x01
mov ebx, 1
In some cases, software interrupts may be int 0x80 Software Interrupt
triggered unexpectedly by program execution
errors rather than by design. These interrupts are section .data:
known as exceptions or traps. message: db "Hello World!", 0xA
message_length equ $-message
The File Systems and Permissions
The File Systems and Permissions

Owner
name of
Last Access date and time of
the file
the file
File Type Permission Number of Primary File Size of File Name
on file Hard Links group the file in
owner KB
name of
the file

Focus Points File Type Permissions Links


The File Types

Command to create
File Type Located in Indicator FILE command output
the File

Image data, ASCII Text, RAR archive


Regular FIle touch Any directory –
data, etc

Directory File mkdir It is a directory d Directory

Block Files fdisk /dev b Block special

Character Files mknod /dev c Character special

Pipe Files mkfifo /dev p FIFO

Symbol Link Files ln /dev l Symbol link to <linkname>

socket() sys call


Socket Files /dev s Socket
OR exec
The File Permission
What are Linux File Permissions?
In Linux, file permissions, attributes, and ownership control the access level that the
system processes and users have to files. This ensures that only authorized users and
processes can access specific files and directories. This is an important part of
maintaining and securing your systems.

Linux is a “top-down” environment. This means that if you deny “group” or “other”
permissions to a directory, all subdirectories and files within that directory will be
denied the permissions established at the directory level. The minimum permission
for access to a directory is executed (x).

When Linux file permissions are represented by numbers, it's called numeric mode.
In numeric mode, a three-digit value represents specific file permissions (for
example, 744.) These are called octal values. The first digit is for owner permissions,
the second digit is for group permissions, and the third is for other users. Each
permission has a numeric value assigned to it:

• r (read): 4
• w (write): 2
• x (execute): 1
The File Permission
Linux file permissions
Read (r)
Read permission is used to access the file's contents. You can use a tool like cat or less
on the file to display the file contents. You could also use a text editor like Vi or view on
the file to display the contents of the file. Read permission is required to make copies of
a file, because you need to access the file's contents to make a duplicate of it.

Write (w)
Write permission allows you to modify or change the contents of a file. Write permission
also allows you to use the redirect or append operators in the shell (> or >>) to change
the contents of a file. Without write permission, changes to the file's contents are not
permitted.

Execute (x)
Execute permission allows you to execute the contents of a file. Typically, executables
would be things like commands or compiled binary applications. However, execute
permission also allows someone to run Bash shell scripts, Python programs, and a
variety of interpreted languages.
The Directory Type File Permission
Linux directory type file permissions
Read (r)
Like regular files, this permission allows you to read the contents of the directory. However, that means that you
can view the contents (or files) stored within the directory. This permission is required to have things like the ls
command work.

Write (w)
As with regular files, this allows someone to modify the contents of the directory. When you are changing the
contents of the directory, you are either adding files to the directory or removing files from the directory. As such,
you must have write permission on a directory to move (mv) or remove (rm) files from it. You also need write
permission to create new files (using touch or a file-redirect operator) or copy (cp) files into the directory.

Execute (x)
This permission is very different on directories compared to files. Essentially, you can think of it as providing
access to the directory. Having execute permission on a directory authorizes you to look at extended information
on files in the directory (using ls -l, for instance) but also allows you to change your working directory (using cd)
or pass through this directory on your way to a subdirectory underneath.

Lacking execute permission on a directory can limit the other permissions in interesting ways. For example, how
can you add a new file to a directory (by leveraging the write permission) if you can't access the directory's
metadata to store the information for a new, additional file? You cannot. It is for this reason that directory-type
files generally offer execute permission to one or more of the user owner, group owner, or others.

You might also like