CamScanner ١٠-٣١-٢٠٢١ ١٢.٥٨

You might also like

Download as pdf
Download as pdf
You are on page 1of 13
General Part 2 os M.A.S G INTRODUCTION > Operating system operations neral = Most OS are interrupt driven. => If there are no processes to execute, no 1/0 devices to service and no users to whom to respond and OS will sit quietly waiting for something to happen. = Events are almost always signalled by the occurrence of an interrupt or trap. r > Trap and interrupt at via a7 im Trap ' = | Interrupt | e An exception in a user process. ™ | e Generated by the hardware devices (the > hard disk, graphics card, /O ports, e It's caused by division by zero or .\ pec). | invalid memory access. \: Tyan nchronous (i.e. they e The usual way to invoke a kernel mode don't happen at predictable places in because those rufjwith a higher 4 the user code). priority than user code. = \ | ¢ Handling is synchronous e These are synchronous (happen at same.times each time run sw)p y | \ | le Handi is Mao (so the user code is si pended and.continues afterwards). » . > » » > Dual-Mode Operation = We need two modes of operation : user mode and kernel mode = It allows OS to protect itself and other system components. = Abit called the mode bit is used to indicate the current mode: kernel (0) or user (1). = We can distinguish between a task that is executed on behalf of the operating system and one that is executed on behalf of the user. = All instructions that may cause harm are deigned as privileged. Ae os M.A.S General = Privileged instructions can execute only in kernel mode (i.e. by 0S). = When a user requests a service from the operating system (viaa system call), the system must transition user process user mode \ (mode bit = 1) calls system call return frorn system call trap return mode bit = 0 mode bit = 1 kernel mode J it = 0} execute system call (mode bit = 0) = Sometimes, differen by various kernel components. Aa to preventa user f ogram from getting stuck in an infinite loop fail to call’ system services and never return control to the ating system (Use timer). accomplish this goal, we can use a time. A timer can be set to interrupt the computer after a specified period, The period may be fixed or variable but when counter reach 0 interrupt he OS sets the counter before turning the control to a user program. > Every time the clock ticks, the counter is decremented. > When the counter reaches 0, an interr upt occurs and control return to the OS, oe M.A.S. General > The OS may treat the interrupt as a fatal error or give the program more time. => Clearly, instructions to modify the content of the timer are privileged. » Computing environments: 1. Traditional Computing = Computer systems started as mainframe computers. = Mainframes were used primarily by large org nizations. = Mainframe computers have evolved from ba ch systems to multiprogramming systems, and then time-sharing systems. ae | = Processed jobs in bulk, one j : => Input devices were card readersia ; CPU is always executing a job (no idle time). If the running job needs it for an I/O operation, the OS picks another ution. = Increased CPU utilization but still no direct interaction. 4 : = This requires the OS to provide several features: t — > 1/0 routines; only the MAS General > CPU scheduling; to selecting a job for execution. > Memory management; to allocate memory to several jobs, > Resource allocation; no job can use resources of other jobs. \ | = An interactive computer system = Provides direct communication between the user and the system. \ => Should be responsive (i.e. response time to user input should ke minimal). ' > \ = An extension of multiprogramming systems. \ => The CPU switches between jobs so frequently,that thewuser can interact with each program while it is running. : i = A personal computer dedicated to a sin = OS focuses on achieving user convent eld smartphones and tablet computers. table, lightweight, and battery-powered. le dev an provide features that are either unavailable or tical on a desktop or laptop computer, such as: _ > GPS; to determine precise location of the device on Earth. > Accelerometers: to measure linear acceleration in different directions. > Gyroscopes; to detect orientation of the device with respect to the ground. Ex: Apple iOS and Google Android. 4. Distributed Computing General > Computer networks are characterized by distances between nodes: > Personal-area network (PAN); wireless links over a short distance, > Local-area network (LAN): links nodes within a room, building, or campus, > Metropolitan-area network (MAN); connects computer nodes within a city, > Wide-area network (WAN); links nodes within buildings, cities, or countries, a => Adistributed system: is a collection of physically separate, possibly heterogeneous, computer systems that are networked together. Distributed computing is the use of a distributed sy tems to solve single large problems. may take the form of client-server computing or peer-to-peer computing. y 5.Client-Server Computing — ‘ee “SSE DE = Server systems satisfy requests of client systems. = A server can be rized as a compute-server or a file-server. s to create, update, read, and delete files. ie Client requests, execute actions, and return | nodes are pee here each node may act as A server, when roviding services to other nodes. A client, when requesting services rom other nodes, n client-server systems, a server is a bottleneck. In P2P systems, several nodes can provide the service. => Allows for creating a virtual machine that acts like a real computer. = Asingle computer (host) may run several virtual machines (guests). ts General . The host and the guests share the hardware, but each has its own OS. + The virtual machine manager runs the guest machines, manages their resource use, and protects each guest from the others. processes processes processes processes programming interface z, ‘virtual machine manager hardware 7. Cloud Computing iy = Delivers computing as a service and users pay, based on usage. => Uses virtualization to run millions of VMS on thousands of servers. => Acloud service é. be categorized as public, private, or hybrid cloud. => A public cloud i & . ‘* to anyone Via the Internet. s used nly by they company owning it. = A private cloud i d inc es beth, ublic and private cloud components. => Platform asa Firebase). => Infrastructure as a’service (IaaS) provides servers or storage over the internet 8. Real-Time Embedded Systems = Embedded computers are primitive with very specific tasks. => Their OSs provide limited features with little or no user interface. = Embedded systems almost always run real-time operating systems. => A real-time system has well-defined, fixed time constraints. =6- os MLAS liver interface > Provide a graphical user interface (GUI) or a command-line interface (CLI), > Program execution > Load programs into memory and run th medical imaging > A program must be able to end its execution, ally or abnormally, +> 1/0 operations > User processes cannot execute lon directly, > Therefore, the OS must provi perform 1/0, +> File-system manipul > Ensure correct computing by detecting errors in hardware or user programs, + Resource allocation > Allocate resources to the running processes, * Logging > Recording which process uses how much and what kinds of resources, > This record may be used for account billing or accumulating usage Statistics, os s en LA ACL + Protection and Security > Protec i tection ensures that all access to system resources |s controlled, > The security of the system from outsiders is also important, interface to the services provided by the OS. can use system calls to call the OS services. Is are available as functions written in C and C + +. eS embly-language. tem traps to the OS. vel tasks may be written using i poses executes a system call, the § vides Bee ncetion programmers with 0 me e services. o _— —— °°» + = The process of starting a computer by loading the kernel = tems, the bo rocess proceeds as fi : 1. The bootstrap program locates the kernel. 2. The kernel is loaded into memory and started. 3. The kernel initializes hardware. 4. The root le system is mounted. > Operating System Structures SP a Xs Se MAS General orem Soren > NO MENA aall, > DaReatt to daplement and extend, >» Commnanieation within the Kennel is fas => Vary tittte overhoad in the stent eal interlace, => Asingie, static binary fle Har nas ina single address space, > Tehy-coupladd as CHANGE CO ONE part oan affect other parts, => Saveral OSs use of this approach, such as UN layers, ty of each layer, are selected such that each uses functions of only lower-level layers ss What order in which to place the layers, ‘ + Less efficient > where going throw different |, time and increase overhead “10+ AWX, and Windows, debugged independently “if vero aie the error must be in that layer", : = No direct access to hardware wer & Every layer is concerned with its own functions wee OS a peta 4 Examples: o UNIX —s Remove nonessential component from kernel and implement them as user-level programs = Results in small kernel (microkernel) with small functions. > Minimal memory management, scheduling and communication. = Communication takes place between user mo, using message | Advantages: 4 All new services need to be added to user space 6 require the kernel to be modified. , the rest of the operating system remains ance overhead of user space to kernel space ication.

You might also like