Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

LINUX

Company / developer Programmed in OS family Working state Source model Initial release Latest stable release Latest unstable release Marketing target Available language(s) Available programming languages(s) Many Various Unix-like Current Free and open source software 1991 Kernel: 3.6.3 (October 21, 2012; 5 days ago)[2] [] Kernel: 3.7-rc2 (20 October 2012; 6 days ago)[3] [] Personal computers, embedded devices, mobile devices, servers Multilingual Many

Supported platforms

Alpha, ARM, AVR32, Blackfin, C6x, ETRAX CRIS, FR-V, H8/300, Hexagon, Itanium, M32R, m68k, Microblaze, MIPS, MN103, OpenRISC, PA-RISC, PowerPC, s390, S+core, SuperH, SPARC, TILE64, Unicore32, x86, Xtensa Monolithic Various Many Many[4] ("Linux" trademark owned by Linus Torvalds[5] and administered by the Linux Mark Institute)

Kernel type Userland Default user interface License

INTRODUCTION
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of Linux is the Linux kernel, an operating system kernel first released 5 October 1991 by Linus Torvalds.[11][12] Linux was originally developed as a free operating system for Intel x86-based personal computers. It has since been ported to more computer hardware platforms than any other operating system. It is a leading operating system on servers and other big iron systems such as mainframe computers and supercomputers:[13][14][15][16] more than 90% of today's 500 fastest supercomputers run some variant of Linux,[17] including the 10 fastest.[18] Linux also runs on embedded systems (devices where the operating system is typically built into the firmware and highly tailored to the system) such as mobile phones, tablet computers, network routers, televisions[19][20] and video game consoles; the Android system in wide use on mobile devices is built on the Linux kernel. The development of Linux is one of the most prominent examples of free and open source software collaboration: the underlying source code may be used, modified, and distributedcommercially or non-commerciallyby anyone under licenses such as the GNU General Public License. Typically Linux is packaged in a format known as a Linux distribution for desktop and server use. Some popular mainstream Linux distributions include Debian (and its derivatives such as Ubuntu), Fedora and openSUSE. Linux distributions include the Linux kernel, supporting utilities and libraries and usually a large amount of application software to fulfill the distribution's intended use. A distribution oriented toward desktop use will typically include the X Window System and an accompanying desktop environment such as GNOME or KDE Plasma. Some such distributions may include a less resource intensive desktop such as LXDE or Xfce for use on older or less powerful computers. A distribution intended to run as a server may omit all graphical environments from the standard install and instead include other software such as the Apache HTTP Server and an SSH server such as OpenSSH. Because Linux is freely redistributable, anyone may create a distribution for any intended use. Applications commonly used with desktop Linux systems include the Mozilla Firefox web browser, the LibreOffice office application suite, and the GIMP image editor.

Since the C compiler Linux is written with and the main supporting user space system tools and libraries originated in the GNU Project, initiated in 1983 by Richard Stallman, the Free Software Foundation prefers the name GNU/Linux

COMPONENTS
A Linux-based system is a modular Unix-like operating system. It derives much of its basic design from principles established in Unix during the 1970s and 1980s. Such a system uses a monolithic kernel, the Linux kernel, which handles process control, networking, and peripheral and file system access. Device drivers are either integrated directly with the kernel or added as modules loaded while the system is running. Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU userland is an important part of most Linuxbased systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most Linux systems is built on top of an implementation of the X Window System. Some components of an installed Linux system are:

A bootloader - for example GRUB or LILO. This is a program which is executed by the computer when it is first turned on, and loads the Linux kernel into memory. An init program. This is a process launched by the Linux kernel, and is at the root of the process tree: in other terms, all processes are launched through init. It starts processes such as system services and login prompts (whether graphical or in terminal mode) Software libraries which contain code which can be used by running processes. On Linux systems using ELF-format executable files, the dynamic linker which manages use of libraries is "ld-linux.so". The most commonly used software library on Linux systems is the GNU C Library. User interface programs such as command shells or windowing environments

PROCESS MANAGEMENT
There are two kinds of execution contexts in Linux. Process and lightweight processes. However, Linux makes no distinction among these forms from scheduling point of view. Linux uses lightweight processes to provide the features of a multithreaded application. The Linux kernel use to store information about each process in the process descriptor. Which is implemented as task_struct.

1. Process Descriptor

2. Process State:

During the lifecycle of a process, process can migrate into a number of states. Each state describes particular properties of a process at that instant by

means of some attributes. These attributes are defined in the process descriptor. An array of flags is used to describe the state of a process. These states are mutually exclusive, any process can be in one of these states at a particular time. Each state is represented by a flag in the state, which is set. All other flags are cleared. Different possible states of a process are as follows.

TASK_RUNNING A process is either running or is ready to run.

TASK_INTERRUPTIBLE The process is blocked on a particular event, but it can wake up by delivering a signal to it An event can be input from user, disk I/O etc. On wake up it gets it state back to TASK_RUNNING.

TASK_UNINTERRUPTIBLE In this state also the process is blocked, but it cannot be interrupted by delivering a signal to it. If at all it gets a signal it ignores it.

TASK_STOPPED A process gets this state when its execution is stalled. E.g. when a process is being monitored by another such as a debugger. a process can be stopped by delivering a SIGSTOP, SIGTSTP, SIGTTIN, or SIGTTOU signal.

TASK_ZOMBIE A process enters this state when it is terminated. After termination of the process kernel cannot just discard the data structures of the process because the parent process may need it when it executes a wait() call on any of its children.

3. Process Identification:

Each process in Linux has unique process id. The maximum PID number allowed on Linux is 32,767. After exhausting this number the kernel uses recycling the older unused PIDs.

4. Process Descriptor Handling:

The number of processes running in the system may vary to a large extent. Kernel cannot use static memory to store the process descriptors. Otherwise a lot of memory will be wasted. It uses dynamic memory to store the process descriptor of each process. Linux store process descriptor as well as Kernel mode process stack in 8KB for each process. As shown in the figure below.

Kernel Mode Stack

The esp register is the CPU stack pointer, which is used to address the stack's top location.On Intel systems, the stack starts at the end and grows toward the beginning of the memoryarea. Right after switching from User Mode to Kernel Mode, the kernel stack of a process isalways empty, and therefore the esp register points to the byte immediately following thememory area. The value of the esp is decremented as soon as data is written into the stack. Since theprocess descriptor is less than 1,000 bytes long, the kernel stack can expand up to 7,200bytes.

In C language, the process descriptor and the kernel stack of a process to berepresented by the following union construct: union task_union {struct task_struct task; unsigned long stack[2048]; };

The kernel uses the alloc_task_struct and free_task_struct macros to allocate and release the 8 KB memory area storing a process descriptor and a kernel stack.

1.5 The process list: Kernel uses dynamic memory to store the process descriptors. It uses doubly linked lists to store the process descriptors. For each type of process state it uses a process descriptor list for it. Through the doubly linked lists it can scan efficiently all the processs descriptors in a particular state. The special thing about these lists is that a pointer for these lists is embedded in the process descriptor itself. Following is an example list.

The Process List

The kernel also keeps a list for all existing processes. The head of this list is the descriptor of the first process, which is the ancestor of all the processes. It is called as swapper.

You might also like