Ite2002 (Unix Report)
Ite2002 (Unix Report)
SLOT-B1+TB1
SUBMITTED BY- ASHISH RAJ (16BIT0138)
SUBMITTED TO- PROF. SHASHIKIRAN V.
SITE
Unix is the multi-user multitasking Operating system. UNIX is an operating system. It is a stable,
multi-user, multi-tasking system for servers, desktops and laptops.
The UNIX Architecture-
Different Layers of the UNIX Architecture:
Swapping
A process must be in memory to be executed. A process, however, can be swapped
temporarily out of memory to a backing store and then brought back into memory for
continued execution.
The swap device is a block device in a configurable section of a disk.
Kernel allocates contiguous space on the swap device without fragmentation.
It maintains free space of the swap device in an in-core table, called map
The kernel treats each unit of the swap map as group of disk blocks
As kernel allocates and frees resources, it updates the map accordingly Swapping
Process Out.
The kernel must gather the page addresses of data at primary memory to be swapped
out.
Kernel copies the physical memory assigned to a process to the allocated space on the
swap device.
The mapping between physical memory and swap device is kept in page table entry.
Demand Paging
A demand-paging system is similar to a paging system with swapping. When we want to
execute a process, we swap it into memory. Rather than swapping the entire process into
memory.
Not all page of process resides in memory Locality.
When a process accesses a page that is not part of its working set, it incurs a page fault.
The kernel suspends the execution of the process until it reads the page into memory
and makes it accessible to the process
File Management in UNIX:
In UNIX there are three basic types of files:
Ordinary Files: An ordinary file is a file on the system that contains data, text, or
program instructions. In this tutorial, you look at working with ordinary files.
Directories: Directories store both special and ordinary files. For users familiar with
Windows or Mac OS, UNIX directories are equivalent to folders.
Special Files: Some special files provide access to hardware such as hard drives, CD-
ROM drives, modems, and Ethernet adapters. Other special files are similar to aliases or
shortcuts and enable you to access a single file using different names.
File Management in UNIX File Access Modes:
Read: Grants the capability to read i.e. view the contents of the file.
Write: Grants the capability to modify, or remove the content of the file. Execute: User
with execute permissions can run a file as a program.
File Management in UNIX Directory Access Modes:
Read: Access to a directory means that the user can read the contents. The user can look
at the filenames inside the directory.
Write: Access means that the user can add or delete files to the contents of the directory.
Execute: Executing a directory doesnt really make a lot of sense so think of this as
traverse permission. A user must have executed access to the bin directory in order to
execute or command.
File Management in UNIX Starting a Process:
Foreground Processes: By default, every process that you start runs in the foreground. It
gets its input from the keyboard and sends its output to the screen.
Background Processes: A background process runs without being connected to your
keyboard. If the background process requires any keyboard input, it waits. The advantage
of running a process in the background is that you can run other commands; you do not
have to wait until it completes to start another.
File Management in UNIX Stopping Processes:
Ending a process can be done in several different ways. Often, from a console-based
command, sending a CTRL + C keystroke (the default interrupt character) will exit the
command. This works when process is running in foreground mode.
If a process is running in background mode then first you would need to get its Job ID
using ps command and after that you can use kill command to kill the process.
UNIX Security:
File Permissions
Login daemons
Non-login daemons
Stack Smashing
Safe Script
References:
Bach MJ (2006) The design of the UNIX operating system.
Tanenbaum AS (2005) Modern operating systems, 2nd edn.
Stallings W (1998) Operating systems: Internal and design principles 3rd edn.
Katzan H Jr (1970) Operating system architecture.
The Design of the UNIX Operating system Maurice J. Bach
A. Silberschatz, P.B. Galvin & G. Gagne, Operating System Concepts