1. - Provide an environment to execute user programs that are separate from the o/s. - Emulate certain hardware features. - Control system resources, provides a base to allow applications to be written. 2. - Allows several jobs to be executed simultaneously in the CPU - Allows another job to execute while the previous job is waiting - Example : Job waiting for network 3. - Allows multiple users to use the same computer at the same time by the CPU allocating a time slice for the jobs of each user - Allows interactive use of the computer system at a reasonable cost 4. - Real time system gives a program a certain time window to react else the program is killed thus cannot use time slice - Critical systems cannot have time slice and wait 5.a)- Users using/stealing another person's files - A User using up all the system resources 5.b)- Yes. Virtual Machine seperates the states and files from other users 6. Mainframe computers - maximize resource utilization - efficiency, and fairness among users - maximize throughput Personal Computers - Single user at a time, all resources allocate to the user - Need quick response time 7. RTS needs a fast response GUI - waste resources by maintaining "pretty" interface Convenience at the expense of resource 8. User is only using low resource program such as word, better to use time sharing as it reduce cost of having many computers 9. - A trap is an event to catches errors and software generated - An interrupt is a harware generated event that tells the o/s that hardware I/O status 10 a.) Set value of timer Yes b.) Read the clock No c.) Clear Memory Yes d.) Turn off interrupts Yes e.) Switch from user to monitor Yes f.) Modifying base and limit registers Yes 11. - very fast memory located next to CPU, - cache are useful for storing batch instructions that can be executed quickly - Inconsistency, data in memory not same as on disk - cache is very expensive 13. It is the interface between the user and the o/s Can change the interface without changing the kernel 14. System calls provide the interface between the running program and the o/s 15. Speed. Libary function takes longer to call Overhead when switching from user to kernel 16. The separation of policy and mechanism is a very important principle; - it allows maximum flexibility if policy decisions are to be changed later. Mechanism - Scheduling Policy - Configuration 17. - Allows the protection of system resources from total isolation from other virtual machines - Perfect for O/S research and development 18. (i) Process control - fork - exec - sleep - wait, waitpid - pthread - getpid - nice (ii) File manipulation - fopen/fclose - open/close - read/fread - lseek - unlink - chmod,chown - fcntl - chdir - getcwd (iii) Device manipulation (memory, tape drives etc.) - mount/umount - open/close - read/write - ioctl (iv) Information maintenance - time - stime - stat, fstat (v) Communications - popen/pclose - signal - kill - alarm - msgget, msgsend, msgrcv - POSIX msgQ - semget, semop, semctl - semaphore - shmget, shmat, shmctl