Presentation is loading. Please wait.

Presentation is loading. Please wait.

UMBC CMSC 104 – Section 01, Fall 2016

Similar presentations


Presentation on theme: "UMBC CMSC 104 – Section 01, Fall 2016"— Presentation transcript:

1 UMBC CMSC 104 – Section 01, Fall 2016
Operating Systems

2 Saw This On Reddit…

3 Notes & Announcements Thursday will be a lab day. We will do part 1 of Project 1 together. If you can’t make it, the project will be posted after class Next Tuesday we will not have class. …but it’s a great time to do part 2 of Project 1 if you haven’t finished it by then. Next Monday I will be giving a talk at the Microsoft office in Elkridge (15 minutes from here) from 7-9 PM Topic: Getting started with Universal Windows Platform development Open to the public. Also, Pizza! More info & registration: aka.ms/uwpdevtalk

4 Fractions in Alternate Number Systems
A7.BC16 10 x 161 160 7 11 16-1 .6875 12 16-2

5 Operating Systems Overview
Topics What is an Operating System? Types of Operating Systems Interacting with an Operating System Linux Overview Frequently Used Linux Commands Emacs

6 What is an Operating System (OS)?

7 What is an Operating System (OS)?
The base software that makes your computer work Performs many operations, such as: Allows you to communicate with the computer (tell it what to do) Controls access (login) to the computer Keeps track of all processes currently running Has code to do common tasks like writing to disk, displaying a graphic, etc. At this point, your main concern is how to communicate with the computer using the OS

8 Major Operating Systems
Microsoft Windows UNIX Variants Apple macOS / iOS Built on Darwin, a UNIX variant Linux Chromium Android

9 Lesser-known Operating Systems
DOS variants MS DOS, PC DOS, FreeDOS Still used often in Point of Sale systems UNIX variants BSD, AIX, IRIX Mostly for servers OS/2 ReactOS Haiku TempleOS

10 Interacting with an OS Two primary types of OS Interfaces
Typically the user is able to interact directly with the OS using I/O devices Keyboard, Mouse, Touchscreen, Microphone, etc. Two primary types of OS Interfaces Command Line Interface (CLI) Graphical User Interface (GUI)

11 The Command Line Interface
Text-only Main method of interaction for first PCs Still frequently used by power users A fast, efficient way to perform certain tasks Great for scripting and repeatable tasks Create 10,000 empty files. 2 minutes via CLI, HOURS via GUI A favorite for programmers, and our focus for this class No need to complicate things…

12 The Graphical User Interface
Text + Graphics Often uses a mouse or touchscreen Point & Click or Tap & Swipe More User-friendly Easier for novice users Provided by nearly all modern OSes, although it is often optional Yes, you can still run Windows, macOS, and Linux without a GUI!

13 The Shell The Shell is the part of the OS that you interact with GUI
CLI Windows Explorer DOS/PowerShell macOS Aqua BASH, others Linux GNOME, others

14 Remote Connectivity One advantage to CLI interfaces is they provide a very low bandwidth way to connect remotely Works great even with a slow or high-latency connection telnet is a very simple protocol that provides connectivity to the CLI of a remote machine Instead of sending characters and control data to the local computer's screen, send it over a network connection Very simple, but also very insecure -- anyone "listening" can see everything! Secure Shell (SSH) is like telnet, but with encryption Similar simplicity to telnet, much more secure We will be using SSH for this class

15 Linux

16 A Brief History of Linux
Started in 1991 by Linus Torvalds while he was a student at University of Helsinki Initially envisioned as a free replacement for MINIX MINIX was a minimal UNIX-like OS for PCs targeted at students with freely available source code but expensive licensing terms Originally not licensed for commercial distribution; later changed to GNU GPL license Quickly embraced and extended by the community

17 The Origins of Linux From: (Linus Benedict Torvalds) Newsgroups: comp.os.minix Subject: What would you like to see most in minix? Summary: small poll for my new operating system Keywords: 386, preferences Message-ID: Date: 25 Aug 91 20:57:08 GMT Organization: University of Helsinki Lines: 20 Hello everybody out there using minix - I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I'd like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things). I've currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I'll get something practical within a few months, and I'd like to know what features most people would want. Any suggestions are welcome, but I won't promise I'll implement them :-) Linus PS. Yes - it's free of any minix code, and it has a multi-threaded fs. It is NOT protable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that's all I have :-(.

18 The UNIX Family Tree

19 Linux Today Powers billions of computers worldwide
Every Android & Chromium Device The majority of modern internet servers Many supercomputers and special purpose computers Still directed by Linus Torvalds Built by contributions from thousands of developers and corporations since 1991

20 Linux on Desktop Computers
As of June 2016…

21 Linux on Mobile Devices
As of August 2016…

22 Linux on Web Servers As of June 2016…

23 Why Linux? Community Availability Price “Freedom”
Linux has a huge academic and business community built around it Availability Linux (and it’s associated source code) is available for nearly every conceivable platform Price Because the GNU GPL license specifies that source code must be provided with every distributed copy, Linux is freely available “Freedom” Anyone can do anything they want with Linux; you’re free to customize it however you want, as long as you make the source code freely available.

24 Linux Distributions

25 Linux Distributions

26 Logging into Linux On a UMBC Lab PC From Home
Launch VMWare Workstation Choose Linux VM & power it on Wait for it to boot Log in at the prompt Launch Terminal From Home Windows: PuTTY, Bash on Ubuntu on Windows PuTTY also available on UMBC Lab PCs macOS: Terminal See slides from first class

27 Accessing UMBC GL Machines
UMBC provides internet-connected Linux machines for development and general use Connect via SSH Note to Windows users: PuTTY is an SSH client All projects will be tested and graded here The version of Linux installed in lab machines is NOT guaranteed to be the same as GL To connect to GL: Open a Terminal window Connect via SSH using the following command ssh

28 Accessing GL Machines (con’t)
When you connect the first time via SSH, you may see a prompt asking you to accept a certificate. Type yes. A warning screen appears before a password prompt. When you type your password at the prompt, you will not see any characters or cursor movement. This is for your protection. After a successful login, you will see your last login date and time (if applicable) and the “Message of the Day” (aka motd). UMBC’s motd hasn’t changed in years…

29 The Linux Command Prompt
When you log in to the Linux system here, a user prompt will be displayed. It might look like this: linux#[1]% _ …where # is the number of the Linux server that you have connected to. You may use any of the Linux servers. The number in the brackets will change as you work. It is the “number” of the command that you are about to type. If this prompt is not on the screen at any time, you are not in the shell and are not communicating with the OS.

30 Files A file is a sequence of bytes. It can be created by
a text editor (emacs, nano, etc) a computer program (such as a C program) It may contain a program, data, a document, or other information . Files that contain other files are called directories (sometimes called folders).

31 Linux Filenames Restrictions
May not contain certain reserved characters Have a maximum length Are case sensitive Note: This is NOT the case with Windows! It is best to stick with filenames that contain letters (uppercase or lowercase), numbers, and the underscore ( _ ) for now.

32 Directories Directories contain files or other directories called subdirectories. They may also be empty. Directories are organized in a hierarchical fashion. They help us to keep our files organized.

33 Directories (con’t) /afs/umbc.edu/users/j/d/jdoe28 junk recipes notes
pies cookies CMSC104 apple peach choc_chip

34 Directories (con’t) Directory Structure of jdoe28 jdoe28 junk recipes
pies apple peach cookies choc_chip notes CMSC104

35 Directories (con’t) Your home directory is where you are located when you log in (e.g., /afs/umbc.edu/users/j/d/jdoe28). Tip: type cd at the shell prompt (with no arguments) to return to your home directory The current directory is where you are located at any time while you are using the system. Files within the same directory must be given unique names. Remember that Linux filenames are case sensitive. Hello.txt and hello.txt are two different files! Paths allow us to give the same name to different files located in different directories. Each running program has a current directory and all filenames are implicitly assumed to start with the name of that directory unless they begin with a slash.

36 Subdirectories Are used for organizing your files For example, CMSC104
make a subdirectory for CMSC104 make subdirectories for each project CMSC104 project project project8

37 Moving in the Directory Tree
. (dot) is the current directory. . . (dot-dot) is the parent directory. Use the Linux command cd to change directories. Use dot-dot to move up the tree. Use the directory name to move down. Use the complete directory name (path name) to move anywhere.

38 Frequently Used Linux Commands
pwd, ls, cd – Directory Viewing mkdir, rmdir – Directory Manipulation cat, more – File Viewing cp, mv, rm, touch – File Manipulation clear, man, history , who ctrl-c, ctrl-z References: Linux man page Links from the 104 homepage Books and the Internet

39 Directory Viewing Commands
cd Change Directory Can change to absolute path (beginning with /) or relative path (beginning without /) pwd Print Working Directory Displays full path of your current directory ls List files in directory Use ls –al to get more detailed view

40 Directory Manipulation Commands
mkdir Make Directory Absolute or Relative paths rmdir Remove Directory

41 File Viewing Commands cat more Short for concatenate
Dumps file contents to terminal more Displays file on terminal, one page at a time Use Page Up and Page Down, arrow keys, etc. to scroll Press q to quit

42 File Manipulation Commands
cp Copy (cp <source> <destination>) Works with absolute and relative paths mv Move (mv <source> <destination>) Also useful for renaming rm Remove (aka delete) touch Creates a blank file if one does not exist Updates timestamp on existing file

43 Miscellaneous Commands
clear Clears the terminal screen man Manual Page Shows you instructions on how to use a command e.g. man ls history Shows you commands you have previously run Cycle through your previous commands using the up arrow who Displays users logged into system and what they are running

44 Wildcard Characters You will find wildcard characters useful when manipulating files (e.g., listing or moving them). The wildcard characters are * and ? ? is used to represent any single character. * is used to represent 0 or more characters.

45 Text Editors in Linux Because the command line is text based, there are a number of text editors available Generic nano Special-purpose emacs / xemacs vi / vim

46 Using nano The nano text editor works like you would expect any standard text editor to. Arrow keys to move around, tabs with tabstops, etc. Shortcut options (like save and exit) are available at the bottom of the screen. In this context, the ^ character represents the Ctrl button.

47 Using emacs The emacs editor provides a lot more functionality, especially for programming It’s also a lot more complicated… Emacs also has a GUI frontend. If you’re in the lab and running Linux via VMWare, this should appear. Otherwise the text-only version will appear Launching emacs with no parameters will display the help screen

48 Emacs

49 Emacs Shortcuts Emacs shortcuts typically begin with C- or M-
C- means Ctrl, then the specified key M- means Meta (aka Escape), then the specified key You can quit emacs at any time using C-x C-c That’s Ctrl-x then Ctrl-c If you’re working on an unsaved file, you will be prompted to save. I’ve posted a list of common emacs shortcuts on the class webpage

50 What Editor Should I Use?
You can use whatever editor you want for this class. If you plan on taking more CMSC courses, it may behoove you to learn emacs A purpose-built editor like emacs makes adhering to the coding standards easier

51 Questions?


Download ppt "UMBC CMSC 104 – Section 01, Fall 2016"

Similar presentations


Ads by Google