电机资讯工程实习 个人电脑系统(英文版)ppt课件_第1页
电机资讯工程实习 个人电脑系统(英文版)ppt课件_第2页
电机资讯工程实习 个人电脑系统(英文版)ppt课件_第3页
电机资讯工程实习 个人电脑系统(英文版)ppt课件_第4页
电机资讯工程实习 个人电脑系统(英文版)ppt课件_第5页
已阅读5页,还剩34页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、1EE110300 電機資訊工程實習Lecture 3 個人電腦系統 II - Operating Systemsdocin/sundae_meng2What is an operating system?DefinitionAn operating system is the “permanent software that controls/abstracts hardwareUser applications can thus be simpler and device-independentphysical machine interfaceUser ApplicationsOpera

2、ting SystemArchitecturevirtual machine interface3What is an operating system?Definition (cont)Manages resources and processes to support different user applicationsProvides Applications Programming Interface (API) for user applicationsUser ApplicationOperating SystemArchitectureUser Application4Mode

3、rn operating systemsx86 platformLinuxWindowsMac platform Mac OSSun Solaris & Unix (Sun workstations)IBM AIX (mainframes)Embedded systems (special-purpose OS)Palm, PocketPC, etcXbox, etc5Linus Torvalds1991, Finland, Linux Project1992, Linux Kernel 0.02Bash v1.08GCC v1.402019, Moves to Transmeta20

4、19, Linux Kernel v2.22019, Linux Kernel v2.4Pronunciation: “Linn-ucks6Windows 2000 & XP1989: 10 developers left DEC VMS team and joined Microsoft Windows NT 1.02019: Windows NT 4.02019: Windows 20002019: Windows XP2019: Microsoft .Net Server7Linux vs. Windows NTLinux is kernel only, free and ope

5、n sourceWindows is full-loaded OS and pricyLinux requires minimum HW, Windows notWeb server(Win2K + SWC ) beats (Linux + TUX)File server & printer serverWindows supports a wider range of HWLinux has more stable drivers8Operating System Interfacesdocin/sundae_meng9Software & hardware layerUse

6、r ProgramExecutable BinaryCompilerLinkerSystem libraryArchitectureusercompilerOS interfaceOSHardwaredevice driversOperating Systemkerneluser mode10Device DriverDevice driver的独一目的就是要將一切的硬體隱藏.他應該是整套軟體中独一能和硬體溝通的窗口.他能直接讀取或寫入特定裝置控制及狀態暫存器, 假设裝置發生中斷,那ISR也要整合到裝置驅動程式.11System service call (monitor)C Programs

7、:main() / call printf, provided/ by the C library, to/ print on the screenprintf(“Hello World!);Borland C library:Borland C library:Int printf() Int printf() / call SysOutputString,/ call SysOutputString,/ provided by NT / provided by NT / system library, to/ system library, to/ print on the screen/

8、 print on the screenSysOutputString();SysOutputString(); NT library:NT library:Void SysOutputString() Void SysOutputString() / call NtOutputString, that in turn will call / call NtOutputString, that in turn will call / video card driver to output strings to / video card driver to output strings to /

9、 the screen/ the screenNtOutputString();NtOutputString(); 12System service call (disk)C Programs:main() / call CreateFile / by the C library, to/ create a file on diskCreateFile(“a.txt)Borland C library:Borland C library:Int CreateFile() Int CreateFile() / call NtCreateFile,/ call NtCreateFile,/ pro

10、vided by NT to/ provided by NT to/ create a file/ create a fileNtCreateFile();NtCreateFile(); NT library:NT library:Void NtCreateFile() Void NtCreateFile() / call NtInternalCreateFile, that in turn will / call NtInternalCreateFile, that in turn will / call the file system driver and the disk / call

11、the file system driver and the disk / driver to create a file on a disk / driver to create a file on a disk NtInternalCreateFile(); NtInternalCreateFile(); 13System service calls (network)C Programs:main() so = createsocket();send(so, “text);close(so);Borland C library:Borland C library:int createso

12、cket() int createsocket() NtCreateSocket(); NtCreateSocket(); int send() int send() NtSocketSend(); NtSocketSend(); NT library:NT library:Void NtCreateSocket() Void NtCreateSocket() NtAfdCreateSocket(); NtAfdCreateSocket(); 1415Virtual computer conceptC+ compilerFORTRAN compilerC compilerJava compil

13、erAssemblerOperatingSystemCommandinterpreterLISP interpreterOperating systemMacroinstruction interpreterBare machineVirtual CComputerVirtual C+Computer16Importance of operating systemSystem API are the only interface between user applications and hardwareAPI are designed for general-purpose, not per

14、formance driven (e.g. network applications)OS code cannot allow any bugAny break (e.g. invalid access) causes rebootThe owner of OS technology controls the software industry17What is Embedded System?是電腦軟體與硬體的綜合體,亦可涵蓋機械或其他附屬裝置;整個綜合體設計的目的,在於滿足某種特殊功能.例如 : PDA, 遊樂器, 衛星導航系統, 流程管理器 等.docin/sundae_meng18Em

15、bedded system architecture3-layered devicePalm, PocketPCUser ApplicationsEmbedded OSHardware2-layered deviceXBoxHardwareApplication19General-purpose & embedded OSGeneral-purpose Embedded OSExamplesLinux, WindowsWinCE, Palm OSHardwareGeneral-purpose Special deviceOS code sizeLargeSmallStability r

16、eq.StrongWeakDevelop. costHugeMedium20Operating system conceptsdocin/sundae_meng21Process & ThreadHow do different applications run on the same machine at the same time without interfering each other?Protection between processesProtection between a process and the OSProcess: an execution of a pr

17、ogram, consisting of a virtual address space, one or more threads, and some OS states.22Virtual memory (address space)0232 - 1virtual address space (4GB)page 0page 1page 2page 220vap0vap1xpage tablephysical memory (16MB)pp 0pp 1pp 2pp Npaging filepp 212x23Virtual memory (address space)0232 - 1virtua

18、l address space (4GB)page 0page 1page 2page 220vap0vap1xpage tablephysical memory (16MB)pp 0pp 1pp 2pp Npaging filepp 21224Memory managerphysical memorypp 0pp 1pp 2pp Npaging filepp 212process VAprocess VAPTPT25Memory manager physical memorypp 0pp 1pp 2pp Npaging filepp 212process VAprocess VAPTPT26

19、Memory manager (w/ constraint)physical memorypp 0pp 1pp 2pp Npaging filepp 212process VAprocess VAPTPTxmemory manager27Protectiondual mode operationCan application modify its own page table? If it could, could get access to all physical memory. Dual ModeKernel/protected model: no restriction, can to

20、uch any physical memory pageUser mode: where you program runs, can only touch part of the virtual address spaceApplications can enter the kernel mode through systems calls (traps)28Mode change: system call trap1. System call traps to the kernel (kernel mode)2. Kernel determines service routine requi

21、red3. Kernel services the call.4. Control is returned to user program (user mode)29ThreadA process starts with one thread (main thread), and can initialize more threads by CreateThread() callsA thread represents an execution stream of instructions and its CPU register contextA thread is the unit use

22、d in the schedulerKill a process kill its all threads30SchedulerA component in OS that decides which thread in the thread pool gets the CPUPriority-based schedulerContext switchnew threadschedulerreadyrunningwaitingterminatingthreadssignalevents31SynchronizationAll threads in the same process share

23、all global dataSynchronization among these threads is necessary to maintain data integrityResource lock is commonly used to guarantee thread mutual exclusiveabuse of such locks decreases scalabilityignorance of such locks decreases stabilityDeadlock issues32File SystemsA hard disk is just a raw medi

24、a storageA hard disk device driver allows OS to communicate with the hardwareBut, it is the responsibility of the OS to organize disk sectors/tracks for storing filessuch component is called the file systemE.g. A hard disk that stores NTFS information cannot be read with the FAT32 driverexample: pap

25、er with Moses code33Operating Systems and System SoftwareExample: web server softwaredocin/sundae_meng34User-mode web server architectureWeb ServerCMweb cachenetwork cardTCPIPUser ModeKernel ModeI/O moduleSocketSystem CacheFileSys35User-mode web server commonsUser-mode application architecturee.g. Microsoft Inter

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论