《【大学课件】 电机资讯工程实习 个人电脑系统(英文版)》由会员分享,可在线阅读,更多相关《【大学课件】 电机资讯工程实习 个人电脑系统(英文版)(39页珍藏版)》请在金锄头文库上搜索。
1、1,EE110300 電機資訊工程實習 Lecture 3 個人電腦系統 II - Operating Systems,http:/ is an operating system? Definition,An operating system is the “permanent” software that controls/abstracts hardware User applications can thus be simpler and device-independent,physical machine interface,User Applications,Operating S
2、ystem,Architecture,virtual machine interface,3,What is an operating system? Definition (cont),Manages resources and processes to support different user applications Provides Applications Programming Interface (API) for user applications,User Application,Operating System,Architecture,User Application
3、,4,Modern operating systems,x86 platform Linux Windows Mac platform Mac OS Sun Solaris & Unix (Sun workstations) IBM AIX (mainframes) Embedded systems (special-purpose OS) Palm, PocketPC, etc Xbox, etc,5,Linus Torvalds,1991, Finland, Linux Project 1992, Linux Kernel 0.02 Bash v1.08 GCC v1.40 1997, M
4、oves to Transmeta 1998, Linux Kernel v2.2 2001, Linux Kernel v2.4 Pronunciation: “Linn-ucks”,6,Windows 2000 & XP,1989: 10 developers left DEC VMS team and joined Microsoft Windows NT 1.0 1996: Windows NT 4.0 1999: Windows 2000 2001: Windows XP 2002: Microsoft .Net Server,7,Linux vs. Windows NT,Linux
5、 is kernel only, free and open source Windows is full-loaded OS and pricy Linux requires minimum HW, Windows not Web server (Win2K + SWC ) beats (Linux + TUX) File server & printer server Windows supports a wider range of HW Linux has more stable drivers,8,Operating System Interfaces,http:/ & hardwa
6、re layer,User Program,Executable Binary,Compiler,Linker,System library,Architecture,user,compiler,OS interface,OS,Hardware,device drivers,Operating System,kernel,user mode,10,Device Driver,Device driver的唯一目的就是要將所有的硬體隱藏. 他應該是整套軟體中唯一能和硬體溝通的窗口. 他能直接讀取或寫入特定裝置控制及狀態暫存器, 如果裝置發生中斷,那ISR也要整合到裝置驅動程式.,11,System
7、 service call (monitor),C Programs: main() / call printf, provided / by the C library, to / print on the screen printf(“Hello World!”); ,Borland C library: Int printf() / call SysOutputString, / provided by NT / system library, to / print on the screen SysOutputString(); ,NT library: Void SysOutputS
8、tring() / call NtOutputString, that in turn will call / video card driver to output strings to / the screen NtOutputString(); ,12,System service call (disk),C Programs: main() / call CreateFile / by the C library, to / create a file on disk CreateFile(“a.txt”) ,Borland C library: Int CreateFile() /
9、call NtCreateFile, / provided by NT to / create a file NtCreateFile(); ,NT library: Void NtCreateFile() / call NtInternalCreateFile, that in turn will / call the file system driver and the disk / driver to create a file on a disk NtInternalCreateFile(); ,13,System service calls (network),C Programs:
10、 main() so = createsocket(); send(so, “text”); close(so); ,Borland C library: int createsocket() NtCreateSocket(); int send() NtSocketSend(); ,NT library: Void NtCreateSocket() NtAfdCreateSocket(); ,14,15,Virtual computer concept,C+ compiler,FORTRAN compiler,C compiler,Java compiler,Assembler,Operat
11、ing System Command interpreter,LISP interpreter,Operating system,Macroinstruction interpreter,Bare machine,Virtual C Computer,Virtual C+ Computer,16,Importance of operating system,System API are the only interface between user applications and hardware API are designed for general-purpose, not perfo
12、rmance driven (e.g. network applications) OS code cannot allow any bug Any break (e.g. invalid access) causes reboot The owner of OS technology controls the software industry,17,What is Embedded System?,是電腦軟體與硬體的綜合體,亦可涵蓋機械或其他附屬裝置;整個綜合體設計的目的,在於滿足某種特殊功能. 例如 : PDA, 遊樂器, 衛星導航系統, 流程管理器 等.,http:/ system a
13、rchitecture,3-layered device Palm, PocketPC,User Applications,Embedded OS,Hardware,2-layered device XBox,Hardware,Application,19,General-purpose & embedded OS,20,Operating system concepts,http:/ & Thread,How do different applications run on the same machine at the same time without interfering each
14、other? Protection between processes Protection between a process and the OS Process: an execution of a program, consisting of a virtual address space, one or more threads, and some OS states.,22,Virtual memory (address space),virtual address space (4GB),page 0,page 1,page 2,page 220,physical memory
15、(16MB),pp 0,pp 1,pp 2,pp N,paging file,pp 212,x,23,Virtual memory (address space),virtual address space (4GB),page 0,page 1,page 2,page 220,physical memory (16MB),pp 0,pp 1,pp 2,pp N,paging file,pp 212,24,Memory manager,physical memory,pp 0,pp 1,pp 2,pp N,paging file,pp 212,process VA,process VA,PT,PT,25,Memory manager,physical memory,pp 0,pp 1,pp 2,pp N,paging file,pp 212,process VA,process VA,PT,PT,26,Memory manager (w/ constraint