You are on page 1of 2

Operating Systems Unit 02

2.1 Information GetCurrentProces getpid(


Maintenanc sID() )
Different Services of Operating System e SetTimer() alarm()
1. User Interface Sleep() sleep()
2. Program Execution Communicat CreatePipe() pipe()
ion CreateFileMappin shmge
3. I/O Operations
g() t()
4. File System Manipulation
MapViewOfFile() mmap(
5. Communications )
6. Error Detection

2.2 2.3
System Calls OS Components:

Process Management:

1. Process is Running Program


2. Compiler generates binary code
3. Running as process
4. PCB
5. Stored inside the Main Memory
6. Process and thread scheduling on the
CPU.
7. Both user and system processes can be
Concept: A system call is a way for a user created and deleted.
program to interface with the operating 8. Processes are suspended and
system. The program requests several services, resumed.
and the OS responds by invoking a series of 9. Providing synchronization methods for
system calls to satisfy the request. A system call processes.
can be written in assembly language or a high- 10. Providing communication mechanisms
level language like C or Pascal. System calls are for processes.
predefined functions that the operating system
Main Memory management:
may directly invoke if a high-level language is
used. 1. Memory is a large array of words or
bytes, each with its own address
Types of System calls:
2. Volatile storage
Types of Windows Linux 3. Keep track of which parts of memory
System Calls are currently being used and by whom.
Process CreateProcess() fork() 4. Decide which processes to load when
Control ExitProcess() exit() memory space becomes available.
WaitForSingleObje wait() 5. Allocate and deallocate memory space
ct() as needed.
File CreateFile() open()
Managemen ReadFile() read() Secondary storage management
t WriteFile() write()
1. Secondary storage is permanent
CloseHandle() close()
Device SetConsoleMode() ioctl() storage.
Managemen ReadConsole() read() 2. Free space management
t WriteConsole() write() 3. Storage allocation
4. Disk scheduling
Operating Systems Unit 02

File Management 3. chmod [opts] mode[,mode] file1 [,file2


…]
1. File creation and deletion
4. Options:
2. Directory creation and deletion
a. -R: include objects in sub
3. The support of primitives for
directory
manipulating files and directories
b. -f: force with next objects even
4. Mapping files onto secondary storage
error occurs in current
5. File backup on stable (nonvolatile)
c. -v: show objects that are
storage media
processed
I/O System management 5. RWXRWXRWX

1. Hide the details of H/W devices


2. Manage main memory for the devices
Device Management
using cache, buffer, and spooling
3. Maintain and provide custom drivers 1. Device Drivers
for each device. 2. Block Devices, Character Devices &
Network Devices
2.4
3. Block: ls -l /dev/had
Use of operating system tools 4. Character: ls -l /dev/ttys0

User management Performance Monitor

1. 3 types of user accounts in UNIX 1. Top command – CPU Usage, Memory


a. Root usage, swap memory, cache size,
b. System Accounts buffer size, PID, Commands
c. User accounts 2. Vmstat – swapped in/out, Blocks
2. Commands received/sent, Interrupts, context
switches, memory used, free memory,
buffer memory, cache memory

Task Scheduler

1. Sysctl command
Syntax for every command: 2. Sysctl can be used to change the
default behaviour of the system
1. useradd <uname> scheduler.
2. passwd <uname> 3. Sysctl VARIABLE : to read value from
3. userdel -r <uname> kernel variable
a. -r for home dir 4. Runtime environment from proc files
4. groupadd -g <gid> -o -r -f /proc/schedstat.
<groupname>
5. groupmod -n <new_name>
<old_name> / -g <gid>
<groupname>
6. groupdel <groupname>

Security Policy

1. Permission Groups : Owner , Group &


all users
2. Permission Types: RWX

You might also like