BCA 513 Linux Operating System CIA I Notes
BCA 513 Linux Operating System CIA I Notes
BCA 513 Linux Operating System CIA I Notes
UNIT I
Open source refers to the computer software or applications where the owners or
copyright holders allow the users or third party to see, use and provide the right to
modify the source code of the product. An Open-source Operating System is the
Operating System in which source code is visible publically and editable. In the case
of an Open Source Operating system, everyone can access and edit the source code.
Evolution of Linux
In 1991, Linus Torvalds a student at the university of Helsinki, Finland, thought to
have a freely available academic version of Unix started writing its own code. Later
this project became the Linux kernel. He wrote this program specially for his own PC
as he wanted to use Unix 386 Intel computer but couldn't afford it. He did it on
MINIX using GNU C compiler. GNU C compiler is still the main choice to compile
Linux code .He started it just for fun but ended up with such a large project. Firstly he
wanted to name it as 'Freax' but later it became 'Linux'.
He published the Linux kernel under his own license and was restricted to use as
commercially. Linux uses most of its tools from GNU software and are under GNU
copyright. In 1992, he released the kernel under GNU General Public License.
SYSTEM STRUCTURE
Figure below depicts the high-level architecture of the Linux system. The hardware at
the center of the diagram provides the operating system with basic services. The
operating system interacts directly with the hardware, providing common services to
programs and insulating them from hardware idiosyncrasies. Viewing the system as a
set of layers, the operating commonly called the system kernel, or just the kernel,
emphasizing its
isolation from user programs. Because programs are independent of the underlying
hardware, it is easy to move them between UNIX systems running on different
hardware if the programs do not make assumptions about the underlying hardware.
Programs such as the shell and editors (ed and vi) shown in the outer layers interact
with the kernel by invoking a well defined set of system calls. The system calls
instruct the kernel to do various operations for the calling program and
exchange data between the kernel and the program. Several programs shown in the
figure are in standard system configurations and are known as commands, but private
user programs may also exist in this layer as indicated by the program whose name is
a.out, the standard name for executable files produced by the C compiler. Other
application programs can build on top of lower-level programs,hence the existence of
the outermost layer in the figure.
Figure gives a block diagram of the kernel, showing various modules and their relationships
to each other. In particular, it shows the file subsystem on the left and the process control
subsystem on the right, the two major components of the kernel. The diagram serves as a
useful logical view of the kernel.
Figure shows three levels: user, kernel, and hardware. The system call and library interface
represent the border between user programs and the kernel. System calls look like ordinary
function calls in C.programs, and libraries map these function calls to the primitives needed
to enter the operating system.
The kernel contains two other data structures, the file table and the user file descriptor
table. The file table is a global kernel structure, but the user file descriptor table is
allocated per process. When a process opens or creats a file, the
kernel allocates an entry from each table, corresponding to the file's mode. Entries in
the three structures user file descriptor table, file table, and inode table — maintain the
state of the file and the user's access to it. The file table keeps track
of the byte offset in the file where the user's next read or write will start, and the
access rights allowed to the opening process. The user file descriptor table identifies
all open files for a process. Figure shows the tables and their
relationship to each other. The kernel returns a file descriptor for the open and creat
system calls, which is an index into the user file descriptor table. When executing
read and write system calls, the kernel uses the file descriptor to access
the user file descriptor table, follows pointers to the file table and inode table entries,
and, from the inode, finds the data in the file.
Partitioning a disk into several file systems makes it easier for administrators to
manage the data stored there.
Directory Structure
Linux uses a hierarchical file system structure, much like an upside-down tree, with
root (/) at the base of the file system and all other directories spreading from there.
A Linux filesystem is a collection of files and directories that has the following
properties −
It has a root directory (/) that contains other files and directories.
Each file or directory is uniquely identified by its name, the directory in which
it resides, and a unique identifier, typically called an inode.
The directories have specific purposes and generally hold the same types of
information for easily locating files. Following are the directories that exists −
1 /
This is the root directory which should contain only the directories needed at the
top level of the file structure.
2 /bin
This is where the executable files are located. These files are available to all
users
3 /dev
These are device drivers
4 /etc
Supervisor directory commands, configuration files, disk configuration files, valid
user lists, groups, ethernet, hosts, where to send critical messages
5 /lib
Contains shared library files and sometimes other kernel-related files
6 /boot
Contains files for booting the system
7 /home
Contains the home directory for users and other accounts
8 /mnt
Used to mount other temporary file systems, such as cdrom and floppy for
the CD-ROM drive and floppy diskette drive, respectively
9 /proc
Contains all processes marked as a file by process number or other information
that is dynamic to the system
10 /tmp
Holds temporary files used between system boots
11 /usr
Used for miscellaneous purposes, and can be used by many users. Includes
administrative commands, shared files, library files, and others
12 /var
Typically contains variable-length files such as log and print files and any other
type of file that may contain a variable amount of data
13 /sbin
Contains binary (executable) files, usually for system administration. For
example, fdisk and ifconfig utlities
14 /kernel
Contains kernel files