Windows API.

Slides:



Advertisements
Similar presentations
Slide 19-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 19.
Advertisements

Threads, SMP, and Microkernels
User-Mode Linux Ken C.K. Lee
Memory Protection: Kernel and User Address Spaces  Background  Address binding  How memory protection is achieved.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
Windows 2000 System Architecture (continued) Computing Department, Lancaster University, UK.
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
1 Module 1 The Windows NT 4.0 Environment. 2  Overview The Microsoft Operating System Family Windows NT Architecture Overview Workgroups and Domains.
1 OS Structure, Processes & Process Management. 2 Recap OS functions  Coordinator  Protection  Communication  Resource management  Service provider.
January 2010 Boston Area Windows Server User Group Tim Mangan Kahuna, TMurgent Technologies.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Operating Systems. What is an Operating System? A layer of software between users/applications and the hardware. The first program loaded onto a computer.
1 Chapter 2 Operating Systems: Software in the Background.
OS Spring’03 Introduction Operating Systems Spring 2003.
1 CE6130 現代作業系統核心 Modern Operating System Kernels 許 富 皓.
Figure 1.1 Interaction between applications and the operating system.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
MicrokernelsCS-502 (EMC) Fall Microkernels CS-502, Operating Systems Fall 2009 (EMC) (Slides include materials from Modern Operating Systems, 3 rd.
OS Organization. OS Requirements Provide resource abstractions –Process abstraction of CPU/memory use Address space Concurrency Thread abstraction of.
OS Spring’04 Introduction Operating Systems Spring 2004.
Operating System Organization
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
计算机系 信息处理实验室 Lecture 2 System architecture
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue University.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Protection and the Kernel: Mode, Space, and Context.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
COS 598: Advanced Operating System. Operating System Review What are the two purposes of an OS? What are the two modes of execution? Why do we have two.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
E X C E E D I N G E X P E C T A T I O N S OP SYS Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Functions of an operating.
Advanced Design and System Patterns The Microkernel Pattern.
Lecture Topics: 10/29 Architectural support for operating systems –timers –kernel mode –system calls –protected instructions.
Introduction to Operating Systems and Concurrency.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
Protection of Processes Security and privacy of data is challenging currently. Protecting information – Not limited to hardware. – Depends on innovation.
S ALVATORE DI G IROLAMO (TA) Networks and Operating Systems: Exercise Session 1.
Introduction to Operating Systems Concepts
Operating System & Application Software
Hardware and OS Design and Layout.
An Introduction to Operating Systems
Memory Protection: Kernel and User Address Spaces
Windows 95 & 98 Steve Boyle Mike Forster Maggie Hamill Nancy O’Brien.
Mobile Operating System
CS 3305 System Calls Lecture 7.
Unit OS2: Operating System Principles
CS490 Windows Internals Quiz 2 09/27/2013.
KERNEL ARCHITECTURE.
Chapter 3: Windows7 Part 1.
Memory Protection: Kernel and User Address Spaces
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
Memory Protection: Kernel and User Address Spaces
Memory Protection: Kernel and User Address Spaces
OS Organization.
CS-3013 Operating Systems Hugh C. Lauer
Lecture Topics: 11/1 General Operating System Concepts Processes
B.Ramamurthy Chapter 2 : Appendix
Threads Chapter 4.
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Operating Systems: A Modern Perspective, Chapter 3
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Outline Operating System Organization Operating System Examples
Memory Protection: Kernel and User Address Spaces
Presentation transcript:

Windows API

Bits of history MS-DOS graphical layer Windows 2000 as independent system NT (new technology) family

MS-DOS family Windows 1.0 Windows 2.0 Windows 3.x Windows 95

Legacy Up till Windows 98 these systems was 16 and 32 bits hybrids Kernel was the same

Windows NT family Windows NTx Windows 2000 Windows Me Windows XP Windows Server 2003 CE, Mobile, Vista, Server 2008, Phone, 7, 8, RT, 10

Something new New Kernel NT is purely 32 bit system NT family is independent from MS-DOS Windows 2000 as independent new system

HAL.DLL (hardware abstraction layer) Architecture Win32 API NTDLL.DLL WIN32K.SYS NTOSKRNL.EXE HAL.DLL (hardware abstraction layer)

Win32 API (1) kernel32.DLL – equivalent to NTDLL.DLL, but… documented gdi32.DLL – drawing functions user32.DLL – GUI, window technology

Win32 API (2) MSVCRT.DLL stdlib functions WS2_32.DLL Winsock2 library

User mode vs. Kernel mode 0 ring 1 ring 2 ring 3 ring

What is it? Hierarchical protection domains – mechanisms to protect data and functionality from faults and malicious behaviour. Hardware enforced by CPU architecture (microcode level) Special gates between rings

Rings... 0 ring (kernel mode) – full access to resources (Windows kernel). 1 and 2 rings – limited access levels, commonly not used (device drivers). 3 ring (user mode) – restricted access to resources. Link

Virtual Memory Every program runs in its own process Process has its own virtual memory and other resources Virtual memory and real memory dosn‘t match. For example, process can „think“ it is located at address 0x1234567, but in reality address can be 0x65f7a580 Process cannot access memory of another process Inactive memory regions could be paged out (stored in files)

User mode Every process (except system one) runs in user mode Cannot access other program‘s memory other than through API functions Programs cannot intervene with interrupts and context switching

Kernel mode, interrupts and system calls When Windows starts for the first time, Windows Kernel is started, which runs in kernel mode and manages page outs and virtual memory Kernel starts system processes and let them run in user mode. How CPU switches to kernel mode?

Kernel set up interrupt handlers to work with events Processors work is interrupted by events from hardware or software (interrupts) Kernel set up interrupt handlers to work with events When CPU work is interrupted, it switches to kernel mode and executes interrupt handler for that event. This procedure: Saves CPU state Process event Restores CPU state (possibly switching back to user mode) API functions works only in kernel mode

Context switching When a program runs for some time („thread quantum“ or processes „time slice“), OS will context switch to another program: Saving the current program's state (including registers), Figuring out which program to run next, and restoring a different program's state.