0% found this document useful (0 votes)
8 views

Lecture-1-Introduction to Windows-System-Programming

The document provides an overview of Windows operating system programming, highlighting its key features, system programming aspects, and the evolution of Windows OS. It discusses the architecture of Windows, including user mode and kernel mode, as well as the importance of the Windows API for application development. Additionally, it covers processor support, differences between 32-bit and 64-bit programming, and the advantages of developing for the Windows platform.

Uploaded by

ahmedtester78
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Lecture-1-Introduction to Windows-System-Programming

The document provides an overview of Windows operating system programming, highlighting its key features, system programming aspects, and the evolution of Windows OS. It discusses the architecture of Windows, including user mode and kernel mode, as well as the importance of the Windows API for application development. Additionally, it covers processor support, differences between 32-bit and 64-bit programming, and the advantages of developing for the Windows platform.

Uploaded by

ahmedtester78
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Lecture 1:

IntroductiontoWindows
SystemProgramming
Windows
Windows is an operating system developed by Microsoft.
Itprovidesa graphical user interface (GUI) for interacting
withyour computer.key Features:

Start Menu & Taskbar – Quick access to apps, files,


andsettings.File Explorer – Manages files and
folders efficiently. Settings & Control Panel –
Systemconfigurationsandtweaks.Windows Defender
– Built-in security systemfor virusprotection.Virtual
Desktops & Snap Layouts –
Organizeworkspaceseasily(Windows 10/11).
DirectX & Gaming – Optimized for gaming,
especiallywithXboxintegration.
Microsoft Store – Download apps, games, andsoftware.
What is SystemProgramming?
System programming refers to the process of
writingsoftwarethat interacts directly with the operating
systemandhardware.It focuses on managing systemresources
suchasmemory,files, and processes. Unlike application
programming(whichdeals with user-facing applications),
systemprogrammingworks behind the scenes to ensure efficient
systemoperation.

•Key Aspects of System Programming: • Direct interaction


with the OS and hardware. • Managing low-level operations
like memorymanagementand file handling.
• Writing performance-critical software,
suchasoperatingsystems, device drivers, and
networkingtools.
An Operating
Understanding OperatingSystems
System (OS) is software that manageshardwareresources and

provides services to applications. It handlesmemory management

involving RAMand virtual memory, filesystems for file storage,

retrieval, and permissions, processor


scheduling which allocates
multitasking allowing multiple applications
CPU time to processes,
torunsimultaneously, and security and user access control.

Windows
OS provides these core features through the WindowsAPI,
enabling developers to interact seamlessly withsystem
resources.
Memory: The OS manages a large, flat, virtual
memoryaddressspaceand transparently moves information between
physical memoryanddiskand other secondary storage.

File systems: The OS manages a hierarchical,


namedfilespace and provides both direct and sequential
accessaswell as directory and file management

processors: The OS must efficiently allocate computational


tasktoprocessors and multiple processors are increasingly
commononevenUnderstandingOperatingSystems
the smallest computers
Resource naming and location :The OS uses a namingsystemforfiles,
devices, and processes, making it easier to organizeandmanageaccess
to resources..
Multitasking: The OS must manage processes, threads, andotherunits
of independent, asynchronous execution. Taskscanbepreemptedand
scheduled according to dynamically calculatedpriorities.

Communication and synchronization: The


OSmanagestask-to-taskcommunication and synchronization within
single computersaswellascommunication between networked computers
andwiththeInternet

Security and protection: The OS provides


flexiblemechanismstoprotect resources from unauthorized and
accidental accessandcorruption

WindowsEvolution
Windows has evolved over time while maintaining a stable
API that ensures compatibility across different versions. Key
aspects of its evolution include:

•Scalability: Supports a wide range of systems, from


personal computers to enterprise servers.
•Performance: Internal improvements and new API
features enhance system efficiency.
•Integration: New technologies such as multimedia,
networking, and .NET are incorporated into each version.
•Ease of Use: The graphical interface and user experience
improve with each release.
•Enhanced API: Continuous updates introduce new API functionalities while
keeping core compatibility intact.

Evolution of Windows OS
1 Windows 11 (2021)
Modern UI, better multitasking, gaming
enhancements, and AI integration.
2 Windows 10 (2015)
Classic Start menu returns, frequent updates,
improved security, and performance.
Windows 7 (2009)
3
Improved performance, better UI, enhanced security
features. 4 Windows XP (2001)
Highly stable, widely used, marking a significant
milestone.
5 Windows 2000/NT (1993-1999)
Built for professional use, introducing NTFS for
enhanced stability, scalability, and security.
Windows Architecture Windows operating system is built on
a modular architecture that ensures stability, performance, and security. It follows a hybrid
kernel model, combiningfeatures of monolithic and microkernel designs to balance flexibility
andefficiency. hybrid kernel model: is a type of operating system kernel that combines
features of both monolithic and microkernels.

Major Components of Windows Architecture


A. User Mode
User mode is where most applications and system processes run, providing an
abstractionlayerthatprevents direct hardware access.
It consists of:
✔Applications – Software programs that interact with users, such as Microsoft Wordor
GoogleChrome.
✔Subsystems – Provide an interface between applications and the operating system. • Windows
API Subsystem – Handles GUI applications.
• POSIX Subsystem (deprecated) – Provided compatibility with UNIX. • WOW64 –
Allows 32-bit applications to run on 64-bit Windows.
✔Environment Subsystems – Support different application models, such as Win32, .NET,
andWindows Services.
✔System Services – Functions that allow applications to request OS operations.
Major Components of Windows Architecture
B. Kernel Mode
Kernel mode has full access to system resources and controls hardware interaction. It
consistsof:✔Executive Services – Core system management functions, including: Process
Manager – Controls process creation and termination.
• Memory Manager – Manages physical and virtual memory.
• I/O Manager – Handles input/output device communication.
• Security Manager – Implements user authentication and access control. ✔Kernel – Manages
low-level operations like scheduling, interrupts, and systemsynchronization.✔HAL (Hardware
Abstraction Layer) – Provides a standardized interface betweenthekernel andphysical hardware,
enabling compatibility
across different hardware architectures.
Windows API
Windows API (WinAPI) is a set of functions provided by Microsoft that allowssoftware
applications to interact with the Windows operating system. It providesabridge between user
applications and system-level operations, enabling developers to perform tasks like file
management, process control, memoryallocation, and graphical rendering.

•Why is Windows API Important?


• Direct access to system resources (memory, files, processes, etc.). • Standardized
way to develop applications compatible across Windowsversions.
• Used in system software, utilities, games, and enterprise applications.
Windows API
Windows API is divided into several functional groups, each handling different aspectsof
system interaction:
1.Process & Thread Management
•CreateProcess() – Creates a new process.
•TerminateProcess() – Ends a process.
•GetCurrentProcessId() – Retrieves the process ID of the calling process.
•CreateThread() – Creates a new thread.
•Sleep() – Pauses execution for a given time.
2.File System Management
•CreateFile() – Opens or creates a file.
•ReadFile() / WriteFile() – Reads/writes data to a file. •DeleteFile() –
Deletes a file.
•GetFileAttributes() – Retrieves file properties.
Windows API
4.Memory Management
•VirtualAlloc() – Allocates memory.
•VirtualFree() – Frees allocated memory.
•HeapCreate() / HeapDestroy() – Manages memory heaps. 5.Device &
Hardware Interaction
•DeviceIoControl() – Sends control codes to device drivers. •GetSystemMetrics() –
Retrieves system information like screen size. 6.Window & GUI Management
•CreateWindowEx() – Creates a new window.
•ShowWindow() – Displays a window.
•MessageBox() – Displays a simple message box. 7.Networking &
Communication
•WSAStartup() – Initializes network sockets.
•send() / recv() – Sends and receives data over a network. •gethostbyname() –
Resolves a domain name to an IP address. 8.Security & User Authentication
•LogonUser() – Verifies a user’s credentials.
•OpenProcessToken() – Retrieves access tokens for security checks.
Processor Support inWindows
Windows is designed to work on different types of computer processors. It uses a
Hardware Abstraction Layer (HAL) to make it easier to run on various processor
architectures. However, this is something that software developers usually don’t need to
worry about. Here’s how Windows supports different processors:
•Intel x86 (32-bit) and x64 (64-bit): Most Windows versions run on Intel's x86 processors
and their 64-bit extensions (x64). AMD’s 64-bit processors are also compatible.
•Intel Itanium (IA-64): Some older Windows Server versions were designed to run on
Itanium IA-64, which is very different fromx86 processors, but it's not widely used today.
32-bit vs. 64-bit Windows Programming
Feature 32-bit (Win32) 64-bit (Win64) Memory Addressing Max 4GB Larger memory access Pointer Size 4 bytes 8 bytes

Performance Limited for large applications Better performance &security

File Handling Supports large files (64-bit functions


More efficient
needed)

Windows supports both 32-bit (Win32) and 64-bit (Win64) applications. 32-bit applications have a max 4GB memory addressing,4-byte
pointer size, and limited performance for large applications. 64-bit applications have larger memory access, 8-bytepointersize, and better
performance and security. 32-bit supports large files using 64-bit functions, while 64-bit is more efficient. Usedata types that support
both architectures, e.g., SIZE_T instead of int for memory sizes.
Advantages of Windows Development

Large User Base Standardized APIs Scalability

High demand for Windows applications due to


Enables developers to write code once and run
Supports desktops, servers, andembedded
its widespread adoption. on multiple Windows versions. systems, making it versatile for variousapplications.
Windows dominates personal computing (desktops, laptops), enterprise solutions (business servers, cloud services), and embedded/industrial applications.
The large user base drives high demand for Windows applications. Standardized APIs allow developers to write code once andrunonmultiple Windows
versions. It also has scalability, supporting desktops, servers, and embedded systems. Robust developer support includes Visual Studio,MSDN, and the .NET
framework.

You might also like