Download presentation
Presentation is loading. Please wait.
Published byShavonne Nelson Modified over 9 years ago
1
Chapter 1 What is Unix? By C. Shing ITEC Dept Radford University
2
Objectives Understand Unix history Describe Unix components Understand Unix features Introduce vi editor
3
Unix Pre- History 1960 CTSS (MIT Time-sharing system): main frame supports 30 terminals 1965: Multics (Bell Lab, MIT, GE) –design 24/7 OS up to 300 terminals, completed in 1975
4
Unix Brief History 1969 (Bell Lab out of Multics project) Ken Thompson design Unics for playing computer game –use DEC PDP-7 assembly language –machine dependent 1973 Dennis Ritchie+ Thompson, Bell Lab –more than 90% code in 1970 Ritchie’s C language –machine independent 1977 BSD (UC Bekeley Software Distribution – Bill Joy): Sun microsystem based 1979 Version 7, Release 4 (SVR4): standard version,, support PC –Used for 2 Unix branches: AT&T System V & UC Berkeley BSD
5
Unix Brief History – AT&T System V 1980 (AT&T System III ): Implement different memory management algorithms 1983 (System V copyright, restrict source code access) : virtual memory, Bourne shell, IPC: message, shared memory, semaphores 1984 GNU (Not Unix): (Free Software Foundation-Richard Mathew Stallman): –Free Unix concept: free software –GNU GPL (General Public License-”copyleft”- open source): freedom to run, copy, distribute, study, change, improve software –More people use, debug, more secure –Free Unix version Software: GNU C, EMACS, GNU C Library, bash shell (1990) 1984 X Window (GUI by MIT) 1986 Minix- mini Unix for PC by Tanenbaum (Harvard) 1988 XFree86: Free X Window on PC
6
Unix Brief History – AT&T System V (Cont.) Other Unix System V Based Systems: –V.2 IBM AIX OSF/1 –V.3 –V.4, 1986: Korn shell –V.4.1, 1990 SUN OS (Solaris), HP/UX
7
Unix Brief History – Berkeley BSD (Cont.) BSD (Berkeley Standard Distribution): –Supports socket networking, C shell, vi –4.2 Apollo –4.3, 1990 SUN OS (Solaris), HP/UX –4.4, 1992: NSF Stop funding BSD development FreeBSD
8
Linux Brief History 1991 Linux by Linus Torvalds (Finland): reimplementation of minix (small Kernel) for intel 386PC architecture –using Bash shell & GNU C –Unix Like, Multitasking –Free download version 0.02 from FTP catalog Linux –Develop Linux based on POSIX on http://www.kernel.org 1992 POSIX.1(Portable Operating System Interface): IEEE standardize API: system calls (1988) and commands (1992)
9
Linux Brief History (Cont.) 1994 Linux 1.0 use X window: penguin bite little Torvalds –Kernel Version: main.secondary.release-update (e.g 2.6.18-92.e15) main& secondary version # –Even #: stable version (e.g. 2.6.xx) –Odd #: under development (e.g. 2.5.xx) –Distribution (Kernel+Software+Tools+Documentation) #: rpm installation: CentOS 7.0 (Fedora Linux), RHEL(Red Hat), SuSE Dbkg installation: Ubuntu, Debian, B2D –GUI: X server KDE GNOME –Small kernel – good for embedded system: for PDA, Cell Phone, digital camera, home appliance –Use less power, require less powerful hardware to run, stable- good for server 2002 POSIX.2: Standard UNIX Specification (or SUS)
10
Open Source License GPL:GNU, free BSD: Berkeley Software Distribution –similar to GPL Apache License: any modification must named Apache
11
Linux Disadvantage Non-Profit Organization Developer Command Based Control Lack of Graphics Support Lack of gaming Application Lack of Education
12
Linux Small Home Server Minimum Requirement CPU: Pentium III-500 RAM: 512 MB Disk: 20 GB VGA RAM (for Console): use X Window - 32 MB NIC: 10/100 Mbps VGA Card: Nvidia, ATI
13
Unix Components Kernel: in RAM –System calls –Interrupts File systems: directory structures (tree) –Directory contains filenames and location of files –Every device is a file Process management: share –CPU: time slice 1/10 sec, round-robin –RAM: fixed size page –Disk: fixed size block(1024 Bytes)
14
Unix Components I/O –Character (device) –Block (regular file) –Network (socket) IPC (inter-process communication) –Signal: processes in same machine –Pipe: processes in same machine –Socket: processes in different machines –Client/server
15
Linux File name for Hardware Hardware deviceFile name IDE disk/dev/hd[a-d] SCSI/SATA/USB disk. USB flash/dev/sd[a-p] Floppy disk/dev/fd[0-1] Printer25 pins: /dev/lp[0-2] USB: /dev/usb/lp[0-15] MouseUSB: /dev/usb/mouse[0-15], /dev/mouse PS2: /dev/psaux CDROM/DVDROM/dev/cdrom TapeIDE: /dev/ht0 SCSI: /dev/st0
16
Unix Features Open system –Internal software source code are available (free or low cost) Platform independent –From PC to supercomputer Multi-users: round-robin between users Multi-tasking: process (execution of a program) sharing Virtual memory –Swap space at least 2 times of RAM
17
Unix Features Simple view of devices-Files (data unit on storage) –Peripheral –Network interface –Disk Efficient, robust, simple Lots of Utilities: tools for users to interact UNIX –Command line interpreter: process shell command System calls similar to library routines –Processes use system-calls to interact with Kernel Lots of commercial software GUI: X Window
18
Slide 18 vi/vim editor vi filename.c (or vim filename.c) Document: Please refer to http://www.chem.brown.edu/instructions/vi.ht ml
19
Slide 19 Use vi Editor 2 modes: –Editor mode (press ): make correction –Insert/open/append mode (press / / ): add text
20
Slide 20 Use vi Editor (Cont.) Editor mode: (Common keys) – :move left, : move right, : move down, : move up – : beginning of line, : end of line – : next word, : previous word – : go to line n
21
Slide 21 Use vi Editor (Cont.) Editor mode: (Cont.) – : delete character, : delete word – : delete line (to clip board), : copy line – : paste from clip board after/below cursor – : paste from clip board before/above cursor –Move cursor to line m,, then move cursor to line n, : move line m to below line n –Move cursor to line m,, then move cursor to line n, : copy line m to below line n
22
Slide 22 Use vi Editor (Cont.) Editor mode: (Cont.) Note: put a number n before an action will repeat the action n times. For example: 10 : move cursor down 10 lines 10 delete 10 characters 10 : delete 10 lines 10 : copy 10 lines
23
Slide 23 Use vi Editor (Cont.) Editor mode: (Cont.) – : replace a character – type in word : replace a word – type in words : replace/type over words – type in word : search the 1 st occurrence of the word – : save, : save and quit, – type in filename : save to filename and quit – : substitute the 1 st occurrence of word1 for word2 – : substitute all the occurrence (globally) of word1 by word2 from line 1 to last line
24
Slide 24 Use vi Editor (Cont.) Editor mode: (Cont.) – : join the cursor line and the line below into one line –Move cursor to position : split at the cursor position into 2 lines – : repeat the previous command – : next searched word – : go to last line – : file status
25
Slide 25 Use vi Editor (Cont.) Insert/open/append mode: (Common keys) – type in words :insert words before the cursor – type in words :append words after the cursor – type in words :open lines after the cursor and append words – type in words :open lines before the cursor and append words
26
Slide 26 Class Example Hands On Example0: edit the following 2 lines in file.exrc (vi ~/.exrc) :abbr #b /************************ :abbr #e ************************/ Then when you use vi template.c And after press / / to insert text, you type #b followed by, you add a line /******** in. Similarly, when you type #e followed by, you add a line ********/ in Example 1
27
Reference Unix History: Chapter 16 Unix internal: Chapter 14 Linux How-to Documentation: www.tldp.org www.tldp.org Linux: www.study-area.orgwww.study-area.org
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.