Systems Programming Assignment
Systems Programming Assignment
Key Components:
Win32 API: Interface for application development.
NT Kernel: Core of the OS, handles process scheduling, memory management, etc.
HAL: Abstracts hardware differences for portability.
Executive Services: I/O management, object manager, security monitor, etc.
Practical
1. Writing and Compiling a Simple Windows Program (WinAPI)
Objective: Write a "Hello, World!" program using the WinAPI.
Steps:
1. Install a C/C++ compiler (e.g., Microsoft Visual Studio or MinGW).
2. Sample code:
```c
#include <windows.h>
int main() {
// Allocate memory
LPVOID pMemory = VirtualAlloc(NULL, 4096, MEM_COMMIT,
PAGE_READWRITE);
if (pMemory == NULL) {
printf("Memory allocation failed!\n");
return 1;
}
return 0;
}
```
2. Compile and run the program.
3. Verify the output:
```
Allocated memory content: Hello, Memory!
Memory freed.