why linux? linux’ market share for computers is minor, why learn it? – windows: 90%+ – mac os...
Post on 15-Jan-2016
222 Views
Preview:
TRANSCRIPT
Why Linux?
• Linux’ market share for computers is minor, why learn it?–Windows: 90%+–Mac OS X: 8%– Linux/Unix: < 2%
• Linux/Unix is the basis for Mac OS X• Linux/Unix used in many handheld devices
(e.g., Android, Apple iOS-based products)
Why Linux?
• Linux/Unix is used extensively in other types of computing and related devices– Network routers–Wifi access points– Firewalls
• Most notably, Linux/Unix is used on most Internet servers– Nearly 2/3s of the top web servers run on
Linux/Unix
Why Linux
• Open source–Most versions of Linux are freely available–Most Linux application software is also freely
available– Open source community regularly updates Linux
operating system and application software so that security issues are fixed in a timely manner
– Applications are updated regularly to include more features that users will find appealing
Why Linux
• Greater control– Through the command line, Linux offers the user
the ability to precisely control their commands– This is not true of Windows or Mac OS X where
control is removed from the users hands
• Learning about operating systems– Through the command line interaction of Linux,
you are able to learn more about what an operating system is, what it does and how it functions
• Linux is cool!
What is an Operating System?
• Earliest computers had no operating system (OS)
• Programmers were responsible for handling all of the details of compiling and running their programs (see next slide)
• As the process became more complicated, programs called resident monitors were created to save the programmer some effort
What is an Operating System?• The OS is a program• It is comprised of many parts– Some of these parts are loaded into memory, some are
loaded only when needed– The core component is the kernel which stays resident
in memory
• The OS handles such tasks as– Process management– Resource management– Memory management– Input/output– User interface
What is an Operating System
• The user does not control the computer• The user initiates requests– The OS decides if the user has adequate access rights
to perform the requested actions and how to carry out those actions
– The kernel handles most of the significant operations– The user interface can be tailored, known as a shell– Communication with devices is handled through
device drivers
What is an Operating System
• The computer is segmented into layers– User at the top– Hardware at the bottom– Application software
and operating system components make up intermediate layers
Linux: The GUI
• Although we will primarily interact with Linux through the command line, there are different desktops available
• We explore two here– Gnome – KDE
• Both are based on an older interface system called X-Windows
Linux: The GUI• Logging in– Select user name
from list – Enter password– or – Click other– Enter username– Enter password
Linux: The GUI• If both Gnome and KDE are available, you can
switch between GUI desktops at the login window before logging in
Linux: The GUI
Gnomedesktop
Linux: The GUI
• Gnome top-level menu selections– Applications– Places– System
• Accessories submenu of Applications shown to right– Notice “K” software are
primarily for KDE but available in Gnome
Linux: The GUI
• System Tools submenu
Linux: The GUI• Places menu opens file browser windows• Here, we see the Computer (all mounted
devices) window open
Linux: The GUI• Opening up the Filesystem folder, we see the
Linux top-level directories (starting at /)– Notice some directories have an X by them– These are not accessible to the current user
Double click on any icon opens a new window for that directory
Linux: The GUI
• Preferences submenu of System
• These selections are available to non-root users
Linux: The GUI
• The Administration submenu
• Most of these selections require authentication a root
Linux: The GUI
• Right clicking in the desktop brings up this pop-up window
• Select Open in Terminal to open a terminal window
Linux: The GUI• KDE Desktop
Linux: The GUI
• KDE Program Button Applications Menu
Linux: The Command Line
• The command line is part of a shell• The shell includes– The command line interface (CLI) which is the
command line and prompt– Any previously defined entities• functions• aliases• variables• previous instructions as part of a history list
– The shell’s interpreter
Linux: The Command Line
• The interpreter is a program– Its responsibility is to interpret instructions– By interpreting, it translates each instruction on the
command line into an executable statement– Interpreters are found in many programming
languages (e.g., Python, Ruby, LISP)– Interpreters are used in most CLIs–We explore the interpreter in more detail in chapter
2
Linux: The Shell
• The shell is a tailorable environment– The environment consists of previously defined
terms and instructions– The shell allows you to define shortcuts in
executing future instructions– Different Linux shells have different features• We will concentrate on the BASH shell• We explore the BASH shell in chapter 2
Linux: The Shell
A view of what theshell offers
Editing support includeskeystrokes to repositionthe cursor and cut/copyand paste characters
Linux: The Command Line
• Advantages of the GUI:– Less to learn and easier
to control– Intuitive– Visual– Fun– Allows for easy
multitasking
• Advantages of the CLI– Control– Speed– Less resource intensive– Limits wrist strain– You learn more about the
OS through the CLI
Virtual Machines
• Software emulation– Computer emulates the another type of computer– Used to run software compiled for a different
platform
• Virtual machine– Software running on your computer emulating
another platform– The VM is a combination of the software and data
that captures the other platform’s operating system
Virtual Machines: Advantages
• Multi-platform experimentation• Cost savings and scalable – By using VMs, your organization will require
fewer physical computers
• Power consumption reduction– Follows on from having fewer computer resources
• Cross-platform software support• Security–Malware is not set up to attack the internal content
of a VM so that VM is protected
Virtual Machines: Advantages (cont)• Fault tolerance– Using 2 or more VMs you can balance workloads
among the VMs
• Administrative experience– For an educational setting, you can allow students
to become system administrators
• Controlling others’ environments– Through virtualization, you can access other VMs
remotely
• Collaboration• Remote access
Virtual Machines: The Cost• Obtaining the VM software– To take full advantage of virtualization, you need
virtual servers which are often expensive– VM client software is often free
• The OS’s– You will have to obtain installation copies for the OS’s
you wish to install, which might cost money
• The load on the computer– VM software is processor and memory intensive
• VM storage space– A typical VM might require between 8GB and 30GB of
storage space, a lot of VMs can take up TBs of storage
History: Unix and Linux• Unix was first implemented in 1969 for the
DEC PDP-11 by Dennis Ritchie and Ken Thompson of AT&T Bell Labs
• They intended to have a platform independent OS but the first version, called Unics, was written in the PDP-11 assembly language
• They developed the C programming language and re-implemented the OS as Unix, truly platform independent– All you needed was a C compiler
History: Unix and Linux• Numerous versions were released between 72
and 80– One version would run on Intel 8086 architectures
such as the IBM PC– Unix was not free
• 1983: Richard Stallman (MIT) began his GNU project– GNU = GNU not Unix– A project to develop a free and open source OS
that was Unix-like but not Unix
History: Unix and Linux
• Mid 80s: Ken Thompson, on a sabbatical from AT&T went to the University of California Berkeley– There, he and others developed BSD Unix– This version contained networking features to
support TCP/IP– This version was made available for free to many
organizations, particularly universities– BSD 4.2 would become the most widely distributed
version of Unix at the time
History: Unix and Linux
• 1990: Open software foundation formed• 1992: AT&T eventually filed a lawsuit against
UC Berkeley for using proprietary code from AT&T’s Unix to build UCB– This is sometimes referred to as the Unix Wars
• In between in 1991, Finish student Linus Torvalds begins developing his own OS–With help from people in the open source
community
History: Unix and Linux
• Stallman developed the GPL (GNUs General Public License)
• Much of Linux has been published under the GPL
• The first versions of Linux were released in 1991 with developers helping to improve and add features every year
• The GNUs Project never released a working kernel
History: Unix and Linux
• There are many versions of Unix and Linux now available– Most versions of Linux are free and open source (but
not all, for instance Red Hat Enterprise Linux)
• Among the most popular distributions of Linux are– Debian– Red Hat (including Fedora and CentOS)– SLS/Slackware (originated in Germany)– Ubuntu – started off as a Debian distro but has found its
own path)
Users: Accounts• There are two general types of user accounts
in Linux: normal users and superusers– Superusers, also called root, are system
administrators with access to all system commands and resources
– Normal users, usually humans, have limited access primarily to just their file space and publically accessible software and commands
– Normal user accounts can also be set up for software which will have even more restricted access
Users: System Administrators
• Every Linux system requires an administrator– The root account could be shared among several
although this may be deemed a security risk–Many activities cannot be handled by a normal
user such as• Creating new accounts• Installing software• Controlling services• Accessing certain files• Controlling the Firewall
Users: System Administrators• The following list is common to many system
administrators. – install the operating system, – update the operating system when needed, – configure the operating system to fit the needs of
the users in the organization, – secure the operating system, – configure and maintain network communication, – install, configure and maintain application
software, – create and manage user accounts and ensure the
use of strong passwords,
Users: System Administrators (cont)– install and troubleshoot hardware connected to computers
directly or through a network, – manage the file system including partitioning the disk
drives and performing backups, – schedule operations as needed such as backing up file
systems, mounting and unmounting file systems, updating the operating system and other application software, examining log files for troubleshooting and suspicious activity,
– define (for your organization’s management) computer usage policies and disaster recovery plans,
– create documentation and training materials for users, – make recommendations for system upgrades to
management.
What is a Computer? The IPOS Cycle• Input: obtaining raw data from the user• Processing: operating on the data to turn it into
information– Handled by the processor
• Output: displaying the information in a human readable format to the user
• Storage: storing the data/information– This might be the raw data, the processed information
or some intermediate form– We also store program code– Storage typically means secondary storage such as disk
drive, not memory which is part of processing
What is a Computer? The IPOS Cycle
What is a Computer? CPU
• The processor (central processing unit, CPU)– Performs the fetch-execute cycle• Fetch next program instruction from memory• Decode the instruction into actions• Command the relevant part(s) of the computer to
operate to execute the instruction• Store the result somewhere (if necessary)
What is a Computer? CPU• The CPU consists of– Control Unit
• Handles the fetch-execute cycle• Controls the other components of the computer through
signals• Contains registers (storage locations) for important pieces
of information like the memory location of the next instruction in the program and the current instruction
– Arithmetic Logic Unit (ALU)• Digital circuits to perform arithmetic and logic operations• Data registers to store data being used by the current set
of instructions
What is a Computer? CPU
• Consider an example: –We write the instruction A = B * (C + D)– This is broken into several lesser instructions• Load C into a data register• Add D to the data register storing C• Multiply B to the data register storing C + D• Store result in A
What is a Computer? CPU• Registers:– Data registers– Program Counter – store location of next program
instruction in memory– Instruction Register – store current instruction– Status Flags – store information about last
operation (was it negative, zero, positive, did it cause an overflow or carry, did the result have even or odd parity, did the instruction cause an error?)
– Stack Pointer – store location of the top of the run-time stack where we store information about the program’s currently executing function
What is a Computer? Memory• Several forms– Registers (SRAM)– Cache (on-chip and off-chip) (SRAM)–Main memory (DRAM)• the above forms are volatile, require a constant power
supply to retain the contents• another form, ROM, is non-volatile but very limited in
its usage
– Secondary storage (hard disk, optical disk, flash memory)
What is a Computer? Memory
• These forms of memory make up the memory hierarchy – Faster forms of memory are located higher in the
hierarchy• As they are more expensive, we have less of that form• But we want to use the faster forms• How do we keep the contents that we need in the
higher/faster forms when there is less
What is a Computer? Other
• I/O – input and output devices– Keyboard, mouse, touch screen, microphone–Monitor, printer, speakers
• Storage – the lower portions of the memory hierarchy– The hard disk is the most common form–We also have optical disc, magnetic tape and flash
memory• these form permanent storage
What is a Computer? Software• Software are the programs that the computer
runs–Without software, the computer does nothing
• A program is a step-by-step description of how to solve a problem written in a language the computer can execute–Machine language
• We write programs in easier languages like C++ or Java and convert them into machine language using a program called a compiler
What is a Computer? Software
#include <stdio.h>
int main() { int a, b, c; printf(“Enter three numbers: “); scanf(“%d %d %d”, &a, &b, &c); if(a>b&&b>c)
printf(“%d is the greatest\n”, a); else if(b>a&&b>c)
printf(“%d is the greatest\n”, b); else
printf(“%d is the greatest\n”, c); return 0;
}
Example C program to determine the largestof 3 input numbers
What is a Computer? Types
• Computers vary by– Size– Computing power• and other resources such as amount of main memory,
number of storage devices
– Expense
• Computers range from– Handheld devices like smart phone to tablets– To desktop units and laptop computers– To servers– To mainframe and super computers
What is a Computer? TypesType Number of
CPUs/Cores DRAM Storage Devices Typical Cost Operations per
secondSupercomputer Thousands to
hundreds of thousands
100s to 1000s GBytes
Storage area networks $ Tens of millions
TFLOP to PFLOP range
Mainframe Hundreds to thousands (or more)
Dozens to 100s of GBytes
Server storage or storage area network
$100,000 - $1 million
GFLOP to TFLOP range
Server 1-8 multicore (up to 8 cores)
Up to 32 GBytes Many hard disk drives (up to dozens)
$5,000 - 15,000 GFLOP range
Desktop 1-2 multicore (up to 8 cores)
4-16 GBytes 1-2 Hard disk drives Optical disk drive Numerous USB ports
Under $2,400, often around $1,200
GFLOP range
Laptop 1 multicore (up to 8 cores)
4-16 GBytes 1 Hard disk drive Optical disk drive A few USB ports
Under $1,200, often around $900
GFLOP range
Tablet 1 4-8 GBytes USB port, small capacity hard disk drive
$300-$700 Up to GFLOP range
Smart phone 1 Up to 2 GByte USB port, internal storage (flash or disk) up to 64 GBytes
Under $500, often under $200
Hundreds of MFLOPs up to 1 GFLOP
top related