CPSC 3220 - DAY 2 AUGUST 29, 2017 ================================================================================ Kernel ------ Lowest level of software running on the system Purpose is to implement protection Kernel is fully trusted and has access to all the hardware. Untrusted Code -------------- We should restrict privileges of untrusted code Should not have access to all the hardware Should not have ability to modify the kernel or other applications Early Operating Systems ----------------------- One application at a time. OS was runtime library Users would stand in line to use the computer Batch systems - keep CPU busy by having a queue of jobs Time-Sharing Operating Systems: Computers and People are expensive ------------------------------------------------------------------ Multiprogramming: running multiple programs at the same time. Interactive performance: try to complete everyone's tasks quickly As computers became cheaper, more important to optimize for user time, not computer time. Challenge: Protection --------------------- How do we execute code with restricted privileges? Either because the code is buggy or if it might be malicious Some examples: A script running in a web browser A program you just downloaded off the internet A program you just wrote that you haven't tested yet Stages of a Program ------------------- Source file on disk Executable file on disk After compiling and linking Set of machine instructions (with a specified entry point) and initialized data Memory image After loading Stack, heap and unitialized data areas added to provide full execution environment