You are on page 1of 17

Tecnia Institute of Advanced Studies

MCA 301 : LINUX PROGRAMMING


OBJECTIVES:
A comprehensive overview of the Linux operating system along with Shell commands and shell scripting Implementation of Linux System programmes through GCC compiler. Understanding of basic concept of Socket programming (TCP and UDP)

Dr. Vaibhav Bansal

16-02-2014

Events leading to creation


Unix : The Unix operating system was conceived

and implemented by Ken Thompson and Dennis Ritchie (both of AT&T Bell Laboratories) in 1969 and first released in 1970. In 1983, Richard Stallman started the GNU project with the goal of creating a free UNIX-like operating system (GNU: GNU is a recursive acronym for
"GNU's Not Unix!",chosen because GNU's design is Unix-like, but differs from Unix by being free software and containing no Unix code)

Dr. Vaibhav Bansal

16-02-2014

Events leading to creation


Another free operating system project, initially released

in 1977, was the Berkeley Software Distribution (BSD). This was developed by UC Berkeley from the 6th edition of Unix from AT&T. project that later became the Linux kernel.

In 1991, in Helsinki (University), Linus Torvalds began a


It was initially a terminal emulator (In computing, an emulator is

hardware or software or both that duplicates (or emulates) the functions of one computer system (the guest) in another computer system (the host), different from the first one, so that the emulated behaviour closely resembles the behavior of the real system (the guest)). Development was done on MINIX using the GNU C compiler, which is still the main choice for compiling Linux today (although the code can be built with other compilers, such as the Intel C Compiler).
Dr. Vaibhav Bansal 16-02-2014

What is Linux?
History
The

History of Linux began in 1991 with the commencement of a personal project by a Finnish student, Linus Torvalds, to create a new free operating system kernel.

Torvalds first published the Linux kernel under its


The software to use with the kernel was software

own licence, which had a restriction on commercial activity.


developed as part of the GNU project licensed under the GNU General Public License, a free software license. The first release of the Linux kernel, Linux 0.01, included a binary of GNU's Bash shell.

Dr. Vaibhav Bansal

16-02-2014

Linux
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 on 5 October 1991, by Linus Torvalds. Since the C compiler that builds Linux 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.

Dr. Vaibhav Bansal

16-02-2014

Where is Linux Used?


75% of respondents were already using Linux

and another 14% were evaluating it 43% of all web sites use Linux servers running the Apache Web server

Dr. Vaibhav Bansal

16-02-2014

How is Linux Used?


Personal Workstation File and Print Server Internet Service Provider Three-tier Client/Server Turnkey System

Dr. Vaibhav Bansal

16-02-2014

Linux Features
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. It has memory protection between processes, so that one program can't bring the whole system down. Demand loads executables: Linux only reads from disk those parts of a program that are actually used.
Dr. Vaibhav Bansal 16-02-2014

Linux Features
Shared copy-on-write pages among executables. This means

that multiple process can use the same memory to run in. When one tries to write to that memory, that page (4KB piece of memory) is copied somewhere else. Copy-on-write has two benefits: increasing speed and decreasing memory use. Virtual memory using paging (not swapping whole processes) to disk: to a separate partition or a file in the file system, or both, with the possibility of adding more swapping areas during runtime (yes, they're still called swapping areas). A total of 16 of these 128 MB (2GB in recent kernels) swapping areas can be used at the same time, for a theoretical total of 2 GB of useable swap space. It is simple to increase this if necessary, by changing a few lines of source code.
Dr. Vaibhav Bansal 16-02-2014

Linux Features

A unified memory pool for user programs and disk cache, so that all free memory can be used for caching, and the cache can be reduced when running large programs. All source code is available, including the whole kernel and all drivers, the development tools and all user programs; also, all of it is freely distributable. Plenty of commercial programs are being provided for Linux without source, but everything that has been free, including the entire base operating system, is still free. Multiple virtual consoles: several independent login sessions through the console, you switch by pressing a hot-key combination (not dependent on video hardware). These are dynamically allocated; you can use up to 64. Supports several common file systems, including minix, Xenix, and all the common system V file systems, and has an advanced file system of its own, which offers file systems of up to 4 TB, and names up to 255 characters long. Many networking protocols: the base protocols available in the latest development kernels include TCP, IPv4, IPv6, AX.25, X.25, IPX, DDP (AppleTalk), Netrom, and others. Stable network protocols included in the stable kernels currently include TCP, IPv4, IPX, DDP, and AX.25.

Dr. Vaibhav Bansal

16-02-2014

10

Using Linux on Personal Computers

Linux kernel for free Kernel is central component Kernel can be customized to users needs

Dr. Vaibhav Bansal

16-02-2014

11

Linux Distributions
Corel Linux
Debian GNU/Linux OpenLinux (Caldera)

Red Hat
Slackware SuSE TurboLinux

Dr. Vaibhav Bansal

16-02-2014

12

Architecture
Applications: Compilers, word processors, X-based GUI AUI LINUX Shell: Bourne Again (bash), TC, Z, etc. Language libraries API System call interface

Memory management
Kernel

File management

Process Management

Device Drives
BIOS Computer Hardware

Dr. Vaibhav Bansal

16-02-2014

13

Architecture

Kernel

The part of an OS where the real work is done

System call interface

Comprise a set of functions (often known as API) that can be used by the applications and library routines to use the services provided by the kernel

Application Users Interface

Interface between the kernel and user Allow user to make commands to the system Divided into text based and graphical based

Dr. Vaibhav Bansal

16-02-2014

14

Architecture

File Management

Control the creation, removal of files and provide directory maintenance For a multiuser system, every user have its own right to access files and directories

Process Management

For a multitask system, multiple programs can be executed simultaneously in the system When a program starts to execute, it becomes a process The same program executing at two different times will become two different processes Kernel manages processes in terms of creating, suspending, and terminating them. A process is protected from other processes and can communicate with the others
16-02-2014

Dr. Vaibhav Bansal

15

Architecture

Memory management

Memory in a computer is divided into main memory (RAM) and secondary storage (usually refer to hard disk) Memory is small in capacity but fast in speed, and hard disk is vice versa Data that are not currently used should be saved to hard disk first, while data that are urgently needed should be retrieved and stored in RAM The mechanism is referred as memory management

Device drivers

Interfaces between the kernel and the BIOS Different device has different driver

Dr. Vaibhav Bansal

16-02-2014

16

Dr. Vaibhav Bansal

16-02-2014

17

You might also like