CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Opera5ng ¡Systems ¡and ¡ Hardware ¡Overview ¡ ¡ ¡ ¡ Por%ons ¡of ¡this ¡material ¡from ¡U. ¡Manitoba ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Components ¡of ¡a ¡Computer ¡System ¡ • A ¡computer ¡system ¡consists ¡of ¡both ¡hardware ¡and ¡ so=ware ¡ • Many ¡different ¡types: ¡ – Tablets, ¡laptops ¡ – Desktops, ¡worksta%ons ¡ – Embedded ¡systems ¡ – Servers ¡ – Mainframes ¡ ¡ – Super ¡Computers ¡ 2-2
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Inside ¡a ¡Computer ¡Case ¡ 2-3
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Hardware ¡Components ¡ • Processor ¡ • Main ¡memory ¡ • Secondary ¡memory ¡ ¡ – hard ¡disk, ¡op%cal ¡disks, ¡tapes, ¡… ¡ • Input ¡devices ¡ – keyboard, ¡mouse, ¡microphone, ¡… ¡ • Output ¡devices ¡ ¡ – monitor, ¡printer, ¡speaker, ¡… ¡ 2-4
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Processors ¡ cpu socket cpu with cooler cpu with cover removed 2-5
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Main ¡Memory ¡ 2-6
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Motherboard ¡of ¡a ¡Laptop ¡ ¡ 2-7
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Motherboard ¡of ¡iphone3G ¡ http://www.rapidrepair.com/Merchant2/merchant.mvc?Screen=cp-iphone3g 2-8
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Buses ¡ • Key ¡abstrac%on ¡for ¡hardware ¡ • A ¡hardware-‑level ¡messaging ¡system ¡for ¡components ¡ • A ¡lot ¡of ¡EE-‑type ¡specifica%ons ¡about ¡clock ¡rate, ¡ voltage, ¡etc. ¡ • You ¡mostly ¡need ¡to ¡know ¡that ¡the ¡specs ¡for ¡all ¡ components ¡have ¡to ¡agree ¡ 9 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Bus ¡idea ¡ Awesome ¡Dev ¡ Awesome ¡ 2 ¡ Awesome ¡Dev ¡3 ¡ Dev ¡1 ¡ Bus ¡Client ¡ Bus ¡Client ¡ Bus ¡Client ¡ Bus ¡ Controller ¡ 2-‑10 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Bus ¡Intui%on ¡ • For ¡a ¡given ¡device ¡type, ¡the ¡bus ¡client ¡speaks ¡the ¡ protocol ¡over ¡the ¡wire ¡ • Encapsulates ¡low-‑level ¡device ¡implementa%on ¡ 2-‑11 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ A ¡logical ¡view ¡of ¡hardware ¡ PCI-‑X ¡ North ¡Bridge ¡ ¡ CPU(s) ¡ RAM ¡ Bus ¡ (Fast ¡devices: ¡ ¡ e.g., ¡GPU) ¡ South ¡Bridge ¡ ¡ (“Slow” ¡Devices: ¡ ¡ e.g., ¡Disk, ¡USB, ¡ PCI ¡ BIOS ¡ SATA ¡ Most ¡network) ¡ Bus ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Buses ¡galore ¡ • Memory ¡Bus: ¡connects ¡Northbridge ¡components ¡ (CPU, ¡RAM, ¡GPU, ¡Southbridge ¡controller) ¡ • Disk ¡buses: ¡ ¡ – Controller ¡on ¡the ¡motherboard ¡ • O=en ¡on ¡south ¡bridge ¡ – Speaks ¡to ¡disks ¡ ¡ • SATA, ¡IDE, ¡SCSI, ¡etc ¡ • USB, ¡Firewire, ¡etc. ¡are ¡all ¡bus ¡protocols ¡ 2-‑13 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Fewer ¡Bridges ¡ • Newer ¡system ¡organiza%ons ¡are ¡moving ¡more ¡ devices ¡to ¡the ¡North ¡bridge, ¡and ¡consolida%ng ¡more ¡ things ¡on ¡the ¡CPU ¡itself. ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ So ¡what ¡is ¡an ¡OS? ¡ 2-‑15 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ One ¡view ¡of ¡an ¡OS ¡ 2-‑16 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Another ¡simple ¡view ¡of ¡an ¡OS ¡ App ¡ App ¡ App ¡ App ¡ OS ¡ Hardware ¡ 2-‑17 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ A ¡less ¡happy ¡view ¡of ¡an ¡OS ¡ 2-‑18 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ So ¡which ¡one ¡is ¡right? ¡ • They ¡all ¡are ¡ 2-‑19 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ An ¡OS ¡serves ¡three ¡masters ¡ 1. Give ¡users ¡a ¡desktop ¡environment ¡ 2. Give ¡applica%ons ¡a ¡more ¡usable ¡abstrac%on ¡of ¡the ¡ hardware ¡ 3. Give ¡hardware ¡manufacturers ¡an ¡abstrac%on ¡of ¡the ¡ applica%ons ¡ ¡ 2-‑20 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Background ¡(1) ¡ • CPUs ¡have ¡2 ¡modes: ¡user ¡and ¡supervisor ¡ – Some%mes ¡more, ¡but ¡whatevs ¡ • Supervisor ¡mode: ¡ ¡ – Issue ¡commands ¡to ¡hardware ¡devices ¡ – Power ¡off, ¡Reboot, ¡Suspend ¡ – Launch ¡missiles, ¡Do ¡awesome ¡stuff ¡ • User ¡mode: ¡ ¡ – Run ¡other ¡code, ¡hardware ¡taeles ¡if ¡you ¡try ¡anything ¡ reserved ¡for ¡the ¡supervisor ¡ 2-‑21 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ OS ¡architecture ¡ App ¡ App ¡ App ¡ App ¡ OS ¡ Hardware ¡ 2-‑22 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ OS ¡architecture ¡ App ¡ App ¡ App ¡ App ¡ User ¡ Libraries ¡ Super-‑ ¡ visor ¡ Kernel ¡ Hardware ¡ 2-‑23 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Master ¡#2: ¡Applica%ons ¡ • Applica%on ¡Programming ¡Interface ¡(API) ¡ – Win32 ¡(Windows) ¡ – POSIX ¡(Unix/Linux) ¡ – Cocoa/Cocoa ¡Touch ¡(Mac ¡OS/iOS) ¡ • Applica%on-‑facing ¡func%ons ¡provided ¡by ¡libraries ¡ – Injected ¡by ¡the ¡OS ¡into ¡each ¡applica%on ¡ 2-‑24 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ OS ¡architecture ¡ App ¡ App ¡ App ¡ App ¡ User ¡ Libraries ¡ Super-‑ ¡ visor ¡ Kernel ¡ Hardware ¡ 2-‑25 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ OS ¡architecture ¡ Win32 ¡ App ¡ App ¡ App ¡ API ¡ Libraries ¡ Libraries ¡ Libraries ¡ User ¡ Super-‑ ¡ visor ¡ Kernel ¡ Hardware ¡ 2-‑26 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Famous ¡libraries, ¡anyone? ¡ • Windows: ¡ntdll.dll, ¡kernel32.dll, ¡user32.dll, ¡gdi32.dll ¡ • Linux/Unix: ¡libc.so, ¡ld.so, ¡libpthread.so, ¡libm.so ¡ 2-‑27 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Caveat ¡1 ¡ • Libraries ¡include ¡a ¡lot ¡of ¡code ¡for ¡common ¡func%ons ¡ – Why ¡bother ¡reimplemen%ng ¡sqrt? ¡ • They ¡also ¡give ¡high-‑level ¡abstrac%ons ¡of ¡hardware ¡ – Files, ¡printer, ¡dancing ¡Homer ¡Simpson ¡USB ¡doll ¡ • How ¡does ¡this ¡work? ¡ 2-‑28 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ System ¡Call ¡ • Special ¡instruc%on ¡to ¡switch ¡from ¡user ¡to ¡supervisor ¡ mode ¡ • Transfers ¡CPU ¡control ¡to ¡the ¡kernel ¡ – One ¡of ¡a ¡small-‑ish ¡number ¡of ¡well-‑defined ¡func%ons ¡ • How ¡many ¡system ¡calls ¡does ¡Windows ¡or ¡Linux ¡ have? ¡ – Windows ¡~1200 ¡ – Linux ¡~350 ¡ 2-‑29 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ OS ¡architecture ¡ Ok, ¡here’s ¡ Open ¡file ¡ handle ¡4 ¡ “hw1.txt” ¡ App ¡ App ¡ App ¡ Libraries ¡ Libraries ¡ Libraries ¡ User ¡ Super-‑ ¡ System ¡Call ¡Table ¡(350—1200) ¡ visor ¡ Kernel ¡ Hardware ¡ 2-‑30 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ Caveat ¡2 ¡ • Some ¡libraries ¡also ¡call ¡special ¡apps ¡provided ¡by ¡the ¡ OS, ¡called ¡a ¡ daemon ¡(or ¡service) ¡ – Communicate ¡through ¡kernel-‑provided ¡API ¡ • Example: ¡Print ¡spooler ¡ – App ¡sends ¡pdf ¡to ¡spooler ¡ – Spooler ¡checks ¡quotas, ¡etc. ¡ – Turns ¡pdf ¡into ¡printer-‑specific ¡format ¡ – Sends ¡reformaeed ¡document ¡to ¡device ¡via ¡OS ¡kernel ¡ 2-‑31 ¡
CSE/ISE ¡311: ¡Systems ¡Administra5on ¡ OS ¡architecture ¡ App ¡ App ¡ Daemon ¡ Libraries ¡ Libraries ¡ Libraries ¡ User ¡ Super-‑ ¡ System ¡Call ¡Table ¡(350—1200) ¡ visor ¡ Kernel ¡ Hardware ¡ 2-‑32 ¡
Recommend
More recommend