Anda di halaman 1dari 7

CSE207 ASSIGNMENT-1 SOLUTIONS

1. What’s need of dual boot system? What is the role of boot loaders?
Ans. Dual boot also called a multiboot, an operating system configuration that enables the user to
boot the computer system from one of two different operating systems that are both installed on
the same hard drive. The operating system that is loaded is given control, typically through a
boot management program that will override the original MBR and load instead of an operating
system.
THE NEED OF DUAL BOOT SYSTEM
 It is useful when several softwares requires different operating system and cannot run on
a single system.

 It allows a user to use all of this software on one computer.

 It is useful if one needs to test a new operating system without switching completely.

 It is also used to get to know about new system ,configure all new operating system ,and
migrate date before making final results and to remove old operating system.

 Multi booting can also aid software developers where multiple operating systems are
required for development or testing purposes. Having these systems on one machine can
greatly reduce hardware costs.

ROLE OF BOOT LOADERS:-


A boot loader, also called a boot manager, is a small program that places the operating system
(os) of a computer into memory. When a computer is powered up or restarted, the BIOS
performs some initial tests, and then transfers control to the Master Boot Record (MBR) where
the boot loader resides.
For Linux the two most common boot loaders are known as LILO ( Linux Loader) and
LOADLIN (LOAD LINux). An alternative boot loader, called GRUB (Grand Unified
Bootloader), is used with Red Hat Linux. Most processors have a default address from which the
first bytes of code are fetched upon application of power and release of reset. Hardware
designers use this information to arrange the layout of Flash memory on the board and to select
which address range(s) the Flash memory responds to. This way, when power is first applied,
code is fetched from a well-known and predictable address, and software control can be
established.
The bootloader provides this early initialization code and is responsible for initializing the board
so that other programs can run. This early initialization code is almost always written in the
processor’s native assembly .
2. Compare & contrast between Windows vs. Linux Operating system?

Ans.
Windows Linux
Graphical The window shell. This uses as its window A no. of desktop environment are available
user manager on window vista , and a stacking of which GNOME and KDE are the most
Interface window manager build on top of GDI in older used.
versions. The desktop environment may be
modified by a variety of third party products.

Commands The command prompt exists for power users. The linux is strongly integrated with the system
line interface command line can be used to recover the system console. The command can be used to
if the graphics sub system fails. A net based recover the system if the graphics sub syste
command line environment called windows fails. A large no. of UNIX shells exits ; wit
power shell has been developed the majority being “Bourne Shell
Compatible” shells, of which the most
widely used is GNU BASH.
Cost Windows is expensive For desktop or home use, Linux is very
cheap or free.
Starting with Windows XP, they use software to In contrast, once you have purchased Linu
enforce this rule (Windows Product Activation at you can run it on any number of computers
first, later Genuine Windows). for no additional charge.

File systems Windows Natively supported: NTFS, FAT, ISO Linux Natively supported: ext2, ext3, ext4,
9660, UDF, and others; 3rd-party drivers ReiserFS, FAT, ISO 9660, UDF, NFS,
available for ext2, ext3, reiserfs, HFS, and others NTFS, JFS, XFS and others; many addition
filesystems (including NTFS using NTFS-
3g) are available using FUSE. Archives and
FTP sites also can be mounted as
filesystems.

Boot Loader Windows May boot to multiple operating systems Linux May boot to multiple operating
through the Windows Boot Manager, in Windows systems through LILO or GRUB. With thes
Vista and newer; or the Microsoft boot loader, it is possible to choose between multiple
NTLDR, in Windows Server 2003 and prior. installed kernel images at boottime.
Numerous graphical configuration tools are Graphical configuration tools for GRUB ar
available, such as Easy BCD for the Windows available including KGRUBEditor (KDE)
Boot Manager and MS Config for NTLDR. and GrubConf (GNOME). GRUB can also
Windows Does not generally allow booting to be configured at boottime via the GRUB
any OS other than a Windows installation or DOS prompt (this is a temporary one-time-
configuration only). GRUB and LILO also
support booting to non-Unix operating
systems via chain loading
Package Modern versions of Windows rely on the In Linux most distributions have a package
management Windows Installer as their package manager. This manager, often based upon RPM, APT, or
system registers what components are installed where on Gentoo Ebuild met packages (source).
the user's system. The Windows package Sometimes an installation can have a secon
management system depends on software vendors package management system which is
following certain guidelines. However, many incompatible with the primary system.
applications are still deployed with alternative Numerous distribution-specific front-ends
installers. One example is NSIS. Applications are exist on top of the core formats allowing fo
typically installed into the Program Files GUI or command-line package installation
directory by an executable file. e.g. aptitude, Synaptic, Portage, YaST and
YUM. Though rare, some distributions crea
their own formats

3. What is the File system? Its Role, various types, its Hierarchy in Linux.
ANS:-
FILE SYSTEM:-
A file system is a method for storing and organizing computer files an the data they contain to
make it easy to find and access them. A file system is a database of files and directories that you
can attach to a Unix system at the root (/) or some other directory (like /usr) in a currently
attached file system. At one time, file systems resided on disks and other physical media used
exclusively for data storage. However, the tree-like directory structure and I/O interface of file
systems is quite versatile, so file systems now perform a variety of tasks
File-system Types:-
1. Disk file system:-
A disk file system is a file system designed for a storage of files on a data storage device, most
commonly a disk drive, which might be directly or indirectly connected to the computer.
Ex ext3, ext4, ISO 9660,ZFS
2. Flash file system
It is a file system designed for storing files on flash memory device. these devices impose no
seek latency.
Ex JFFS2, YAFFS
3. Network file system
It is a file system that acts as a client for a remote file access protocol, providing access to files
on a server.
Ex SMB, AFS, NFS
4. Special purpose file system
It is basically any file system i.e. not a disk file system or network file system. These are most
commonly used by file-centric operating systems such as UNIX.
Ex include the procfs (/proc) file system used by some unix variants.
Mostly Linux uses ext3 file system. You can know by using the command given below.
a) EXT2 - Extended 2
b) EXT3 - Extended 2 + Journal
c) JFS - Journal file system
d) Resier - Advanced Journal
e) LVM - Logical Volume manager
f) VFAT - FAT 16 / 32
g) NTFS

Hierarchy:-
The file system hierarchy standard defines the main directories and their contents in most
software systems using UNIX and UNIX like operating system.
Linux system has a root directory (/). The root contains several subdirectories and possibly a
file or two. The names of the directories in / have special meanings that pervade the Linux
system in many other subdirectories. For example, there is a /bin directory in the root, but there
are also many other bin directories throughout the system, including /usr/bin and /usr/local/bin.
All of these bin directories contain executables.

directory Description

/ Primary hierarchy root and root directory of the entire file system hierarchy.

/bin/ Essential command binaries that need to be available in single user mode

/boot/ Boot loader files

/dev/ Essential devices

/etc/ Host specific system wide configuration files

/home/ User’s home directory containing saved files etc.

/lib/ Libraries essential for the binaries

/proc/ Virtual file system documenting kernel and process status as text files
/root/ Home directory for the root user

4. Define the term shell. Various types of shells. How a shell differ from a virtual console?
It is an intermediary program which interprets the commands that are typed at the
terminal and translates them into commands that are kernel understands. The shell acts as a
blanket around the kernel and eliminates the need for the programmer to communicate directly
with the kernel. It acts as an interface between user and operating system itself. It has almost the
features of high level language. It has variables, conditional statements, control statements,
functions.
The shell
• Reads the command.

• Searches for and locates the file with that name in the directories containing
commands.

• Loads it into memory, and

• Executes it.

TYPES ( REFER TO NOTES GIVEN IN CLASS)

Virtual console: It is abbreviated as VC which is a specialized section of wii shop


channel an online service that allows players to purchase and dowmload games and
other software. When running Linux on pc , we frequently work with the display and
keyboard attached to the computer. Using this physical console, we can access as
many 63 vc. Some are set up to allow logins, whereas others act as graphical
displays. To display VC , hold down the CONTROL and ALT keys and press the
function key that corresponds to the console. For example ,CONTROLALT-F5
displays the fifth VC.
Shell Name A Bit of History

sh (Bourne) The original shell from early version of linux


csh, tcsh and zsh The C shell and its derivatives, originally created by Bill Joy of Berkeley
UNIX fame. The C shell is probably the third most popular type of shell
after bash and the Korn shell
ksh, pdksh The Korn shell and its public domain cousin. Written by David Korn, this is
the default shell on many commercial UNIX versions.
Bash The Linux staple shell from the GNU project. Bash, has the advantage that
the source code is freely available. It has many similarity to the Korn shell.

5. Give command to perform following operations:


1. Create a directory tree under Home directory
Ans. $cd (press enter)
$mkdir abc (press enter)
$cd abc (“)
To make file:-
$ cat (“)

To make another directory


$cd (“)
$mkdir fgh
s
2. Display Current Working directory?
Ans. $pwd

3. Display the name of user’s Home directory using environment variables?


Ans. %HOMEPATH%

4. Allow all group users to modify the contents of ABC.txt file?


Ans. $chmod g-rwx ABC.txt

6. Illustrate the steps to write, compile and execute a C program in Linux environment
using a program to find largest of 3 numbers.
Ans. #!/bin/bash
echo “ enter any three number “
read a b c
if [ $a –gt $b –a $a –gt $c ]
then
echo “ largest number is $a “
elif [ $b –gt $c ]
then
echo “ largest number is $b “
else
echo “ largest number is $c “
exit 0

Anda mungkin juga menyukai