1 / 34

Sissejuhatus informaatikasse

Sissejuhatus informaatikasse. Miks opsüsteem?. Opsüsteemi põhieesmärgid: Pakkuda programmeerijale valmistehtud standardtükke. Võimaldada kasutajal arvutis ühtemoodi ja harjumuspäraselt tegutseda, sõltumatult sellest, mis programmid tal arvutis on. Miks opsüsteem?

ordell
Télécharger la présentation

Sissejuhatus informaatikasse

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sissejuhatus informaatikasse

  2. Miks opsüsteem? Opsüsteemi põhieesmärgid: • Pakkuda programmeerijale valmistehtud standardtükke. • Võimaldada kasutajal arvutis ühtemoodi ja harjumuspäraselt tegutseda, sõltumatult sellest, mis programmid tal arvutis on. Miks opsüsteem? Arvutit saaks programmeerida ka ilma opsüsteemita. Sel juhul: • oleks iga programmi tegemine palju raskem kui opsüsteemi olemasolu korral. • kasutajate jaoks näeks eri programmid väga eri moodi välja.

  3. Mida opsüsteem enamasti teeb? • Oskab kettalt programme lugeda ja neid käima panna. • Oskab programme seisma panna (lõplikult või ainult väikese pausi jaoks) • Oskab kettale faile ja katalooge kirjutada ja sealt neid lugeda. • Oskab välisseadmetega (printer, monitor, klaviatuur jne jne) suhelda. • Oskab võrguga suhelda. • jne • Kui opsüsteemi ei oleks, peaks iga programm kõiki neid asju ise teha oskama!

  4. Naked machine • What is there in the naked machine (unclothed by an OS)? • CPU (registers, opcodes), • Memory (may be several chunks), • Devices (mapped to memory locations, able to transfer data to and from memory).

  5. Definitions of OS!? … • Extended machine, or virtual machine. Takes the basic hardware, and provides additional layers offunctionality. The virtual machine is usually simpler and more consistent than the real machine. Practically,additional layers will build on the lowest-level ones, providing a rich programming model for the applicationssoftware (which in turn provides a 'virtual machine' to the user). • Resource manager. Allocates scarce resources, like disk space, memory, processor between competingprocesses and users. Each process thinks that it has its own machine (its own files, its own printer, whatever). In away, this is also extending the machine (in order to appear to be many machines). • Anything which runs in the computer's privileged mode, or supervisor mode. Typically most modern processorshave two or more operating modes, user and supervisor. In supervisor mode, able to access all of memory and allhardware.

  6. Definitions of OS!? • The software which is supplied with the machine. Often includes many things not traditionally considered partof the operating system, like GUIs, editors, Web browsers, and stuff. • A platform on which other software can run. Lots of platforms are not operating systems (like NetscapeNavigator, or Microsoft Word). Java is almost an operating system. Provides many services commonly associatedwith Operating Systems, like managing multiple concurrent processes, and providing access to files.

  7. Operatsioonisüsteemide arengulugu • Arvutid ilma OS-ita • Batch processing süsteemid • Multiprotsessing ja terminalid - UNIX • Personaalarvutid - IBM, Xerox, Apple, DOS, Windows

  8. Operatsioonisüsteemi roll

  9. OS layers

  10. Operatsioonisüsteemide omadused • Funktsionaalsus • Protsesside haldamine • Mälu haldamine • Failisüsteemid • Võrguprotokollid • Kasutajate haldamine

  11. Interrupts • The interrupt handler must save the machine state, do some processing, then call the process scheduler and dispatcher. • When an interrupt occurs 1.the processor hardware makes a quick copy of the program counter and CPU registers 2.the hardware switches to kernel mode and jumps to the interrupt service routine 3.the ISR is usually very short. It may inform a device driver that it received the interrupt; it may just increment some clock counters. 4.next the ISR calls the scheduler, which decides which process to run 5.the scheduler calls the dispatcher, and new process (or maybe the same process) resumes where it left off • An important goal of the OS is to hide interrupts from the user---and from user-level processes.

  12. Processes have their own memory areas

  13. Multitasking and scheduling

  14. Parallel running of processes is a movie-like illusion http://www.youtube.com/watch?v=qqsmei__kmQ

  15. Running programs in parallel Each program gets ca 0.01 sec time slice, then another runs, etc, cyclically. Slices vary: from 0.005 to ca 0.1

  16. Processes wait and run – when chance comes

  17. Main scheduling algorithm goals Fairness.Treating users fairly: everybody gets some time to run Respecting priority.That is, giving more important processes higher priorit Efficiency. Do not spend excessive time in the scheduler. Try to keep all parts of the system busy. Low turnaround time.Minimize the time from the submission of a job to its termination. High throughput.Maximize the number of jobs completed per day. Low response time.Minimize the time from when an interactive user issues a command to when the response is given. Repeatability. Non-random, predictable behavious Degrade gracefully under load.

  18. Process lifecycle in more details

  19. Memory handling • Defines - which application occupies, which part (block/segment)

  20. Memory handling • Organise virtual memory to fit all application memory into existing (static memory size) • Consider we have App1, App2, App3, App4. App1 occupies section 1, App2 occupies section 2, App3 occupies section 3. What we do with App4?? • All those Applications are not runnig at the same time (see previous slides or processes handling). So we could store another application memory to HDD and reuse that space fro Appl4!!! ... and then when this other (lets say App1) is activated move App4 memory to HDD and restore App1 memory (before activating App1 – so it is not visible for her). This process is called swapping. • Decrease number of swaps: For example if the execution sequence is App1, App2, App3, App4, App1, App4, App1 and all apps requires the same block then instead of replacing App1 with App4 we could replace App2 with App4. The last case App4, App1, App4, App1 will not require swapping App1 and App4 permanently. Instead App2 will be at HDD and both App1 and App4 in memory

  21. Memory handling • a, b, x since we use: b=2;x=3;a=b/x; • a, b, x are integer, so requires 2 bytes, so: a=> address 000(i.e. bytes 000, 001)b => address 010 (i.e. bytes 010, 011)c => address 100(i.e. bytes 100, 101) • App is loaded starting from 11011000 address,so:a starts at 11011000b starts at 11011010c starts at 11011100

  22. Cache ja mälu hierarhia • Pilt selgitustega tahvlil. Alternatiiv: loe vastavat kohta lisamaterjalist Computer Systems: a programmers perspective

  23. Operatsioonisüsteemide omadused • Kasutatavus • Liides: käsurida (CLI), graafika (GUI) • Olemasolevad rakendused, teenused • Vajalik riistvara • Haldusvahendid, kaughaldus • Stabiilsus • Skaleeruvus • Tugi • Hind

  24. Suured praegused opsüsteemid, nende põhirakendusvaldkonnad ja umbkaudsed turuosad Mõned väiksemad: • Symbian (mobiil) • Blackberry (mobiil) • Bada (Samsungi mobiil) • TinyOS (pisiseadmed) • zOS (IBM mainframes) • Windows (Microsoft) • Tava-arvutid (92%) • Serverid (36% servereid) • Mobiilid (alla 1% mobiile) • OS X ja iOS (Apple) • Mobiilid (iphone 25% / ipad 36 %) • Tava-arvutid (mac, 6.5%) • Linux (vabavara) • Mobiilid (Android, 21% mobiile) • Serverid (63% servereid) • Pisiseadmed (domineeriv) • Tava-arvutid (1.5 %) • BSD (vabavara) • Serverid Unix

  25. Android OS structure

  26. Riistvara Tarkvara litsentsid Tehniline tugi Tarkvara upgrade Riistvara upgrade Seisaku põhjustatud kasumi kadu Süsteemi koguhind • Installeerimise kulu • Haldamise kulu • Riistvarast või OS-ist põhjustatud rikutud andmete taastamise kulu • Välja- ja ümberõppe kulud

  27. Näide: süsteemi hinna kujunemine

  28. Failisüsteemide võrdlus

  29. Pääsuõigused NTFS failisüsteemis • Iga faili ja kataloogiga on seotud pääsuõiguste nimekiri (ACL - Access Control List)‏ • ACL on nimekiri pääsuõiguste kirjetest (ACE - Access Control Entry)‏ • ACE koosneb: • kasutaja, grupi või arvuti nimest • pääsuõiguste loetoelust • Kui kasutajale, ega tema grupile ei ole mingi ressursi juures vastavat õigust antud, siis pole tal võimalik seda ressurssi kasutada

  30. POSIX pääsuõigused d r w x r w x r w x faili tüüp omaniku õigused grupi õigused teiste õigused r lugemisõigus w kirjutamisõigus x käivitamisõigus s setUID, setGID t sticky bit

  31. Virtualiseerimisvahendid • Õppeotstarbel • Testkeskkondadeks • Tootearenduses ning kasutajatoes • Server - hosting • Kliendid saavad täiesti oma serveri • Serverite virtualiseerimine • Riistvararessurss jaguneb mitme serveri vahel • Lihtsustub riistvara hooldus • Virtuaalservereid saab ümber tõsta teisele riistvarale • Teenuste eraldamiseks - igale teenusele oma server • turvalisus • PC riistvara emuleerimine • Vmware • Olemas nii Linux, kui Windows versioon • Eri versioonid töökoha ja serverirakendusteks • Virtual PC (Microsoft)‏ • Parallels (MacOS)‏ • Linuxipõhised virtualiseerimisvahendid • Virtuozzo. OpenVZ • Vserver • XEN • UML • QEMU App1 App2 App3 Linux Windows NT FreeBSD VMware VMware VMware Linux Bare hardware

More Related