Вы находитесь на странице: 1из 29

What is Linux?

Linux is, in simplest terms, an operating system. It is the software on a computer that enables applications and the computer operator to access the devices on the computer to perform desired functions. The operating system (OS) relays instructions from an application to, for instance, the computer's processor. The processor performs the instructed task, then sends the results back to the application via the operating system.

Features of Linux
Key features of Linux Operating System: Following are the key features of the Linux operating system: Multitasking: several programs running at the same time. Multiuser: several users on the same machine at the same time (and no two-user licenses!). Multiplatform: runs on many different CPUs, not just Intel. Multiprocessor/multithreading: it has native kernel support for multiple independent threads of control within a single process memory space.

Advantages OF Linux
Linux Advantages Low cost: You dont need to spend time and money to obtain licenses since Linux and much of its software come with the GNU General Public License. You can start to work immediately without worrying that your software may stop working anytime because the free trial version expires. Additionally, there are large repositories from which you can freely download high quality software for almost any task you can think of. Stability: Linux doesnt need to be rebooted periodically to maintain performance levels. It doesnt freeze up or slow down over time due to memory leaks and such. Continuous up-times of hundreds of days (up to a year or more) are not uncommon. Performance: Linux provides persistent high performance on workstations and on networks. It can handle unusually large numbers of users simultaneously, and can make old computers sufficiently responsive to be useful again.

Advantages OF Linux
Network friendliness: Linux was developed by a group of programmers over the Internet and has therefore strong support for network functionality; client and server systems can be easily set up on any computer running Linux. It can perform tasks such as network backups faster and more reliably than alternative systems. Flexibility: Linux can be used for high performance server applications, desktop applications, and embedded systems. You can save disk space by only installing the components needed for a particular use. You can restrict the use of specific computers by installing for example only selected office applications instead of the whole suite. Compatibility: It runs all common Unix software packages and can process all common file formats.

Advantages OF Linux
Multitasking: Linux is designed to do many things at the same time; e.g., a large printing job in the background wont slow down your other work. Security: Linux is one of the most secure operating systems. Walls and flexible file access permission systems prevent access by unwanted visitors or viruses. Linux users have to option to select and safely download software, free of charge, from online repositories containing thousands of high quality packages. No purchase transactions requiring credit card numbers or other sensitive personal information are necessary. Open Source: If you develop software that requires knowledge or modification of the operating system code, Linuxs source code is at your fingertips. Most Linux applications are Open Source as well.

Kernal
What is Kernel? Explain the task it performs. Answer Kernel is used in UNIX like systems and is considered to be the heart of the operating system. It is responsible for communication between hardware and software components. It is primarily used for managing the systems resources as well. Kernel Activities: The Kernel task manager allows tasks to run concurrently. Managing the computer resources: Kernel allows the other programs to run and use the resources. Resources include i/o devices, CPU, memory. Kernel is responsible for Process management. It allows multiple processes to run simultaneously allowing user to multitask. Kernel has an access to the systems memory and allows the processes to access the memory when required. Processes may also need to access the devices attached to the system. Kernel assists the processes in doing so. For the processes to access and make use of these services, system calls are used.

Basics Architecture of Linux System

What Is Difference Between DOS and Windows


Both Dos and Windows are Operating systems. But, they possess some features which make them differentiate. These features are listed below: Dos is only single tasking while Windows is multitasking. Dos is based on plain interface while Windows is based on Graphical user interface (GUI). Dos is difficult to learn and understand while Windows is easy to learn and understand. Dos is less preferable by users while Windows is more preferable operating system. Limited users can work on dos while in Windows there are many users. We cannot see mouse in Dos while in Windows we can see and use mouse to click on icons or links. Simple text commands are written in Dos while in Windows we operate computer with the help of mouse. n Dos we cannot Play games, watch movies and listen songs while in Windows we can enjoy playing games, watching movies and listening songs. n Dos new hardware cannot work properly while in Windows it can detect and installs software automatically. Application and system softwares did not work properly in Dos while in Windows it runs at a great speed. Dos is not user friendly while Windows operating system is user friendly. Dos performs operations speedily as compared with Windows operating system.

LINUX DIRECTORY STURUCTURE

1. /bin
Contains several useful commands that are of use to both the system administrator as well as non-privileged users. Usually contains the shells like bash, csh, etc.... and commonly used commands like cp, mv, rm, cat, ls. Also contains programs which boot scripts may depend on There are no (real) subdirectories in /bin

10

1. /bin detail
cat chgrp chmod chown cp date dd df dmesg echo false

Utility to concatenate files to standard output Utility to change file group ownership Utility to change file access permissions Utility to change file owner and group Utility to copy files and directories Utility to print or set the system data and time Utility to convert and copy a file Utility to report filesystem disk space usage Utility to print or control the kernel message buffer Utility to display a line of text Utility to do nothing, unsuccessfully
11

7. /lib
Contains kernel modules and those shared library images (the C programming code library) needed to boot the system and run the commands in the root filesystem, ie. by binaries in /bin and /sbin Windows equivalent to a shared library would be a DLL (dynamically linked library) file

12

4. /etc detail
/etc/hosts : This file is used to define a system name and domain combination with a specific IP address

127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts 192.168.0.99 debian.localdomain.com debian

192.168.0.1 ws001

13

5. /home
The user home directories Accessible only to its owner and the system administrator Contains the users personal configuration files Quite large to be used as Users Documents Space

14

10. /mnt
This is a generic mount point under mounted (mount is to make a filesystem available to the system) the filesystems or devices. When a filesystem no longer needs to be mounted, it can be unmounted with umount

mount /dev/hda2 /home umount /dev/hda2

15

File System Implementation

16

File
Sequence of bytes, with no structure as far as the operating system is concerned. The only operations are to read and write bytes. Interpretation of the data is left to the application using it. File descriptor a handle to a file that the OS provides the user so that it can use the file

File Metadata
Owner: the user who owns this file. Permissions: who is allowed to access this file. Modification time: when this file was last modified. Size: how many bytes of data are there. Data location: where on the disk the files data is stored.

Hardware background: Direct Memory Access


When a process needs a block from the disk, the cpu needs to copy the requested block from the disk to the main memory. This is a waste of cpu time. If we could exempt the cpu from this job, it will be available to run other ready processes. This is the reason that the operating system uses the DMA feature of the disk controller. Disk access is always in full blocks.

Direct Memory Access Cont.


OS passes the needed parameters to the disk controller (address on disk, address on main memory, amount of data to copy) The running process is transferred to the blocked queue and a new process from the ready queue is selected to run. The controller transfers the requested data from the disk to the main memory using DMA. The controller sends an interrupt to the cpu, indicating the IO operation has been finished. The waiting process is transferred to the ready queue.

Disk Layout
Boot Block for loading the OS (optional) Swap area (optional) Super Block File system management i-nodes File metadata Data blocks Actual file data

Super Block
Manages the allocation of blocks on the file system area This block contains:
The size of the file system A list of free blocks available on the fs A list of free i-nodes in the fs And more...

Using this information it is possible to allocate disk block for saving file data or file metadata

Mapping File Blocks


It is inefficient to save each file as a consecutive data block.
Why?

How do we find the blocks that together constitute the file? How do we find the right block if we want to access the file at a particular offset? How do we make sure not to spend too much space on management data? We need an efficient way to save files of varying sizes.

Typical Distribution of File Sizes


Many very small files that use little disk space Some intermediate files Very few large files that use a large part of the disk space

The Unix i-node


In Unix, files are represented internally by a structure known as an inode, which includes an index of disk blocks. The index is arranged in a hierarchical manner: Few direct pointers, which list the first blocks of the file (Good for small files) One single indirect pointer - points to a whole block of additional direct pointers (Good for intermediate files) One double indirect pointer - points to a block of indirect pointers. (Good for large files) One triple indirect pointer - points to a block of double indirect pointers. (Good for very large files)

i-node Structure

system administrator is responsible


The system administrator is responsible for following things: User administration (setup and maintaining account) Maintaining system Verify that peripherals are working properly Quickly arrange repair for hardware in occasion of hardware failure Monitor system performance Create file systems Install software Create a backup and recover policy Monitor network communication Update system as soon as new version of OS and application software comes out Implement the policies for the use of the computer system and network Setup security policies for users. A sysadmin must have a strong grasp of computer security (e.g. firewalls and intrusion detection systems).

Linux Installation requirement


Requirement Minimum Version CPU RAM Recommend ed Linux 2.2 and 2.4 with glibc 2.1 or greater 400 MHz 800+ MHz

32 MB (file 256 MB to file encoding) 96 MB (live broadcasting )

System Startup and Shutdown The Boot Process The Initialization Process and Startup Scripts linuxconf and Managing Your Services Shutting Down the Linux System When the System Crashes This chapter explains how to start your Red Hat Linux system, what happens when it starts, and how to properly shut it down. It also covers system crashes and what to do if your system won't boot.