Operating Systems - UC Santa Barbara

3y ago
22 Views
3 Downloads
1.60 MB
32 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Victor Nelms
Transcription

UC Santa BarbaraOperating SystemsChristopher KruegelDepartment of Computer ScienceUC Santa Barbarahttp://www.cs.ucsb.edu/ chris/

CS 170 InfoUC Santa Barbara Web page: http://www.cs.ucsb.edu/ chris/cs170/index.html Mailing lists (one for class, one for instructors)cs170-users – used to disseminate information and ask fellow classmatescs170-admin – use to reach TA and me2

RequirementsUC Santa Barbara The course requirements include– several projects– a midterm and a final exam The projects (and exams) are individual efforts The final grade will be determined according to the following weight– projects: 50%– exams: 50% Class participation and non-graded quizzes3

Lab ProjectsUC Santa Barbara 5 programming assignments Shell (system calls) Threads (parallel execution, scheduling) Synchronization (semaphores, ) Memory (virtual memory, shared regions, ) File systems4

MaterialUC Santa Barbara The course will adopt the following book:Andrew S. Tanenbaum and Albert S. WoodhullOperating Systems (Design and Implementation)3rd Edition, Prentice-Hall, 2006 The set of assignments will be updated during the course Additional material (slides) is provided on the class Web page5

Operating SystemsUC Santa Barbara Let us do amazing things – allow you to run multiple programs at the same time– protect all other programs when one app crashes– allow programs to use more memory that your computer has RAM– allow you to plug in a device and just use it (well, most of the time)– protects your data from fellow students on CSIL6

What is the most-used OS?UC Santa Barbara Desktops– Microsoft Windows sells 10 million copies per month and 90% desktop market share– Apple Mac OS 8% share– Linux negligible7

What is the most-used OS?UC Santa Barbara But wait what about embedded devices?– order of magnitude more devicesiTron (several billion installations)Wind River (VxWorks) – market leader, “Lord of Toasters”Linux is growing rapidlySymbian and cell phones (73 million in 2008) Smartphone ecosystem is moving extremely fast (600M forecast for ‘12)–––––Android 49% (Linux-based)iOS 19% (derived from Mac OS X – Darwin/Unix foundation)BlackBerry 13% (proprietary OS developed by RIM)Windows 11%Symbian 5%8

OutlineUC Santa Barbara Introduction to Operating Systems Processes and Threads IPC, Synchronization, and Deadlocks Memory Management Input/Output File Systems Security9

In The Beginning There Was HardwareUC Santa ouseControllerBUS(es)Floppy DiskControllerHard DiskControllerOther I/OControllers10

Central Processing UnitUC Santa Barbara Fetches instructions from memory and executes them Characterized by an instruction set– Loads and stores values to/from memory/registers– Performs simple operations (add, and, xor)– Jumps to locations Contains a set of registers– Program counter– Stack pointer– PSW (Program Status Word) Kernel mode: total access to memory/registers and instructions User mode: limited access to memory/registers and subset ofinstructions11

MemoryUC Santa Barbara Set of locations that can hold values Organized in a hierarchy of layers–––– Registers (access time 1 nsec)Cache memory (access time 2 nsec)Main memory - RAM (access time 10 nsec)Hard disk (access time 10 msec)Read Only Memory (ROM) used to store values . permanently12

I/O DevicesUC Santa Barbara Controllers connected to the bus Device connected to a controller The controller provides an interface to access the deviceresources/functionalities– done by storing values into device registers Memory mapped access– device registers mapped into memory region Dedicated I/O– special CPU instructions13

DiskUC Santa Barbara One or more metal platters that rotate at a constant speed (e.g., 5400rpm, 7200 rpm, ) Each platter has many concentric tracks Corresponding tracks in different platters compose a cylinder Each track is divided in sectors A mechanical arm with a set of heads (one per surface) moves onplatters and reads/writes sectors– Move to the right track (1 to 10 msec)– Wait for the sector to appear under the head (5 to 10 msec)– Perform the actual read/write14

BusesUC Santa Barbara Used to transfer data among componentsDifferent functions, speeds, number of bytes transferred Cache busMemory bus (FrontSide Bus, QuickPath Interconnect) ISA (Industry Standard Architecture) bus– 8.33 MHz, 2 bytes, 16.67 MB/sec PCI (Peripheral Component Interconnect) bus– 66 MHz, 8 bytes, 528 MB/sec PCIe (PCI Express) USB (Universal Serial Bus)SCSI (Small Computer System Interface) busIEEE 1394/FireWire bus15

There Be Power.UC Santa Barbara16

There Be Power.UC Santa Barbara CPU starts and loads instructions starting at 0xfffffff0 Instruction jumps to BIOS code BIOS (Basic Input/Output System) is started– Performs basic tests (memory, keyboard, etc) – POST (power on self test)– Determines the “boot device” (Hard disk, Floppy, CD-ROM)– Loads the contents of the first physical sector (the Master Boot Record MBR - Cyl 0, Head 0, Sect 1) in memory 0x7C00 - 0x7DFF– Jumps to 0x7C00 MBR code finds an “active” file system, loads the correspondingboot sector in memory, and jumps to it The boot sector code loads the operating system17

A few words about the BIOSUC Santa Barbara Two main components– Boot services initialize hardware (including RAM) read and load boot code transfer control– Runtime services basic routines for accessing devicescan display menus, boot from devices (and even network)access to clock, NVRAM, OS typically bring their own device driversDevelopments– Standard PC BIOS around for a long time– recently, Unified Extensible Firmware Interface (UEFI) started asreplacement– UEFI is more general, supports boot from large disks18

The Operating SystemUC Santa Barbara Where does an operating system fit in a computing system? What does an operating system do? Why do we need an operating system? How is an operating system structured?19

Where?UC Santa BarbaraUser ProgramsOS InterfaceOperating SystemHW InterfaceHardware Platform20

What?UC Santa Barbara The operating system is a resource manager that provides anorderly and controlled allocation of resources The operating system is an implementer of multiple virtual(extended) machines that are easier to program than theunderlying hardware Goal:– Each program/application can be developed as if the wholecomputer were dedicated to its execution21

Resource ManagementUC Santa Barbara Multiplexing– creating an illusion of multiple (logical) resources from a single (physical) one Allocation– keep track of who has the right to use what Transformation– creating a new resource (logical) from existing resource (physical)primarily for “ease of use” An OS multiplexes, allocates, and transforms HW resources22

Types of MultiplexingUC Santa Barbara Time multiplexing– time-sharing– scheduling a serially-reusable resource among several users e.g., CPU or printer Space multiplexing– space-sharing– dividing a multiple-use resource up among several users e.g., memory, disk space23

Multiple Virtual ComputersUC Santa Barbara Multiple processors– capability to execute multiple flows of instructions at the same time Multiple memories– capability to store information of multiple applications at the same time Access to file system as an abstraction of the disk Access to other I/O devices in abstract, uniform ways– e.g., as objects or files24

Virtual ComputersUC Santa Barbara OS creates multiple processes (simulated processors) out of the single CPU– time-multiplexing the CPUOS creates multiple address spaces (memory for a process to execute in)out of the physical memory (RAM)– space-multiplexing of the memoryOS implements a file-system and I/O system so that processes useand share the disks and I/O simultaneously– space-multiplexing the disk and time-multiplexing the I/O channelsOS creates multiple virtual computers from a single physical machine25

Virtual ComputersUC Santa BarbaraUser Proc.User Proc.VC1VC2User Proc.VCnOperating SystemPhysical Computer26

OS Interface – Virtual ProcessorsUC Santa Barbara Nearly the same interface as the physical CPU OS removes privileged operations– PSW determines if the code is either “user code” or “OS code”– changes in status are strictly regulated. OS adds instructions (system calls)– create new virtual computers (processes)– communicate with other VCs– allocate memory– perform input and output operations I/O– access the file system27

OS Interface – Virtual MemoryUC Santa Barbara Memory of the Virtual Computer is similar to the hardware memory (i.e.,a sequence of words), and it is accessed the same way The OS divides up the memory into parts and gives each part to eachvirtual computer OS creates an illusion that each virtual computer has a memory startingfrom address 0x0000 OS creates an illusion that the virtual computer has more memory thanthe physical memory28

OS Interface – Virtual File SystemUC Santa Barbara Secondary storage provides long-term storage for data Storage is done physically in term of disk sectors and virtually interms of disk files The virtual computer sees a file system consisting of namedfiles with arbitrary size29

OS Interface – Virtual I/OUC Santa Barbara I/O operations of the virtual computer are completely different from theI/O operations of the physical computer The physical computer has devices with complex control and statusregisters In contrast, the virtual I/O is simple and easy to use In fact, in most OSes (e.g., UNIX) virtual I/O abstraction is almostidentical to the file-system interface giving rise to uniformity oftreatment with respect to all types of I/O devices including disks,terminals, printers, network connections Each VC sees a dedicated I/O device: the actual hardware is space/time multiplexed by the OS30

Operating System ServicesUC Santa Barbara The programs running on virtual computers access theoperating system services through system calls A system call is carried out by– Storing the parameters of the system calls in specific locations(registers, memory)– Calling a “software interrupt” or “trap” Switch to kernel mode: the OS is notified and takes control ofthe situation31

Do We Need an OS?UC Santa Barbara For a specialized application (e.g., a microwave oven, a car), an OSmay not be needed The hardware can directly be programmed with the rudimentaryfunctionalities required by these applications A general-purpose computer, on the other hand, needs to run a widerange of user programs For such a system, an OS is indeed necessary Otherwise, each user will need to program its own operating systemservices An OS can do this for once and make it available to the user programs32

The operating system is a resource manager that provides an orderly and controlled allocation of resources The operating system is an implementer of multiple virtual (extended) machines that are easier to program than the underlying hardware Goal: – Each program/application can be developed as if the whole

Related Documents:

B.J.M. de Rooij B.J.W. Thomassen eo B.J.W. Thomassen eo B.M. van der Drift B.P. Boonzajer Flaes Baiba Jautaike Baiba Spruntule BAILEY BODEEN Bailliart barb derienzo barbara a malina Barbara A Watson Barbara Behling Barbara Betts Barbara Clark Barbara Cohen Barbara Dangerfield Barbara Dittoe Barbara Du Bois Barbara Eberhard Barbara Fallon

Samy’s Camera and Digital Santa Barbara Adventure Company Santa Barbara Four Seasons Biltmore Santa Barbara Museum of Natural History Santa Barbara Sailing Center Santa Barbara Zoo SBCC Theatre Michael J. Singer, IntuitiveSurf Happens Suzanne’s Restaurant Terra Sol The Cottage - Kristine

R2: City of Santa Barbara Survey Benchmarks 2008 Height Modernization Project, on file in the Office of the Santa Barbara County Surveyor R3: Santa Barbara Control Network, Record of Survey Book 147 Pages 70 through 74, inclusive, Santa Barbara County Recorder's Office R4: GNSS Surveying Standards And Specifications, 1.1, a joint publication of

4 santa: ungodly santa & elves: happy all the time santa: when they sing until they’re bluish, santa wishes he were jewish, cause they’re santa & elves: happy all the time santa: i swear they're santa & elves: happy all the time santa: bizarrely happy all the time (elves ad lib: "hi santa" we love you santa" etc.) popsy:

UNIVERSITY OF CALIFORNIA, SANTA BARBARA BERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO SANTA BARBARA SANTA CRUZ Department of Ecology, Evolution and Marine Biology Santa Barbara, Calif. 93106-9610 U.S.A. Phone: (805) 893-3730

With Santa Barbara and the immediate adjacent area serving as home to several colleges and universities, educational opportunities are in abundance. They include the acclaimed research institution University of California at Santa Barbara, Westmont College, Antioch University, Santa Barbara City College, as

University of California, Santa Barbara, Army ROTC Santa Barbara Santa Barbara Council CA (California) USA Santa Barbara CA (California) Coast Guard Aviation Unit (Deployable) USCG Helicopter Interdiction and Tactical Squadron 10 (HITRON 10), Jacksonville, FL Jacksonville Saint Augustine/Palm

Express Grants Up to 10,000 per request Applications must be received via email by 1:00 pm on Wednesday, December 1, 2021 Santa Barbara Office 5385 Hollister Ave., Bldg. 10, Suite 110 Santa Barbara, CA 93111 . Telephone: 805-884-8085 . Santa Maria Office 218 Carmen Lane, Suite 111 . Santa Maria, CA 93458 . Telephone: 805-803-8743 Contact Person: