SYSTEM CALL PARAMETER PASSING Often,more information is required than simply identity of desired system call Exact type and amount of information vary according to OS and call o Three general methods used to pass parameters to the OS Simplest:pass the parameters in registers o In some cases,may be more parameters than registers Parameters stored in a block,or table,in memory,and address of block passed as a parameter in a register o This approach taken by Linux and Solaris Parameters placed,or pushed,onto the stack by the program and popped off the stack by the operating system Block and stack methods do not limit the number or length of parameters being passed
SYSTEM CALL PARAMETER PASSING Often, more information is required than simply identity of desired system call Exact type and amount of information vary according to OS and call Three general methods used to pass parameters to the OS Simplest: pass the parameters in registers In some cases, may be more parameters than registers Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register This approach taken by Linux and Solaris Parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system Block and stack methods do not limit the number or length of parameters being passed
DUAL-MODE OPERATION o Dual-mode operation allows OS to protect itself and other system components User mode and kernel mode Mode bit provided by hardware o Provides ability to distinguish when system is running user code or kernel code o Some instructions designated as privileged,only executable in kernel mode o System call changes mode to kernel,return from call resets it to user
DUAL-MODE OPERATION Dual-mode operation allows OS to protect itself and other system components User mode and kernel mode Mode bit provided by hardware Provides ability to distinguish when system is running user code or kernel code Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user
CONCURRENCY o What problem does concurrent mechanism solve? o Why use concurrent mechanism?
CONCURRENCY What problem does concurrent mechanism solve? Why use concurrent mechanism?
CONCURRENCY o How does it work? ·Processes switch o What problems does the concurrency bring? ● CPU scheduling ·Interrupt ● 。·0·
CONCURRENCY How does it work? Processes switch What problems does the concurrency bring? CPU scheduling Interrupt ……
THE BASIC PROBLEM OF CONCURRENCY o The basic problem of concurrency involves resources: Hardware:single CPU,single DRAM,single I/O devices Multiprogramming API:users think they have exclusive access to shared resources o OS Has to coordinate all activity Multiple users,I/O interrupts,... How can it keep all these things straight? o Basic Idea:Use Virtual Machine abstraction Decompose hard problem into simpler ones Abstract the notion of an executing program Then,worry about multiplexing these abstract machines o Dijkstra did this for the“THE system” Few thousand lines vs 1 million lines in OS 360(1K bugs)
THE BASIC PROBLEM OF CONCURRENCY The basic problem of concurrency involves resources: Hardware: single CPU, single DRAM, single I/O devices Multiprogramming API: users think they have exclusive access to shared resources OS Has to coordinate all activity Multiple users, I/O interrupts, … How can it keep all these things straight? Basic Idea: Use Virtual Machine abstraction Decompose hard problem into simpler ones Abstract the notion of an executing program Then, worry about multiplexing these abstract machines Dijkstra did this for the “THE system” Few thousand lines vs 1 million lines in OS 360 (1K bugs)