Pipeline Course Slide Material.
for basic lesson on Computer technology and an Operating System. Studet will be installing Debian distribution Linux
using VirtualBox to study basic elements in Internet Technology using Linux.
Pipeline 1 (Lecture in KMD 2015 Fall: Internet Technology Slot)
1. Innovation Pipeline TECH 1
Computer Architecture
Kazunori Sugiura phD
Keio University
November 2, 2015
FACEBOOK: Kazunori UHYO Sugiura
Pietoro Woo Hiyo Hiyo
TWITTER: uhyouhyo
11/02/2015 Keio Media Design 1
2. Objective of this Slot
• To become KMD ready in…
• Basic Computer and Network Literacy
• Contents Distribution
• Creating Web contents
• Creating Web Server
• Basic Network and Computer Management
• Security, Service extension and Management
11/02/2015 Keio Media Design 2
3. Preparations
• What you will need:
• Fully Charged Notebook Computer
• Or plug in your AC adapter
• Wireless Connectivity
• Can you access KMD Wireless network?
11/02/2015 Keio Media Design 3
4. What is Computer?
What is PC?
What is an important role for
PCs?
11/02/2015 Keio Media Design 4
5. What are the difference
between
Macs and PCs?
11/02/2015 Keio Media Design 5
6. Remember the Crash Course?
• CPU
• Memory
• System Device (Chipset, I/O)
• External Storage Device
• HDD, SSD, FDD, USB Memory
• Communication Device
• Ethernet
• Input Device
• Keyboard, Mouse, Tablet, Camera
• Display Device
• Video Card, LCD
11/02/2015 Keio Media Design 6
7. How Do They Treat the Data?
11/02/2015 Keio Media Design 7
8. Digital
• Information expressed by number(s)
• Every information (text, picture, movies, audios) are expressed by
numerical values
• Digital is not 0 and 1s
• Easy process
• Same expressions and rules
• Accurate copy
• Accuracy
• Depends on digitization process
11/02/2015 Keio Media Design 8
15. Amount of Digital Data
English = 7bit
Japanese=16bit
Chat
Short Mail
Cellular
Camera
report
Short report
Digital Camera
DV Camera
WEBCam
Cellular TV
Video CD
1K 1M 1G 1T 1P 1E
103 106 109 1012 1015 1018
Telephone
CD
CD
DVD
Blu-Ray
HDV Camera
HD Camera
Digital Cinema
Nuclear Simulation
Forecast simulation
Amount
Of
Information
(Bit)
DNA
11/02/2015 Keio Media Design 15
32. Moore’s Law
4004
8008
8080
8086
8088
80286
Intel i386
Intel 486
Intel Pentium
Intel Pentium Pro
Intel MMX Pentium
Intel Celeron
Intel Pentium II
Intel Pentium 3
Intel Pentium 4
Intel Pentium M
1970 1975 1980 1985 1990 1995 2000 2005 2010
10,000
100,000
1M
10M
100M
1GIntel Penryn
Transistors
Year
Intel Xeon
11/02/2015 Keio Media Design 32
33. 8Bit 16 bit 32 bit 64 bit
What is Bit and Byte?
11/02/2015 Keio Media Design 33
34. What is ??Bit OS?
• Data Bus Address Bus
Memory
CPU
DISK Network
Video Audio
Address Data
00000000 0000000F
FFFFFFF0 FFFFFFFF
:
00000040
11/02/2015 Keio Media Design 34
36. ?? Bit CPU
•8Bit CPU
• Processor capable of 8 bit operation
•16Bit CPU
• Processor Capable of 16 bit operation
•32Bit CPU
•64Bit CPU
11/02/2015 Keio Media Design 36
39. Preparing Spaghetti
Start
Open the tap
Water
enough?
Close the tap
Turn on the stove
Boiling?
Open the spaghetti container
Put spaghetti
9 minutes?
Turn off the stove
Take out spaghetti
You are done
NO
YES
YES
YES
NO
NO
11/02/2015 Keio Media Design 39
40. Designing Spaghetti Boiling Machine
Memory
Add Counter
Decoder
ALU(Operator)
INPUT UNIT OUTPUT UNIT
CLOCK
Tap
Spaghetti
Temp.
11/02/2015 Keio Media Design 40
41. Spaghetti Program
メモリ番地 内容 メモリ番地 内容
0 OUT 21 16
1 INP 1 17
2 CMP 20, 3, 1 18 9 minuts
3 OUT 22 19 100℃
4 OUT 26 20 200ml
5 INP 2 21 Open tap
6 CMP 19, 7, 5 22 Close tap
7 OUT 25 23 Insert spaghetti
8 OUT 23 24 Turn off stove
9 INP 3 25 Open the spaghetti container
10 CMP 18, 11, 9 26 Turn on the oven
11 OUT 24 27 Take out spaghetti
12 OUT 27 28
13 HLT 29
14 30
15 31
OUT: Output instruction
INP: Input instruction
CMP: compare instruction
HLT: stop instruction
Allocate the memory
And run from the
beginning
11/02/2015 Keio Media Design 41
42. Inside the CPU
Pre fetch
Unit
Instruction
Decoder
Register
ALU
Memory
Interface
CPU Internal
Memory
Read data
Controls for
instructions
Algorithmic
Operator
11/02/2015 Keio Media Design 42
44. CPU
North Bridge
(Memory Controller
HUB)
Front-side busClock
Generator
South Bridge
( I/O Controller HUB)
Internal bus
Memory Slots
Memory busPCI Express
Graphic Card
PCI bus
PCI slots
IDE
SATA
Ethernet
Audio
USB
CMOS M
FLASH
ROM
SUPER
I/O
Serial
Parallel
Key/Mouse
Floppy
11/02/2015 Keio Media Design 44
49. Reallity
• The Term “Bug” was already used at that time. when one
technician found a moth trapped inside Mark II computer.
She was amazed that a “REAL BUG” was hidden inside the
computer and reported as a “BUG”
http://ei.cs.vt.edu/~history/Hopper.Danis.html
IEEE Annals of the History of Computing, Vol 22 Issue 1, 2000
11/02/2015 Keio Media Design 49
57. Power Supply
• CPU memory hard disk interface… everything
• Convert AC to DC
• +5V -5V
• +12V -12V
• Reducing voltage = reduces energy consumption
• +3.3V, +2.5V,+1.8V
Voltage
1.8V
5V
Fast!
Time11/02/2015 Keio Media Design 57
59. Beginning
• First PC built in Japan (1976/8/3)
• TK-80 Kit(88500 Yen )
• μPD8080A(Intel 8080 Compatible)
• Memory :512Byte
11/02/2015 Keio Media Design 59
61. IBM The PC
• 1981/8/12
• Processor : 8088
• Mem: 16KByte Max 64Kbyte
• 8Bit XT Bus (4.77MHz)
• MDA(Monochrome Display Adapter) 320 x 200
• 汎用チップを利用
• Interrupt controller (i8259)
• DMA controller (i8237)
11/02/2015 Keio Media Design 61
62. Importance of BUS
Memory
Add Counter
Decoder
ALU(Operator)
INPUT UNIT OUTPUT UNIT
CLOCK
Tap
Spaghetti
Temp.
Arrows are Buses
11/02/2015 Keio Media Design 62
63. BUS
• What needs to be transported?
• Power Supply
• Data lines
• Address lines
• Special Command Lines
11/02/2015 Keio Media Design 63
64. Tap device
Power +12v (Tap motor power)Tap Motor
Tap motor Control
Power +5v (Tap motor control board)
Ground
Busy (Interrupt)
Address Bus
Data Bus
Address Data Contents
1 0 Tap Status
2 1 Tap Motor On
3 1 Tap Motor Direction
11/02/2015 Keio Media Design 64
67. Rivals: Motorola
• 6800(1974)
• 68000(1979)
• 1982 Sun Microsystems “SUN”
• “Stanford University Network”
• 1983 Apple LISA
• 68020(1984) 32Bit MPU
• Macintosh II
• 68030(1987)
• 68040(1990)
• 88000(1990)
11/02/2015 Keio Media Design 67
68. Intel 4004
• First production microprocessor
• chip(4mm x 3mm)
• 4Bit 10μm rule
• 2300個 transistors
• Frequency:108KHz
• Max 750KHz
calculators
11/02/2015 Keio Media Design 68
69. 8086 and 8088
•8086 Processor
• 29000 transistor
• 16Bit Data Bus 20Bit Address Bus(1MB)
• 5MHz(8,10MHz)
• 3μm
•8088 Processor
• 8Bit Data Bus 20Bit Address Bus
•AMD and NEC as Second Source
11/02/2015 Keio Media Design 69
70. 32Bit Requirement
80386 80386SX
• 80386(80386DX)
• 275000 Transistor
• 32Bit Data Bus, 32Bit Address Bus
• 16 – 33MHz
• 80387 FPU
• 80386SX
• 16Bit Data Bus 32Bit Address Bus
11/02/2015 Keio Media Design 70
76. Embedded memory controller
CORE CORE
CORE CORE
FSB
CHIPSET
MCH
memory
memory
Video Card
CORE CORE
CORE CORE
QPI
CHIPSET
IOH
memory
memory
Video Card
To: ICH
To: ICH
11/02/2015 Keio Media Design 76
77. Embed graphics controller as well
Memory
Controller CPU
GPU
DMI
CHIPSET
PCH
メモリ
メモリ
Video Card
To: ICH
FDI
Clarkdale
11/02/2015 Keio Media Design 77
85. Floppy disk
From Wikipedia
fd1440|floppy|floppy3|3in|3.5in High Density Floppy:
:ty=floppy:se#512:nt#2:rm#300:ns#18:nc#80:
:pa#2880:oa#0:ba#4096:fa#512:
:pb#2880:ob#0:bb#4096:fb#512:
:pc#2880:oc#0:bc#4096:fc#512:
Sector size x sector per track x Cylinder x surface
= 512 x 18 x 2 x 80 = 1474580 byte = 1440KByte
11/02/2015 Keio Media Design 85
91. How they record
Horizontal Magnetic Recording
N
S N
S
ビット1
ビット3
ビット4
ビット2
Electric Magnet
Coil
Signal
Magnetic surface
Horizontal recording and
Vertical recording
11/02/2015 Keio Media Design 91
102. File and Directory
• Unit of Data
• Text, Graphics, Sounds, Videos…
• File name and Extensions
• Program and Applications are also files
• Storing Files into Directory
11/02/2015 Keio Media Design 102
103. File and Directory
/
bin etc usr boot dev
sh ls passwd bin lib vmlinuz tty01 sda1
gcc ssh
通常ファイル
ディレクトリ
スペシャルファイル(デバイス)
パイプ
11/02/2015 Keio Media Design 103
104. Current and Parent
/
usr
bin lib
gcc ssh
.
..
Current Directory
Parent Directory
11/02/2015 Keio Media Design 104
109. File system in UNIX
I node Data block
Boot block
Super block11/02/2015 Keio Media Design 109
110. File system
• Abstraction based on files
root directory
/dev
/home
jun sd0a
Plain Files
Directory
Special Files11/02/2015 Keio Media Design 110
111. Index node
60 .
2
98
150
..
jun
uhyo
I node number
98 .
60
100
105
..
secret
appointment
100 .
98
160
203
..
Licence.c
Oops.c
105 .
98
178
205
..
Presentation.ppt
Girlfriend.jpg11/02/2015 Keio Media Design 111
112. Access Control
-rw-r--r-- 1 uhyo kmd 30 2009-06-05 18:20 main.c
- rwx rwx rwx
user
group
all
type
001 execute
010 write
100 read
11/02/2015 Keio Media Design 112
115. POWER ON POST
BOOTSTRAP
IPL
OS
COMMAND
INTERPRETER
Process 2
Process 1
Process 3
Processor starts running from address 0
after hard reset. Usually
From reset vector.
I/O Check
Memory Check
Read IPL
Read OS and run as a
system task
Initialize OS, run the
command interpreter
Start user command
Initialization Running
11/02/2015 Keio Media Design 115
116. Agenda
• Installing server on your Laptop
• Knowing server from A to Z
11/02/2015 Keio Media Design 116
117. Q: What kind of service do you want
to provide?
118. サーバーって何? What is a Server?
● サービスを提供する計算機
● Computers Providing Services
o Network
o Website
o Software
o Application
o Database
o File
o etc.
119. What is Server?
• Providing service to whom requested
• 24hrs 365, 366 days, forever
• Continuous Operation
• Unless service oriented
• Stability, Safety, Security (3 S’s)
120. Very Basics of an Application
• INPUT and OUTPUT
• When was the first application?
• Operating System and Application
11/02/2015 Keio Media Design 120
121. What is this?uhyo@cpu.sfc.wide.ad.jp % telnet narcia.narcia.net smtp
Trying 210.238.180.250...
Connected to narcia.narcia.net.
Escape character is '^]'.
HELO cpu.sfc.wide.ad.jp
220 narcia.narcia.net ESMTP Sendmail 8.14.2/8.14.2; Mon, 17 Nov 2008 05:41:46 +0900 (JST)
250 narcia.narcia.net Hello cpu.sfc.wide.ad.jp [203.178.142.143], pleased to meet you
MAIL FROM: uhyo@sfc.wide.ad.jp
250 2.1.0 uhyo@sfc.wide.ad.jp... Sender ok
RCPT TO: uhyo@kmd.keio.ac.jp
250 2.1.5 uhyo@kmd.keio.ac.jp... Recipient ok
data
354 Enter mail, end with "." on a line by itself
THIS IS A TEST MAIL
.
250 2.0.0 mAGKfkmO040256 Message accepted for delivery
quit
221 2.0.0 narcia.narcia.net closing connection
Connection closed by foreign host.
11/02/2015 Keio Media Design 121
122. What is this?
uhyo@cpu.sfc.wide.ad.jp % telnet narcia.narcia.net www
Trying 210.238.180.250...
Connected to narcia.narcia.net.
Escape character is '^]'.
GET /~uhyo/uhyo.html
<HTML>
OH YOU CAN SEE ME !!!
</HTML>
Connection closed by foreign host.
11/02/2015 Keio Media Design 122
123. Do you want a Server?
513,325円(税別)
http://jp.fujitsu.com/platform/server/primergy/products/lineup/rx600s6/
125. POWER ON POST
BOOTSTRAP
IPL
OS
COMMAND
INTERPRETER
Process 2
Process 1
Process 3
Processor starts running from address 0
after hard reset. Usually
From reset vector.
I/O Check
Memory Check
Read IPL
Read OS and run as a
system task
Initialize OS, run the
command interpreter
Start user command
Initialization Running
11/02/2015 Keio Media Design 125
127. Basic principle in OS
• Virtual Machines
• Resource Management
Operating System
hardw
are
hardw
are
hardw
are
hardw
are
hardw
are
hardw
are
Application Application Application
11/02/2015 Keio Media Design 127
130. Variety of Storage Devices
Operating System
IDE HDD SATA HDD SCSI HDD
IDE Device
Access
SATA Device
Access
SCSI Device
Access
E-mail Application
Accessing stored e-mail
11/02/2015 Keio Media Design 130
131. Resource Management
• Applications access limited resources
• PC = resource
• Racing Conditions
• Let’s watch “Anime” in Christmas eve!
• But I also need to meet with my close friend
• Which should I choose?
• Of course “Anime”?!
11/02/2015 Keio Media Design 131
132. Sharing Printer
• One Printer with many users
• 山田君 and 佐藤君 trying to use printer at same time山田君
佐藤君
OS
Printer
t
I’m printing OK
printing
WAIT!
Done!
Your turn
11/02/2015 Keio Media Design 132
133. Why OS was born?
• Batch processing
• Resident Monitor, JCL, IOCS
Resident Monitor
User Program Area Single job
Single program
Minimum controlling mechanism
Fortran Job Card
$JOB
$FORTRAN
$LOAD
$RUN
$END
11/02/2015 Keio Media Design 133
134. Batch Process
CPUJob 3 Job 2 Job 1
Courses in Restaurants
Enjoy one dish at a time
AppetizersSoupMain dish
11/02/2015 Keio Media Design 134
135. Time Sharing System
Share the dishes
JOB 1 JOB 2
JOB 3
Welcome to the UNIX world
CPU
11/02/2015 Keio Media Design 135
137. Virtualization Technologies
Hardware (CPU, Memory, SCSI, etc )
Operating System
Application
Virtualization Software
Guest
OS
Guest
OS
Guest
OS
Guest
OS
Guest
OS
11/02/2015 Keio Media Design 137
138. Virtualization Technologies
Using No Operating System
Hardware (CPU, Memory, SCSI, etc )
Virtualization Software
( Hyper-visor Virtual machine monitor )
Guest
OS
Guest
OS
Guest
OS
Guest
OS
Guest
OS
Guest
OS
Guest
OS
Guest
OS
11/02/2015 Keio Media Design 138
139. Virtualization Technologies
Using Firmware Solution
Hardware (CPU, Memory, SCSI, etc )
Firmware
Guest
OS
Guest
OS
Guest
OS
Guest
OS
Guest
OS
Guest
OS
Guest
OS
Guest
OS
Virtualization
Software
11/02/2015 Keio Media Design 139
144. Hard Disk Partition
1DK Partition Windows Partition Linux Partition
C:
D:
........
Windows
Program
Documents
User data
User data
/
/etc
swap
/usr
bin
share
/var
...
log
opt
...
/home
Documents
...
Pictures
...
145. UNIX/Linux Mount points
/ root directory ● ツリー型ディレクトリ構造の最
上層/Top level of Tree
directory structure
/home home directory ● ユーザーのデータ/Users’ data
eg. 「/home/userA」
「/home/userB」
/usr user directory ● ソフトウェア/Softwares
/var, /tmp... ● システムファイル/System Files
154. CUI and GUI
• What is the difference?
• キャラクターセットのみで対話
• 画像とセットで対話
• サーバと通常のPCの違いの一つ
• 遠隔からの作業が基本
• 最良な方法でサーバと対話するためには?
11/02/2015 Keio Media Design 154
155. SHELL シェル
• UNIXの基本操作: CUI
• Character User Interface
• Graphical User Interface
• ユーザとサーバとの対話
• Shell Interpreter
• sh, csh, bash, ksh, zsh, tcsh…
11/02/2015 Keio Media Design 155
156. プロンプト
• $ or %
• ユーザプロンプト
• #
• スーパーユーザ
11/02/2015 Keio Media Design 156
157. まずは色々やってみよう
• who
• Who
• WHO
• pwd
• cd
• ls
• clear
• groups
• hoge
11/02/2015 Keio Media Design 157
160. VI Editor 起動/Start
Command:
vi filename
指定されたファイルが無い場合は新
規作成モードとなる。
If given file doesn’t exist, this command
will create a new file with the file name.
163. How to Use “vi” editor
11/02/2015 Keio Media Design 163
164. “vi” command launch
•vi (filename)----open the file by vi
•vi +/(expression) (filename) ------ open and start the
file at the fist (expression)
•vi + (filename) ----open and start at the last line
•vi +(line number) (filename) ---- open and start at
the line number
11/02/2015 Keio Media Design 164
165. “vi” editor function
•Two type of the mode in “vi”
• Command Mode
• Cursor Move, Copy & Paste, Replacement, Save file and so on
• Input Mode
• Input the characters into the body
11/02/2015 Keio Media Design 165
166. Changing Both Modes
•Command mode to Input mode
• “i” means inserting the characters into the left side of the
cursor.
• “a” means inserting the characters into the right side of
the cursor.
•Input mode to Command mode
• “esc” change mode from input mode to command mode.
11/02/2015 Keio Media Design 166
167. Command Mode -cursor movement-
•h -> left, j -> down, k -> up, l -> right
•“Shift + g” goes to the last line
•“gg” goes to the first line
•“$” goes to the last column in the line
•“0” zero goes to the fist column in the line
•“ctrl+f” goes up to 1 page
•“ctrl+b” goes down to 1 page
11/02/2015 Keio Media Design 167
168. Command Mode -file manipulation-
•“:e” reread the file
•“:wq” save the file and quit the vi
•“:wq!” save the file and quit the vi forcedly
•“:w” saves the file
•“:help” open the help page
•“:q!” quit the vi forcedly
11/02/2015 Keio Media Design 168
169. Editing
•Remove the one character (“x”)
•yyy replace xxx (:s /xxx/yyy/)
•yyy replace xxx in all the lines (:%s /xxx/yyy/g)
•Copy the line (yy)
•Paste the copied line (p)
11/02/2015 Keio Media Design 169
170. Workshop for vi editor
•Make 1 text file by vi
•Write your name in each line by 20 lines.
•Move to 1st line, then remove the 1st line.
•Rewrite the “Hello vi” in 1st line and copy it into 3rd,
5th and 10th.
•Replace your name by “Kazunori Sugiura”
samplevi.txt
11/02/2015 Keio Media Design 170
171. Type this source code
• Type the following source code.
#include <stdio.h>
int main(void){
printf(“hello vin”);
printf(“hello vi and linux debiann”);
return(0);
}
hellovi.c
11/02/2015 Keio Media Design 171
172. Learn more
• Just do by yourself
• Use vi for configuration and making source code
• Utilize vi for writing down the memo
11/02/2015 Keio Media Design 172
173. File and Directory(Folder)
bin etc usr Program Files(x86) Users
sh ls passwd bin lib
cos.txt SOI.pptgcc ssh
uhyo keiko
Mozilla
firefox
Documents Documents
/
11/02/2015 Keio Media Design 173
174. Current and Parent
/
User
keiko uhyo
SOI.txt GC.txt
.
..
Current Directory
Parent Directory
11/02/2015 Keio Media Design 174
176. Basic Commands
Win Mac
ディレクトリを作成/Make
directory
md folder mkdir folder
ディレクトリを削除/Delete
directory
rd folder rmdir folder
ファイルをコピー/Copy a file copy file1 file2 cp file1 file2
ファイルを削除/Delete file del file rm file
ファイルを移動、ファイル名変
更/Move file, Rename file
move path1/file
path2/file
mv path1/file path2/file
ファイルにテキストを追記
/Write text in to file
echo text >
file.txt
echo text > file.txt
テキストファイルの内容を表示
/Displays the contents of a text
file.
type file cat file
177. Manage your files with
command
• Create a new directory
mkdir dir1(win)
mkdir dir1(mac)
• Enter that directory
cd dir1
• See what’s in the directory
dir (win)
ls (mac)
178. Manage your files with
command
There is nothing inside, it’s a new directory
• Create a new file
echo hello world > a.txt
• See what’s in the file
type a.txt (win)
cat a.txt (mac)
• Copy the file
copy a.txt b.txt (win)
cp a.txt b.txt (mac)
179. Manage your files with
command
• See what’s in file b.txt
Fogot the commands? Press ↑
• See what’s in the directory now
180. Manage your files with
command
• Go to upper directory
cd ..
• Copy the directory
copy dir1 dir2 (win)
cp –r dir1 dir2 (mac)
• Go see the new directory contents
Windows: folder2 should be created first
Mac: -r option is used for recursive copy through directory
181. Manage your files with
command
• See what’s in dir2
• Rename a.txt
move a.txt c.txt (win)
mv a.txt c.txt (mac)
• Delete b.txt
del b.txt (win)
rm b.txt (mac)
182. Manage your files with
command
• See what’s in dir2
• See what’s in dir1
• Delete directory
rmdir dir1 (win)
rm –r dir1
183. Access Control
-rw-r--r-- 1 uhyo kmd 30 2009-06-05 18:20 main.c
- rwx rwx rwx
user
group
all
type
001 execute
010 write
100 read
11/02/2015 Keio Media Design 183