230 likes | 353 Views
January 2010 Boston Area Windows Server User Group. Inside the OS. Part 1. Tim Mangan Kahuna , TMurgent Technologies. Agenda. What is an OS? What is in Microsoft’s OS? CPU Memory Cache New Stuff Hyper-V. Part 2. What Is An Operating System?.
E N D
January 2010 Boston Area Windows Server User Group Inside the OS Part 1 Tim Mangan Kahuna, TMurgent Technologies
Agenda • What is an OS? • What is in Microsoft’s OS? • CPU • Memory • Cache • New Stuff • Hyper-V Part 2
What Is An Operating System? • Software that provides an abstraction of the hardware, and • Provides a set of services to higher layers (applications)
Thread Thread Process Applications Memory Operating System HaL Hardware CPU
CPU – Single Threaded OS DOS instr Instr … Instr Read kbd Instr … If <EOL> Call Program Jump top APPLICATION instr Instr … Instr Read kbd Instr … … If not done, Jump return Int TSR Instr … … EOI Instr … Ret Call TSR
Saving CPU Context • Interrupt, or Process/Thread swap • Current contents of CPU registers, program counters (current instruction address), etc must be saved (in memory) • Contents are later restored to resume processing
CPU – Multi Tasking OS Task 1 instr … Read Port A Instr … Yield Non Pre-emptive Purpose-Built OS 1ms instr … Instr Call Task 1 Call Task 2 Call Task 3 Instr … Housekeeping Jump top Task 2 instr … Read Port B Instr … Yield 1ms Task 3 instr … Complicated stuff …. Instr … Yield 3ms Int Instr … … EOI
CPU – Multi Tasking OS APPLICATION (LP) Pre-emptive instr … Instr Read port … Instr Jump Windows 16-bit instr Instr … Instr App Ready? Instr … Housekeeping … Jump top APPLICATION (HP) instr … Instr Move Data Instr … If not done Jump Exit Int Instr … … EOI Swap App?
Application Application Applications Memory Operating System HaL Hardware CPU
Protected Mode • Separate OS and Applications into separate modes • CPU support or “run levels” (or “rings”) • If not in right level/ring, can’t do some things • Only OS code can change level/ring
Protected/Real Mode Applications Ring 1 “User Mode” Memory Operating System Ring 0 “Kernel Mode” or “Supervisor Mode” HaL Hardware CPU
Virtual Memory • Decouple Actual RAM from a Managed View Abstraction • Provide different “software entities” different views User Memory Kernel Memory Only Write in Ring Zero
Virtual Memory A page of a virtual memory may be: In RAM In Page File Both, Neither PFN Database (Page Table) Virtual Memory Page File RAM
Virtual Memory • Different Views for Different Processes • View typically has unused pages • All processes see same kernel mem(but can’t touch) User Memory Kernel Memory Only Write in Ring Zero Process “A” Process “B” Physical Memory
Memory Manager OS:Memory A page of a process memory may be Private or shared In RAM, Page File, both, or neither Process “A” Process “B” Process “C” Virtual Memory Page Table Mapping Page File Process (virtual) memory spaces RAM
Microsoft • Much of the previous is not really specific to Microsoft • Hardware allows OS’s to Advance
Microsoft OS Subsystems User Mode Kernelbase.dll Kernel32.dll Kernel Mode Task Executive Task Executive Memory Subsystem Cache Subsystem Object Manager Local Procedure Call Registry Security I/O Subsystem Filters FS Drivers
Task Executive Windows Calculator Takes Over 24 Hours Type in 5 digit #, Hit n! (factorial)
Priority ThreadScheduling Show TM
Priority ThreadScheduling High threads Above Normal threads Normal threads Below Normal threads Idle threads System Idle (zero page) thread(s)
Waiting threads P8 P15 P8 P9 P10
Inside The OS Tim Mangan tmangan@tmurgent.com www.tmurgent.com