• No results found

LSN 10 Linux Overview

N/A
N/A
Protected

Academic year: 2021

Share "LSN 10 Linux Overview"

Copied!
23
0
0

Loading.... (view fulltext now)

Full text

(1)

Department of Engineering Technology

LSN 10

Linux Overview

ECT362 Operating Systems

(2)

LSN 10 – Linux Overview

• Linux

– Contemporary open source implementation of UNIX available for free on the Internet

– Introduced in 1991 by Linus Torvalds – UNIX OS introduced in 1973

• Small no-frills OS

• Kernel only contained essential functionality

• Source owned by AT&T Bell Labs (Lucent)

• 1989 released a common program interface POSIX

– First free form of UNIX source code

(3)

LSN 10 – Linux Distribution

• Includes OS

– Wide variety of supplemental tools

• Linux is the kernel of an OS, not a complete OS (just like UNIX)

• Common distributions

– Red Hat – Fedora – Mandrake – SUSE

– Debian

(4)

LSN 10 – Kernel Organization

• Linux uses a monolithic kernel

• All OS functions reside in a single executable software module except device management

– Device management is handled by a separate collection of device drivers and interrupt handlers

• Linux added a container called a module to the standard UNIX kernel organization

– Implement extensions to the main part of the kernel – Can be dynamically installed with OS running

(5)

LSN 10 – Kernel Organization

• Using Linux kernel services

– Kernel ADT

– Kernel software contains no threads of execution or processes

– User programs must link to the kernel code to use it

• Use a hardware trap instruction to keep user code from running in supervisory mode

• Serial execution

– Linux is a single-threaded kernel

– Kernel functions can operate without concern of being interrupted

(6)

LSN 10 – Linux Kernel Responsibilities

• Resource abstraction

– Creation of software to simplify the operations that must be applied to the hardware to cause it to function properly

• Device drivers

– The computer’s components are abstracted into processes and resources

– Manage allocating and deallocating the system’s resources to and from the processes as they execute

(7)

LSN 10 – Installing Linux

• Distribution

– Complete Linux system – http://ubuntu.com/

• Kernel Archive

– Linux kernel source code – http://www.kernel.org/

• Supported Hardware

http://hardware.redhat.com

(8)

LSN 10 – Installing Linux

• Types of installations

– Server

• 300-600 MB

• Does not include the graphical interface

– Standard desktop / workstation

• 600-900 MB

• Includes graphical desktop and common utilities

– Developer’s workstation

• 700-1300 MB

• Adds software development packages

– Complete installation

• 1.3 – 6+ GB

(9)

LSN 10 – Installing Linux

• System setup procedure

– Imaging a computer – Hard drive partitioning – Device driver verification

(10)

LSN 10 – Linux System Booting

• Dual boot systems

Requires a boot manager program to select desired OS to use

• GRUB

• LILO

• Booting procedure

i386 machines are typically designed to support Microsoft OSs

• Incorporate Basic I/O System (BIOS) in ROM

OS loaded from boot disk

• Contains Master Boot Record (MBR) at first logical sector

Details the disks physical layout

Kernel code is started by boot loader once the OS is placed into main memory

• Initial process starts the idle process

(11)

LSN 10 – Linux VM

• Virtual Machine

– Isolated OS running as an application on a host OS – Process VM (application virtualization)

– System VM (hardware virtualization)

• Run Linux on a virtual machine on top of another OS

• Oracle VirtualBox VM

(12)

LSN 10 – Linux Users

• Linux user accounts

– root

– user

– sudo

(13)

LSN 10 – The Linux Desktop

• A graphical display is optional in Linux

• Linux graphic display is based on the X Window System

– X server

• Program that communicates with the video card, keyboard, and mouse

– X client

• Any graphical application

– Window manager

• Special purpose graphical application

– Graphical libraries

• Collection of programming functions that X clients can use to

(14)

LSN 10 – The Linux Desktop

• Desktop interfaces

– Manage icons

– Manage multiple application environments (windows) – Provide basic user applications

• KDE

www.kde.org

• GNOME

– www.gnome.org

(15)

LSN 10 – The Linux Shell

• Provides an easy interface for user to run programs and work with files in Linux

• Types of shells

– Bourne shell (sh)

– Bourne Again shell (bash) – C shell (csh)

– Korn shell (ksh) – Z shell (zsh)

(16)

LSN 10 – The Linux Shell

• Linux Shell Commands (only a few)

cat – display requested text file ps – process status

ls – show list of files in directory pwd – print working directory grep – find text within a file

man – manual, provides in-depth information about requested command

cd– change to desired directory

chmod– change the file/directory permission

(17)

LSN 10 – The Linux Shell

chown – change owner of file/directory clear – clear the screen

cp – copy files

cmp – compare two files

finger – get user information

mount/unmount – mount or unmount a file system

su – switch user, or become super user if user name is not given, or change the user ID

top – to see process information in neat format whoami – about yourself

(18)

LSN 10 –The Linux Shell

• Shell scripts

– Shortcuts to perform a series of user commands – Written with plain-text (do not compose in a word

processor)

• Script format

– Requires a ‘shebang’ at the beginning – ‘#’ is used for comments

– ‘$_” is used to extract command line arguments

– ‘$(command)’ is used to replace self with results from executing the command in the ()

• Scripts must be made executable to operate

(19)

LSN 10 – The Linux Directory Tree

(20)

LSN 10 – The Linux File System

File system descriptors (using ls –l)

– Directories (d) – Links (l)

• The path

– PATH environment variable

• List of directories in the system where executable files can be found

– Path relativism

• Absolute paths start from the root directory (/)

• Relative paths start from current directory (pwd)

(21)

LSN 10 – The Linux File System

File system table (fstab)

– Lists all disks, disk partitions, and other storage devices for a given system

Located in the /etc directory

– Comprised of several fields depicting each storage devices’

setup

Device name | mount point | filesystem type | mount options | …

(22)

LSN 10 – /proc

• /proc is a virtual file system containing information about system resources

• Provides a mechanism for inspecting the kernel state

• Allows the use of read and write system calls to access the address space of another process

• Appears as a directory within the Linux file system

(23)

LSN 10 – Assignment

• Homework – HW 5

HMWRK5.pdf

• References

Using Linux:

http://www.linux.org/lessons/beginner/toc.html

Dalheimer, K. and Welsh, M., Running Linux, O’Reilly, 5th Edition, 2005

• This is a great Linux resource

Linux shell commands:

http://www.linuxcommand.org/index.php

Linux shell scripting:

http://www.freeos.com/guides/lsst/ch02sec01.html

References

Related documents

Penn Humanities Forum Mellon Undergraduate Research Fellowship, Final Paper April 2009. Tali Yahalom, College ‗09

For ISVs That Also Check the Linux Kernel Version Oracle Linux 7 ships with two sets of kernel packages:..  Unbreakable Enterprise Kernel which is installed and booted

Narratives offer a possibility to present a comprehensive reasoning and meaning of how participants act and react (Hammersley and Atkinson 2007; Reeves et al. Study III

Sudden cardiac death; J wave; Early repolarization; ST segment elevation; Cardiac arrhythmias; ventricular tachycardia; ventricular fibrillation; inherited cardiac

• KVM – the Kernel-based Virtual Machine – is a Linux kernel module that turns Linux into a hypervisor. • Tightly integrated into Linux and upstream since kernel 2.6.20

● The state match extension module, when combined with connection tracking, allows. access to the connection tracking state for

– Setup break points in kernel source – Run debug configuration. – Run debug to debug the