Lab1 Introduction To Linux
Lab1 Introduction To Linux
Engineering Faculty
Department of Computer
Engineering ECOM 4010: Operating
Systems Lab
Lab # 1
Introduction to Linux
September, 2013
2 Operating Systems Lab
System Calls
Programming interface to the services provided by the OS
Interface between the process and the operating system.
Typically written in a high-level language (C or C++)
Linux
Linux is a generic term referring to Unix-like computer operating systems based on the Linux
kernel.
The development of Linux is one of the most prominent examples of free and open source
software collaboration; typically all the underlying source code can be used, freely modified,
and redistributed by anyone.
Because Linux takes the UNIX system as its inspiration, Linux and UNIX programs are very
similar. In fact, almost all programs written for UNIX can be compiled and run under Linux. Also,
many commercial applications sold for commercial versions of UNIX can run unchanged in
binary form on Linux systems.
The problem with UNIX is that is has always been expensive and taken large computers to use.
Some versions of UNIX have been available for personal computer-type hardware, but the cost
has been very prohibitive and the support by multiple vendors has been lacking. These
problems are what led to the development of Linux.
Linux was developed by "Linus Torvalds" at the University of Helsinki, with the help of UNIX
programmers from across the Internet.
Linux Architecture
The Linux architecture comprises two main sections: the kernel space and user space.
Kernel space
The kernel space is where all of the system level processes happen. These processes are things
that affect the entire system and have to be very stable and well maintained. A problem in
kernel space can cause the system to crash. The main resident in kernel space is, of course, the
kernel. The kernel is the piece of software that manages memory allocation for processes and
divides up the CPU’s time appropriately. The kernel also contains the drivers for the hardware
devices installed in the system. The kernel is the core of the Linux operating system.
User space
The user space manages the user processes run by people working on the system. User
processes are things such as your e-mail client, Web browser, or word processor. These
processes work with the kernel to handle low level functions such as printing to the screen or
talking to storage hardware. But, since these functions are not handled in kernel space, a
corrupted user application will not bring the entire system down.
rnel space and user space provide an important separation. Drivers and other things that affect system stability run in kern
Directory Structure
File system: The way the files of an operating system are organized on the disk.
All the files are grouped together in the directory structure. The file-system is arranged
in a hierarchical structure, like an inverted tree. The top of the hierarchy is traditionally
called root (written as a slash /).
Linux sorts directories descending from the root directory according to their importance
to the boot process.
File systems from other hard drive partitions mount to directories beneath the root
directory, providing access to a single directory structure.
The File system hierarchy standard (FHS) governs the unified file system for Linux by
defining a standard set of directories, sub-directories and files.
Linux is case sensitive operating system.
Directory Description
The root directory, all directories are below the / (root directory)
/
of the system.
/bin Contains binary commands available to all users.
/boot Contains kernel and boot loader files.
/dev Contains device files.
/etc Contains system configuration files.
/home Contains by default the user home directories.
/lib Contains shared programs libraries and kernel modules.
/root Home directory for the root user.
/media Mount point for removable media.
/mnt Mount point for mounting a file system temporarily.
/opt Add-on application software packages.
/sbin Contains system binary commands.
/proc Contains information about system state and processes.
/srv Contains the files for services like FTP and Web servers.
/tmp Contains temporary files.
/usr Contains system commands and utilities.
/var Contains data files that are changed constantly.
Linux Distributions
Linux is actually just a kernel, so to create a complete Linux system you have to install the
source code of kernel and many other freely distributed software programs.
Usually distributions are put on CD that contains the kernel and programming tools and
utilities.
These distributions usually come with a setup program on CD to install a Linux system, they
have the same kernel but with different interfaces.
Some Linux distributions :
Ubuntu
Slackware
SuSE
Debain
RedHat
Fedora
Turbo Linux
Ubuntu
Canonical started sending out free compact discs with Ubuntu Linux in 2004 and quickly
became popular for home users (many switching from Microsoft Windows).
Canonical wants Ubuntu to be an easy to use graphical Linux desktop without need to ever see
a command line. Of course they also want to make a profit by selling support for Ubuntu.
Download Ubuntu
Go to the Official Ubuntu Download Page .
Choose Ubuntu 13.04, you can choose 32 bit or 64 bit then Click 'Ubuntu 13.04'.
To run Ubuntu from a USB stick, the first thing you need to do is insert a USB stick with
at least 2GB of free space into your PC. The easiest way to put Ubuntu onto your stick is
to use the USB installer provided at pendrivelinux.com. You’ll need to download and
install it as follow:
Click 'I Agree'.
Tip: You might be able to press ‘F12’ or ‘Escape’ while your computer is starting up to change your boot device order.
Depending on your computer and how your USB key was formatted, you should see an entry
for ‘removable drive’ or ‘USB media’. Move this to the top of the list to force the computer to
start from USB rather than the hard disk. Save your changes and continue.
Prepare to install Ubuntu
It’s recommended to plug your computer into a power source.
You should also make sure you have enough space on your computer to install Ubuntu.
Select Download updates while installing and Install this third-party software now.
You should also stay connected to the internet so you can get the latest updates while you
install Ubuntu.
Set up wireless
If you are not connected to the internet, you will be asked to select a wireless network, if
available.
That’s it.
All that’s left is to restart your computer and start enjoying Ubuntu!
Another way to install Ubuntu:
If you have any problem in installing Ubuntu from USB drive, you can try Windows installer,
which will install and uninstall Ubuntu in the same way as any other Windows application. It’s
simpler and completely safe.
Once the Windows installer has been downloaded, you need to open it to install Ubuntu.
To install Ubuntu, all you need to do is choose your user name and password. Do note that you
need to enter your password twice to make sure you typed it correctly.
After choosing your password, click 'Install'. The files will be downloaded and installed
automatically.
Wait until Ubuntu is downloaded and installed. This can take quite a while - the downloaded
file size is around 500MB - but you can keep using your computer throughout.
When the installation is complete, you’ll be prompted to restart your computer. Click 'Finish' to
restart.
After your computer restarts, choose 'Ubuntu' from the boot menu.
Best Wishes