... continued ...
-system calls are internal command instructions to the kernel.
-they are an interface to the services made available by an operating system.
-user programs use system calls to interact with the kernel and in turn the hardware.
-system calls are generally routines written in C (occassionaly C++ or Assembly).
-Examples of system calls - open(), read(), write(), exec(), fork() etc..
-usually OS, provide a set of APIs that programmers can use without having to dabble with system calls.
-the APIs give a uniform set of commands that internally call system calls
-Examples of APIs are three - Posix APIs (Linux, Unix, Aapl); Win32 (Windows); Java API for JVMs.
-Six types of system calls relate to - process, file, device, info, communication, protection.
-multitasking os usually require interprocess communication.
-interprocess communication can be one of two models - message passing model or shared memory model.
-in mpm, message tokens are passed bet two procs while they are in their own address spaces.
-in smm, two processes agree to share some of their address space in order to communicate.
-mpm is suitable for small amounts of data share, esp between two computers.
-smm is suitable for large data share and is faster.
-smm is more complicated to implement than mpm.
-virtual machines:
-the fundamental idea behind virtual machines is to abstract h/w of a single system into multiple execution env.
-vm is attained via a vm abstraction layer (called hypervisor) for the h/w and cpu scheduling.
-vm tricks the guest os to think that they are in full control of the h/w.
-in this no changes on the guest os are reqd.
-paravirtualization - is another variation of vm.
-in pvm, the guest os is presented with an exec env which is similar but not identical to guest's preferred system.
-in other words, the guest must be modified to run the pvm h/w.
-in pvm only one kernel is insalled and h/w is not virtualized (the kernel env is global env)
-rather the host os and its devices are virtualized (the guest env are local env)
-this provides the processes in the guest os to think that they are the only procs on the system.
-examples of pvm are solaris containers.
-from an implementation perspective, the host os has a kernel mode and a vm env that is in user mode.
-then within the vm env, each guest os has its own 'virtual' kernel and user modes.
-when the guest os makes a system call, it is passed to the hypervisor.
-the hypervisor then changes the register contents and program counter for the vm to simulate a real system call.
-vm require h/w support.
-in vmware, the hypervisor runs in the physical user mode.
-in other words, vmware runs as an application tool on top of the os.
-virtual machines running on top of vmware think that they are running on bare h/w.
-processes:
-a process is a program in execution. it is the unit of work in computing.
-it is a running set of resources like cpu time, memory, files and io devices.
-every process has an address space in memory, where it executes.
-the address space comprises:
. text -program file
. data -global vars, constants
. heap -dynamic memory location
. stack -temp area for functions, params, vars etc
. empty space -between heap and stack for growth of either
-a process changes state during execution.
-process states could be new, ready, running, waiting, terminated.
-process control block (pcb) is the info that the operating system maintains for every process.
-the process control block is how the os identifies each process and operates on it.
-the process control block contains imp info like state, register address, memory addr, account info etc.
-a process may have multiple threads of execution.
-threads increase efficiency in computing.
-if a program is invoked multiple times, they have different processes and threads but might share some info.
-eg: if a browser is opened multiple times simultaneosly, each will be a separate process they may share some cache info.
-process scheduler is a programming construct of the os.
-the job of process scheduler is to select the process to run on the cpu from a pool of pcbs.
-when scheduled, each resource (cpu, mem, disk) will have its own queue that has multiple processes that wait on that resource.
-processes can be cpu bound or io bound ie one that spends more time on cpu or io operations resp.
-for efficiency a scheduler needs to put a good mix of cpu and io bound procs.
-context switch is the operation during which a cpu switches between procs.
-in context switch the cpu stops and saves its current proc and starts a new one.
-the time spent in context switch is a cpu overhead as the cpu does not do any useful work during this time.
... continued ...
-system calls are internal command instructions to the kernel.
-they are an interface to the services made available by an operating system.
-user programs use system calls to interact with the kernel and in turn the hardware.
-system calls are generally routines written in C (occassionaly C++ or Assembly).
-Examples of system calls - open(), read(), write(), exec(), fork() etc..
-usually OS, provide a set of APIs that programmers can use without having to dabble with system calls.
-the APIs give a uniform set of commands that internally call system calls
-Examples of APIs are three - Posix APIs (Linux, Unix, Aapl); Win32 (Windows); Java API for JVMs.
-Six types of system calls relate to - process, file, device, info, communication, protection.
-multitasking os usually require interprocess communication.
-interprocess communication can be one of two models - message passing model or shared memory model.
-in mpm, message tokens are passed bet two procs while they are in their own address spaces.
-in smm, two processes agree to share some of their address space in order to communicate.
-mpm is suitable for small amounts of data share, esp between two computers.
-smm is suitable for large data share and is faster.
-smm is more complicated to implement than mpm.
-virtual machines:
-the fundamental idea behind virtual machines is to abstract h/w of a single system into multiple execution env.
-vm is attained via a vm abstraction layer (called hypervisor) for the h/w and cpu scheduling.
-vm tricks the guest os to think that they are in full control of the h/w.
-in this no changes on the guest os are reqd.
-paravirtualization - is another variation of vm.
-in pvm, the guest os is presented with an exec env which is similar but not identical to guest's preferred system.
-in other words, the guest must be modified to run the pvm h/w.
-in pvm only one kernel is insalled and h/w is not virtualized (the kernel env is global env)
-rather the host os and its devices are virtualized (the guest env are local env)
-this provides the processes in the guest os to think that they are the only procs on the system.
-examples of pvm are solaris containers.
-from an implementation perspective, the host os has a kernel mode and a vm env that is in user mode.
-then within the vm env, each guest os has its own 'virtual' kernel and user modes.
-when the guest os makes a system call, it is passed to the hypervisor.
-the hypervisor then changes the register contents and program counter for the vm to simulate a real system call.
-vm require h/w support.
-in vmware, the hypervisor runs in the physical user mode.
-in other words, vmware runs as an application tool on top of the os.
-virtual machines running on top of vmware think that they are running on bare h/w.
-processes:
-a process is a program in execution. it is the unit of work in computing.
-it is a running set of resources like cpu time, memory, files and io devices.
-every process has an address space in memory, where it executes.
-the address space comprises:
. text -program file
. data -global vars, constants
. heap -dynamic memory location
. stack -temp area for functions, params, vars etc
. empty space -between heap and stack for growth of either
-a process changes state during execution.
-process states could be new, ready, running, waiting, terminated.
-process control block (pcb) is the info that the operating system maintains for every process.
-the process control block is how the os identifies each process and operates on it.
-the process control block contains imp info like state, register address, memory addr, account info etc.
-a process may have multiple threads of execution.
-threads increase efficiency in computing.
-if a program is invoked multiple times, they have different processes and threads but might share some info.
-eg: if a browser is opened multiple times simultaneosly, each will be a separate process they may share some cache info.
-process scheduler is a programming construct of the os.
-the job of process scheduler is to select the process to run on the cpu from a pool of pcbs.
-when scheduled, each resource (cpu, mem, disk) will have its own queue that has multiple processes that wait on that resource.
-processes can be cpu bound or io bound ie one that spends more time on cpu or io operations resp.
-for efficiency a scheduler needs to put a good mix of cpu and io bound procs.
-context switch is the operation during which a cpu switches between procs.
-in context switch the cpu stops and saves its current proc and starts a new one.
-the time spent in context switch is a cpu overhead as the cpu does not do any useful work during this time.
... continued ...
No comments:
Post a Comment