Menu

Saturday 21 April 2012

What Is an Operating System?

Definition :

The operating system is the most important program that runs on a computer. Every general-purpose computer must have an operating system to run other programs. Operating systems perform basic tasks, such as recognizing input from the keyboard, sending output to the display screen, keeping track of files and directories on the disk, and controlling peripheral devices such as disk drives and printers. For large systems, the operating system has even greater responsibilities and powers. It is like a traffic cop -- it makes sure that different programs and users running at the same time do not interfere with each other. The operating system is also responsible for security, ensuring that unauthorized users do not access the system.



Operating systems can be classified as follows:


multi-user : Allows two or more users to run programs at the same time. Some operating systems permit hundreds or even thousands of concurrent users.
multiprocessing : Supports running a program on more than one CPU.
multitasking : Allows more than one program to run concurrently.
multithreading : Allows different parts of a single program to run concurrently.
real time: Responds to input instantly. General-purpose operating systems, such as DOS and UNIX, are not real-time.
Operating systems provide a software platform on top of which other programs, called application programs, can run. The application programs must be written to run on top of a particular operating system. Your choice of operating system, therefore, determines to a great extent the applications you can run. For PCs, the most popular operating systems are DOS, OS/2, and Windows, but others are available, such as Linux.
As a user, you normally interact with the operating system through a set of commands. For example, the DOS operating system contains commands such as COPY and RENAME for copying files and changing the names of files, respectively. The commands are accepted and executed by a part of the operating system called the command processor or command line interpreter. Graphical user interfaces allow you to enter commands by pointing and clicking at objects that appear on the screen.

Friday 13 April 2012

What is inode?

When a file system is created, data structures that contain

information about files are created. Each file has an inode
and is identified by an inode number (often "i-number" or
even shorter, "ino") in the file system where it resides.
Inodes store information on files such as user and group
ownership, access mode (read, write, execute permissions)
and type of file. There is a fixed number of inodes, which
indicates the maximum number of files each filesystem can hold.
 
A file's inode number can be found using the ls -i command,
while the ls -l command will retrieve inode information.
This is description of inode information  which it contain:
 
    * The length of the file in bytes.
    * Device ID (this identifies the device containing the file).
    * The User ID of the file's owner.
    * The Group ID of the file.
    * The file mode, which determines what users can read, write and execute the file.
    * Timestamps telling when the inode itself was last modified (ctime, change time), the file content 
last modified (mtime, modification time), and last accessed (atime, access time).
    * A reference count telling how many hard links point to the inode.
    * Pointers to the disk blocks that store the file's content

What is Unix file system ?

The Unix file system has a hierarchical (or tree-like) structure with its highest level directory called root (denoted by /, pronounced slash). Immediately below the root level directory are several subdirectories, most of which contain system files. Below this can exist system files, application files, and/or user data files. Similar to the concept of the process parent-child relationship, all files on a Unix system are related to one another. That is, files also have a parent-child existence. Thus, all files (except one) share a common parental link, the top-most file (i.e. /) being the exception. Below is a diagram (slice) of a "typical" Unix file system. As you can see, the top-most directory is / (slash), with the directories directly beneath being system directories. Note that as Unix implementaions and vendors vary, so will this file system hierarchy. However, the organization of most file systems is similar.


While this diagram is not all inclusive, the following system files (i.e. directories) are present in most Unix filesystems:

 • bin - short for binaries, this is the directory where many commonly used executable commands reside 

• dev - contains device specific files 

• etc - contains system configuration files

 • home - contains user directories and files

 • lib - contains all library files

 • mnt - contains device files related to mounted devices 

• proc - contains files related to system processes 

• root - the root users' home directory (note this is different than /) 

• sbin - system binary files reside here. If there is no sbin directory on your system, these files most likely reside in etc 

• tmp - storage for temporary files which are periodically removed from the filesystem 

• usr - also contains executable commands