[Type here] [Type here] [Type here] Lab01:INTRODUCTION TO LINUX Objectives To provide an understanding of the design aspects of operating system Introduvction to linux, Virtual machine installation, Booting process To develop an understanding with the linux environment. 1. THEORY KERNEL & SHELL. UNIX and 'UNIX−like' operating systems (such as Linux) consist of a kernel and some system programs.There are also some application programs for doing work. The kernel is the heart of the operating system. Infact, it is often mistakenly considered to be the operating system itself, but it is not. An operating system provides provides many more services than a plain kernel. Linux is operating system (OS).Linux system is described as kernel & shell.Kernel is a main progrm of Linux system.It controls hardwares, CPU, memory, hard disk, network card etc. Shell is the interface between end user and the Linux system, similar to the commands in Windows Bash is installed as in /bin/sh MBR Each OS has its own boot sector format.The small program in the boot sector must locate “BOOT MANAGER PROGRAM” of the OS. All partition table records (Sectors) have the same formatAn MBR is created by the FDISK program.The Fdisk program of all operating systems must create a functionally similar MBR. MBR (cylinder 0, head0, sector 1). It is always located in the first sector of the harddisk and consists of the following: • Master boot code – a small program that is executed by the system BIOS to pass control of the system to the partition that has been active. • Master partition table – a list of the partitions on the disk and the locations of their volume boot records. Can contain only four entries. The master boot record is the first sector on the harddisk.It contains the "bootstrap." This is a program, which is called by the BIOS to load the actual operating system.This sector also contains a description of how the hard disk is divided into separate areas (partitions). This description is listed in the "partition table." It contains one entry for each partition. The entry lists the location of the partition on the hard disk and the "type" of this partition.This partition table can include only four entries. The format of this master boot record (bootstrap / partition table) is permanently defined and is absolutely required by all operating systems. The first 446-bytes of the MBR contains a program that is executed each time the hard disk is booted; the rest of the record contains a 2-byte header, and, most importantly, four 16-byte partition table entries.Active partition is always found on drive ,80h is the first hard disk address. BU,CS DEPARTMENT LAB-01 Linux File System A file system is the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk. The word is also used to refer to a partition or disk that is used to store the files or the type of the file system. The file is the most basic and fundamental abstraction in Linux. Linux follows the everything-is-a-file philosophy. What most of us call “files” are what Linux labels regular files. A regular file contains bytes of data, organized into a linear array called a byte stream. In Linux, no further organization or formatting is specified for a file. The bytes may have any values, and they may be organized within the file in any way. At the system level, Linux does not enforce a structure upon files beyond the byte stream. Some operating systems, such as VMS, provide highly structured files, supporting concepts such as records. Linux does not. The size of a file is measured in bytes and is called its length. Special files are kernel objects that are represented as files. Over the years, Unix systems have supported a handful of different special files. Linux supports four: block device files, character device files, named pipes, and Unix domain sockets. Special files are a way to let certain abstractions fit into the filesystem, continuing the everything-is-a-file paradigm. Linux provides a system call to create a special file. Most UNIX file system types have a similar general structure, although the exact details vary quite a bit. The central concepts are superblock, inode, data block, directory block, and indirection block. The superblock contains information about the file system as a whole, such as its size (the exact information here depends on the file system). An inode contains all information about a file, except its name. The name is stored in the directory, together with the number of the inode. A directory entry consists of a filename and the number of the inode which represents the file. The inode contains the numbers of several data blocks, which are used to store the data in the file. There is space only for a few data block numbers in the inode, however, and if more are needed, more space for pointers to the data blocks is allocated dynamically. These dynamically allocated blocks are indirect blocks; the name indicates that in order to find the data block, one has to find its number in the indirect block first. DIRECTORY STRUCTURE BU,CS DEPARTMENT LAB-01 IMPORTANT DIRECTORIES /bin /mnt /home /var /etc /dev /opt This contains files that are essential for correct operation of the system. These are available for use by all users. Provides a location for mounting devices,such as remote filesystems and removable media This is where user home directories are stored. This directory is used to store files which change frequently, and must be available to be written to. Various system configuration files are stored here. This contains various devices as files, e.g. hard disk, CDROM drive etc. This directory contains all the software and add-on packages that are not part of the default installation. This is the root (administrator) user's home directory Binaries which are only expected to be used by the super /root /sbin user. /tmp Temporary files. /boot Has the bootable Linux kernel and bootloaderconfiguration files(GRUB) /usr is one of the most important directories in the system as It contains all the user binaries. /usr/src/linux contains the source code for theLinux kernel.iIt contains user documentation,games,graphical files,libraries(lib),etc.. Exercises Exercise 1 Answer these questions. 1. 2. 3. 4. 5. 6. 7. 8. What is a file system? What does superblock contain? What is root directory? What is Lilo? What information is kept in /dev? Give names of few files that the directory /etc contains? What is the purpose of /usr? Where the code for linux kernel is kept? What is MBR?