date: 2024-03-08
title: 02-Operating System Structure
status: DONE
tags:
  - OS
  - NOTE
  - Lec2
archived: true
author:
  - AllenYGY
created: 2024-03-20T17:14
updated: 2024-03-21T21:01
publish: TrueOperating System Structure

UI,File tree,....UI
CLIGUI批处理CLICLI or command interpreter allows direct command entry.
内建指令程序名GUISystem calls provide an programming interface for programs to use services of operating systems.
Application Programming Interface specifies a set of functions that are available to an application programmer.
Portable Operating System Interface is – a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems.The caller just needs to obey API know nothing about how the system call is implemented Most details of OS interface hidden from programmer by API
The system call interface invokes the intended system call in OS kernel and returns status of the system call and any return values
Each system call has a number (as index)
System-call interface maintains a table: indexed according to these numbers

Standard C Library
Advantages of using Standard C Library
Advantages of using system Calls
Subset 
The C POSIX library was developed at the same time as the ANSI C standard. includes additional functions to those introduced in standard C
System programs provide a convenient environment for program development and execution. They can be divided into:
Most User's view of the operation system is
Apps compiled on one system usually are not executable on other operating systems
How can apps be used in multi-operating systems
解释性语言 包括虚拟机的语言标准语言Application Binary Interface (ABI) is
- about how different components of binary code can interface for a given operating system on a given architecture
-  in low-level details
定义了不同的二进制代码组件如何在特定操作系统和特定础础架构上进行交互的低级别细节。
OSes in assembly languageActually usually a mix of languages
有限结构化微内核Moves as much components from the kernel into user space
Communication takes place between user modules using message passing

Advantage
Disadvantages
Many modern operating systems implement loadable kernel modules (best practice)
Overall, similar to layers but with more flexible
E.g., Linux, Solaris, macOS, Windows, etc
Most modern operating systems: not one pure model (structure)
Example
When power is initialized on system, execution starts at a fixed memory location
Operating system must be made available to hardware so hardware can start it
引导程序, BIOS基本输入输出系统 stored in ROM or EEPROM locates the kernel, loads it into memory, and starts itBootstrap loader 引导程序  -----simple code to initialize the system 
守护进程 (services provided outside of the kernel)