Documente Academic
Documente Profesional
Documente Cultură
Cursul 7
Considerente hardware. Initializarea sistemului ,
CSE Dep
1/45
Moto
Notes
Software gets slower faster than hardware gets faster. Wirths Law What boots up must come down.
CSE Dep
2/45
Compilarea programelor
preprocesor (GNU CPP) gcc -E
Notes
cod surs
cod preprocesat
cod preprocesat
limbaj de asamblare
limbaj de asamblare
cod obiect
cod obiect
executabil
CSE Dep
3/45
Compilarea programelor
Notes
http://www.gridshore.nl/wp-content/uploads/code-quality-measurement.jpg
CSE Dep
4/45
Suport curs
Notes
CSE Dep
5/45
Notes
CSE Dep
7/45
Notes
Hardware
partea zic a unui sistem de calcul, incluznd circuitele a a digitale Hardware /nm./: the part of the computer that you can kick
Software
instructiuni (programe) care ruleaz cadrul hardware-ului a n , H si S sunt interconectate si inutile unul fr cellalt aa a , ,
CSE Dep
8/45
Componentele unui PC
Notes
http://www.crossaction.net/the-anatomy-of-your-computer
CSE Dep
9/45
Notes
CSE Dep
10/45
Notes
hard disk drive, CD-ROM drive, oppy disk drive, zip drive, USB ash drive
dispozitive de stocare extern a
plac video produce iesirea pentru dispozitivul de asare a , , plac de sunet are terminale unde se vor conecta boxe a plac de retea permite conectarea calculatorului a ntr-o retea , , local a alte dispozitive: tastatur, mouse, joystick, monitor, webcam, a microfon, imprimant, boxe, etc. a
CSE Dep
11/45
Placa de baz a
Notes
http://computer.howstuffworks.com/motherboard1.htm
CSE Dep
12/45
Notes
http://duartes.org/gustavo/blog/post/motherboard-chipsets-memory-map
CSE Dep
13/45
Notes
Microprocesor
Notes
CSE Dep
16/45
Microprocesor (cont.)
Detalii microprocesor pe Linux
anaconda:/home/razvan# cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 1 model name : Intel(R) Pentium(R) 4 CPU 1.70GHz stepping : 2 cpu MHz : 1699.922 cache size : 256 KB [...] anaconda:/home/razvan# lshw -class cpu *-cpu description: CPU product: Intel(R) Pentium(R) 4 CPU 1.70GHz vendor: Intel Corp. [...] size: 1700MHz capacity: 3060MHz width: 32 bits clock: 100MHz
Notes
CSE Dep
17/45
Ierarhia memoriei
Notes
http://commons.wikimedia.org/wiki/File:ComputerMemoryHierarchy.svg
CSE Dep
19/45
Capacitatea de stocare
Notes
bit
unitatea de stocare de baz a 0 sau 1
octet (byte) 8 biti , KB (kilobyte) 1024 octeti , MB (megabyte) 1024 KB = 1024*1024 octeti , GB 1024MB = 1024*1024KB = 10243 octeti , TB 1024GB Mbit/s megabiti pe secund (viteze) a ,
CSE Dep
20/45
Comenzi Linux
Memorie pe Linux lshw
anaconda:/home/razvan# lshw -class memory *-firmware description: BIOS vendor: Intel Corp. size: 64KB [...] *-cache:0 description: L1 cache size: 8KB capacity: 8KB capabilities: pipeline-burst internal varies data [...] *-memory description: System Memory size: 256MB capacity: 3GB *-bank:0 description: DIMM DDR Synchronous 266 MHz (3.8 ns) size: 256MB width: 64 bits clock: 266MHz (3.8ns) [...]
CSE Dep Cursul 7, Considerente hardware. Initializarea sistemului , 21/45
Notes
Notes
buffers 10584
cached 50692
buffers 10
cached 49
CSE Dep
22/45
Discuri Linux n
pot accesate din /dev
dispozitive de tip bloc (siere speciale) ,
anaconda:/home/razvan# ls -l /dev/hda* brw-rw---- 1 root disk 3, 0 Oct 17 13:08 brw-rw---- 1 root disk 3, 1 Oct 17 13:08 brw-rw---- 1 root disk 3, 2 Oct 17 13:08 brw-rw---- 1 root disk 3, 5 Oct 17 13:08 anaconda:/home/razvan# fdisk -l [...] Device Boot Start End Blocks /dev/hda1 * 1 4770 38314993+ /dev/hda2 4771 4865 763087+ /dev/hda5 4771 4865 76056
Notes
Id 83 5 82
CSE Dep
23/45
Booting
Notes
Ce nseamn booting? a
procesul de pornire a sistemului de operare ulterior pornirea sistemului de calcul
solutionare ,
secvent de boot ,a boot/bootstrap loader pentru arcarea si pornirea nc , sistemului de operare
CSE Dep
25/45
Notes
CSE Dep
26/45
Pornirea sistemului
Notes
se execut instructiunile de la o adres specic memorie a a a n , general, este vorba de o adres de salt la o sectiune de cod n a , BIOS se execut instructiunile BIOS a ,
CSE Dep
27/45
BIOS
Notes
http://www.washington.edu/lst/help/computing_fundamentals/troubleshootingxp/bios
CSE Dep
28/45
BIOS (2)
Notes
Basic Input Output System cod executat la pornirea sistemului de calcul recunoasterea si initializarea dispozitivelor , , , rmware rolurile BIOS-ului
POST (Power-On Self-Test)
vericarea integrittii memoriei a, descoperirea si identicarea magistralelor si dispozitivelor , , erorile sunt transmise forma unor sunete (beep) n
executia (optional) a unui program de congurare a , ,
CSE Dep
29/45
Sectorul de boot
Notes
BIOS (CMOS)
selectarea ordinii dispozitivelor bootabile
CSE Dep
30/45
Notes
http://culturacion.com/2012/05/analizando-el-mbr-para-detectar-bootkits/
CSE Dep
31/45
Bootloader
Notes
exemple de bootloadere
GRUB GRand Unied Bootloader LILO Linux Loader NTLoader / Windows Boot Manager (post-Vista)
CSE Dep
32/45
GRUB
Notes
cel mai folosit bootloader distributiile Linux n , versiunea actual GRUB2 a pasi de congurare ,
congurare /etc/grub.d/ si /etc/default/grub n , update-grub2 se genereaz automat /boot/grub/grub.cfg a
/etc/default/grub
congurri generice/globale a timeout, optiune implicit a ,
/etc/grub.d/
conguratia intrrilor a , pentru conguratii proprii editati /etc/grub.d/*custom , , GRUB scripting language
CSE Dep
33/45
Notes
kernel loading (kernel boot) realizat de bootloader a montarea sistemului de siere rdcin a a a , arcarea driverelor si modulele de kernel nc , pornirea primului proces
mod implicit, se foloseste /sbin/init n , parametrul init=/cale/catre/executabil transmis nucleului poate forta pornirea altui proces ,
CSE Dep
35/45
dmesg
asarea mesajelor nucleului ,
nucleul Unix este verbose
Notes
vizualizarea si controlul buerului de logging pentru kernel , buerul se poate insepecta si din /var/log/kern.log ,
Mesaje de boot dmesg
anaconda:/var/log# dmesg | grep -i agp Linux agpgart interface v0.100 (c) Dave Jones agpgart: Detected an Intel 845G Chipset. agpgart: Maximum main memory to use for agp memory: 202M agpgart: Detected 892K stolen memory. agpgart: AGP aperture is 128M @ 0xf0000000 anaconda:/var/log# cat kern.log.0 | grep -i agp Nov 29 16:21:04 localhost kernel: Linux agpgart interface v0.100 (c) Dave Jones Nov 29 16:21:04 localhost kernel: agpgart: Detected an Intel 845G Chipset. Nov 29 16:21:04 localhost kernel: agpgart: Maximum main memory to use for agp memory: 202M Nov 29 16:21:04 localhost kernel: agpgart: Detected 892K stolen memory. Nov 29 16:21:04 localhost kernel: agpgart: AGP aperture is 128M @ 0xf0000000
CSE Dep
36/45
init
Notes
pornirea init marcheaz arcarea nucleului a nc Care este starea sistemului pn la init? a a
nucleu arcat nc parte din hardware initializat a , sistemul de siere rdcin arcat a a a nc
congurat n
/etc/inittab (SysV init) /etc/init/ (Upstart init daemon)
CSE Dep
37/45
Notes
CS:APP Bryan, OHallaron CMU baza unui un curs de la CMU carte de ,,sisteme (systems) util pentru a sti what is under the hood a , trei prti, prima parte detaliaz arhitectura sistemulu de calcul a , a si cum poate folosit pentru construirea de aplicatii a , , 2nd Edition 2010
CSE Dep
39/45
Federico Faggin
Notes
http://en.wikipedia.org/wiki/File:Federico_Faggin_(cropped).jpg
proiectantul primului procesor comercial (Intel 4004) fondator Zilog (Z80 HC Home Computer ) a activat mai multe companii precum Synaptics, Foveon n
CSE Dep Cursul 7, Considerente hardware. Initializarea sistemului , 40/45
Intel
Notes
Integrated Electronics cel mai mare productor de chip-uri a inventatorul arhitecturii de procesoare x86 gam larg de produse hardware: motherboard chips, plci de a a a retea, GPU, CPU, embedded CPU , companie fondat de Gordon Moore (Moores Law ) si Robert a , Noyce competitie din partea AMD, Texas Instruments, Nvidia , pe piata mobile, competitie din partea arhitecturii ARM (Intel , , Atom)
CSE Dep
41/45
PandaBoard
Notes
http://pandaboard.org/ plcut de dezvoltare pentru platforme embedded si mobile a ,a , jur de 150-170 USD n ARM Dual Core 1.2 GHz, 1GB RAM ruleaz Android, Ubuntu, distributii Linux a ncorporate , se pot conecta monitor, dispozitive pe USB, expansion board
CSE Dep
42/45
Cuvinte cheie
Notes
hardware software plac de baz a a magistral (bus) a lspci lshw procesor memorie (RAM) hard disk
asamblare fdisk, /dev/hd* dispozitive periferice booting BIOS MBR, VBR bootloader GRUB2 dmesg init
CSE Dep
43/45
Resurse utile
Notes
Hardware books
Randal Bryant, David OHallaron Computer Systems: A Programmers Perspective Hennessy & Patterson Computer Architecture: A Quantitative Approach Hennessy & Patterson Computer Organization and Design: The Hardware/Software Interface Andrew S. Tanenbaum Structured Computer Organization
Link-uri
http: //www.ibm.com/developerworks/library/l-linuxboot/index.html http://www.gnu.org/software/grub/manual/grub.html http://upstart.ubuntu.com/ http://computer.howstuffworks.com/hardware-channel.htm http://www.linuxhardware.org/
CSE Dep
44/45
Notes
Notes