lsn 10 linux overview - university of...
TRANSCRIPT
![Page 1: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/1.jpg)
Department of
Engineering Technology
LSN 10
Linux Overview
ECT362 Operating Systems
![Page 2: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/2.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 3: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/3.jpg)
ECT 362 Operating Systems [email protected]
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
– Linspire (Lindows)
– Ubuntu
![Page 4: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/4.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 5: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/5.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 6: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/6.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 7: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/7.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 8: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/8.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 9: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/9.jpg)
ECT 362 Operating Systems [email protected]
LSN 10 – Installing Linux
• System setup procedure
– Imaging a computer
– Hard drive partitioning
– Device driver verification
•
![Page 10: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/10.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 11: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/11.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 12: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/12.jpg)
ECT 362 Operating Systems [email protected]
LSN 10 – Linux Users
• Linux user accounts
– root
– user
– sudo
![Page 13: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/13.jpg)
ECT 362 Operating Systems [email protected]
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 manage the graphical environment elements
![Page 14: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/14.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 15: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/15.jpg)
ECT 362 Operating Systems [email protected]
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)
![Page 16: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/16.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 17: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/17.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 18: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/18.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 20: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/20.jpg)
ECT 362 Operating Systems [email protected]
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)
![Page 21: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/21.jpg)
ECT 362 Operating Systems [email protected]
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 | …
![Page 22: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/22.jpg)
ECT 362 Operating Systems [email protected]
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
![Page 23: LSN 10 Linux Overview - University of Daytonacademic.udayton.edu/scottschneider/courses/ECT362/Course Notes... · LSN 10 – Linux Overview ... Linux System Booting ... • Booting](https://reader031.vdocuments.us/reader031/viewer/2022022012/5b2432f37f8b9a9b208b4899/html5/thumbnails/23.jpg)
ECT 362 Operating Systems [email protected]
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