--- tags: 作業系統 --- # 作業系統 Ch2 Operation system structure ### OS Service - user interface - I/O operation - error detection - file manipulation - program execution - communication - resoure sharing - security & protection - accounting ### UI - shell - sometimemulti flavor implemented ### system call pass parameter - register - stack - table、block ### system program - file management - status info - file modification - programming - language support - program loading and execution - communication - background service: run in user context(ex:daemon) - applicaiton service: don't pertain to system ### implementation - port: high-level language easy to port to other hardware ### kernal environment structure - simple | MS-DOS - application program -> resident system program -> MS-DOS device driver -> ROM BIOS device driver - more complex | Unix (ex: BSD Unix) - system program 、 kernel - layered approach - abstraction - microkernal | Mach <-> monolithic - move service from kernal -> user - msg passing (overhead) - module - loadable kernal module - hybrid ### Debugging - core dump: application failure - crash dump: OS failure - trace listing - profiling: periodic sampling of instruction look for statistical trend ### system boot - firmware ROM hold init boot code - GRUB: bootstap loader