【大學課件】-電機資訊工程實習-個人電腦系統(tǒng)(英文版)_第1頁
【大學課件】-電機資訊工程實習-個人電腦系統(tǒng)(英文版)_第2頁
【大學課件】-電機資訊工程實習-個人電腦系統(tǒng)(英文版)_第3頁
【大學課件】-電機資訊工程實習-個人電腦系統(tǒng)(英文版)_第4頁
【大學課件】-電機資訊工程實習-個人電腦系統(tǒng)(英文版)_第5頁
已閱讀5頁,還剩33頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、1What 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 ApplicationsOperating SystemArchitecturevirtual machine interface2What is an operating sys

2、tem?Definition (cont)Manages resources and processes to support different user applicationsProvides Applications Programming Interface (API) for user applicationsUser ApplicationOperating SystemArchitectureUser Application3Modern operating systemsx86 platformLinuxWindowsMac platform Mac OSSun Solari

3、s & Unix (Sun workstations)IBM AIX (mainframes)Embedded systems (special-purpose OS)Palm, PocketPC, etcXbox, etc4Linus Torvalds1991, Finland, Linux Project1992, Linux Kernel 0.02Bash v1.08GCC v1.401997, Moves to Transmeta1998, Linux Kernel v2.22001, Linux Kernel v2.4Pronunciation: “Linn-ucks”5Window

4、s 2000 & XP1989: 10 developers left DEC VMS team and joined Microsoft Windows NT 1.01996: Windows NT 4.01999: Windows 20002001: Windows XP2002: Microsoft .Net Server6Linux vs. Windows NTLinux is kernel only, free and open sourceWindows is full-loaded OS and pricyLinux requires minimum HW, Windows no

5、tWeb server(Win2K + SWC ) beats (Linux + TUX)File server & printer serverWindows supports a wider range of HWLinux has more stable drivers7Operating System Interfacesdocin/sundae_meng8Software & hardware layerUser ProgramExecutable BinaryCompilerLinkerSystem libraryArchitectureusercompilerOS interfa

6、ceOSHardwaredevice driversOperating Systemkerneluser mode9Device DriverDevice driver的唯一目的就是要將所有的硬體隱藏.他應(yīng)該是整套軟體中唯一能和硬體溝通的窗口.他能直接讀取或?qū)懭胩囟ㄑb置控制及狀態(tài)暫存器, 如果裝置發(fā)生中斷,那ISR也要整合到裝置驅(qū)動程式.10System service call (monitor)C Programs:main() / call printf, provided/ by the C library, to/ print on the screenprintf(“Hello W

7、orld!”);Borland C library:Int printf() / call SysOutputString,/ provided by NT / system library, to/ print on the screenSysOutputString();NT library:Void SysOutputString() / call NtOutputString, that in turn will call / video card driver to output strings to / the screenNtOutputString();11System ser

8、vice call (disk)C Programs:main() / call CreateFile / by the C library, to/ create a file on diskCreateFile(“a.txt”)Borland C library:Int CreateFile() / call NtCreateFile,/ provided by NT to/ create a fileNtCreateFile();NT library:Void NtCreateFile() / call NtInternalCreateFile, that in turn will /

9、call the file system driver and the disk / driver to create a file on a disk NtInternalCreateFile();12System service calls (network)C Programs:main() so = createsocket();send(so, “text”);close(so);Borland C library:int createsocket() NtCreateSocket();int send() NtSocketSend();NT library:Void NtCreat

10、eSocket() NtAfdCreateSocket();1314Virtual computer conceptC+ compilerFORTRAN compilerC compilerJava compilerAssemblerOperatingSystemCommandinterpreterLISP interpreterOperating systemMacroinstruction interpreterBare machineVirtual CComputerVirtual C+Computer15Importance of operating systemSystem API

11、are the only interface between user applications and hardwareAPI are designed for general-purpose, not performance 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 industry16What is Embedded Sy

12、stem?是電腦軟體與硬體的綜合體,亦可涵蓋機械或其他附屬裝置;整個綜合體設(shè)計的目的,在於滿足某種特殊功能.例如 : PDA, 遊樂器, 衛(wèi)星導航系統(tǒng), 流程管理器 等.docin/sundae_meng17Embedded system architecture3-layered devicePalm, PocketPCUser ApplicationsEmbedded OSHardware2-layered deviceXBoxHardwareApplication18General-purpose & embedded OSGeneral-purposeEmbedded OSExampl

13、esLinux, WindowsWinCE, Palm OSHardwareGeneral-purposeSpecial deviceOS code sizeLargeSmallStability req.StrongWeakDevelop. costHugeMedium19Operating system conceptsdocin/sundae_meng20Process & ThreadHow do different applications run on the same machine at the same time without interfering each other?

14、Protection between processesProtection between a process and the OSProcess: an execution of a program, consisting of a virtual address space, one or more threads, and some OS states.21Virtual memory (address space)0232 - 1virtual address space (4GB)page 0page 1page 2page 220vap0vap1xpage tablephysic

15、al memory (16MB)pp 0pp 1pp 2pp Npaging filepp 212x22Virtual memory (address space)0232 - 1virtual address space (4GB)page 0page 1page 2page 220vap0vap1xpage tablephysical memory (16MB)pp 0pp 1pp 2pp Npaging filepp 21223Memory managerphysical memorypp 0pp 1pp 2pp Npaging filepp 212process VAprocess V

16、APTPT24Memory manager physical memorypp 0pp 1pp 2pp Npaging filepp 212process VAprocess VAPTPT25Memory manager (w/ constraint)physical memorypp 0pp 1pp 2pp Npaging filepp 212process VAprocess VAPTPTxmemory manager26Protectiondual mode operationCan application modify its own page table? If it could,

17、could get access to all physical memory. Dual ModeKernel/protected model: no restriction, can touch 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)27Mode change: system cal

18、l trap1. System call traps to the kernel (kernel mode)2. Kernel determines service routine required3. Kernel services the call.4. Control is returned to user program (user mode)28ThreadA process starts with one thread (main thread), and can initialize more threads by CreateThread() callsA thread rep

19、resents an execution stream of instructions and its CPU register contextA thread is the unit used in the schedulerKill a process kill its all threads29SchedulerA component in OS that decides which thread in the thread pool gets the CPUPriority-based schedulerContext switchnew threadschedulerreadyrun

20、ningwaitingterminatingthreadssignalevents30SynchronizationAll threads in the same process share 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 scalabilityignora

21、nce of such locks decreases stabilityDeadlock issues31File SystemsA hard disk is just a raw media 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 syst

22、emE.g. A hard disk that stores NTFS information cannot be read with the FAT32 driverexample: paper with Moses code32Operating Systems and System SoftwareExample: web server softwaredocin/sundae_meng33User-mode web server architectureWeb ServerCMweb cachenetwork cardTCPIPUser ModeKernel ModeI/O moduleSocketSystem CacheFileSys34User-mode web server commonsUser-mode application architecturee.g. Microsoft Internet Information Server (IIS), Netscape Enterprise Server, Apache HTTP Server, et

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論