Current Status: 19 syscalls implemented (Phase 1 Complete)
Next Target: 50 syscalls (Phase 2 - Basic GUI Support)
Test Application: Notepad++ Portable
- ✅ NtAllocateVirtualMemory
- ✅ NtFreeVirtualMemory
- ✅ NtReadVirtualMemory
- ✅ NtProtectVirtualMemory
- ✅ NtQueryVirtualMemory
- ✅ NtCreateFile
- ✅ NtReadFile
- ✅ NtWriteFile
- ✅ NtClose
- ✅ NtCreateProcess
- ✅ NtCreateThreadEx
- ✅ NtTerminateProcess
- ✅ NtQuerySystemInformation
- ✅ NtCreateEvent
- ✅ NtSetEvent
- ✅ NtWaitForSingleObject
- ✅ NtCreateMutant
- ✅ NtReleaseMutant
- ✅ NtLoadDriver (DLL loading support)
- NtQueryInformationProcess - Get process info (PID, memory usage, etc.)
- NtQueryInformationThread - Get thread info (TID, state, etc.)
- NtOpenProcess - Open handle to existing process
- NtResumeThread - Resume suspended thread
- NtSuspendThread - Suspend thread execution
- NtOpenFile - Open existing file (vs create new)
- NtDeleteFile - Delete file
- NtQueryInformationFile - Get file metadata (size, dates, attributes)
- NtSetInformationFile - Set file attributes
- NtQueryDirectoryFile - List directory contents
- NtCreateDirectory - Create directory/folder
- NtQueryVolumeInformationFile - Get volume/drive info
- NtFlushBuffersFile - Flush file buffers to disk
- NtCreateSection - Create shared memory section
- NtMapViewOfSection - Map section into process memory
- NtUnmapViewOfSection - Unmap section from memory
- NtQuerySection - Query section information
- NtWaitForMultipleObjects - Wait on multiple handles
- NtCreateSemaphore - Create semaphore
- NtReleaseSemaphore - Release semaphore
- NtCreateTimer - Create timer object
- NtSetTimer - Set timer
- NtDuplicateObject - Duplicate handle
- NtClose (enhance) - Better handle cleanup
- NtQueryObject - Query object information
- NtSetInformationObject - Set object attributes
- NtQueryPerformanceCounter - High-resolution timer
- NtDelayExecution - Sleep/delay (NtSleep)
- NtYieldExecution - Yield CPU to other threads
- NtCreateKey - Create/open registry key (stub)
- NtOpenKey - Open existing registry key (stub)
- NtSetValueKey - Set registry value (stub)
- NtQueryValueKey - Get registry value (stub)
- NtEnumerateKey - List registry keys (stub)
- NtDeleteKey - Delete registry key (stub)
Note: Registry can be stubbed to return defaults/empty values initially. Most apps will work fine. Full registry implementation can come later.
- NtRaiseException - Raise exception (stub for now)
- NtContinue - Continue after exception (stub)
Note: Basic exception handling can be stubbed. Full SEH (Structured Exception Handling) is complex and can wait.
- Day 1-2: Process/Thread (5) + File System (8)
- Day 3: Memory/Sections (4)
- Day 4: Test with simple console apps
- Day 5: Synchronization (5)
- Day 6-7: Test and debug
- Day 1-2: Handles/Objects (4) + Time (3)
- Day 3: Registry stubs (6)
- Day 4: Exception stubs (2)
- Day 5-7: Test with Notepad++ Portable
- After Week 1: Console apps, simple utilities working
- After Week 2: GUI apps like Notepad++, Calculator, basic editors working
- Syscall 1-25: hello.exe, test.exe, cmd.exe
- Syscall 26-40: notepad.exe, calc.exe
- Syscall 41-50: notepad++.exe portable, simple GUI apps
| NT Syscall | Linux Equivalent | Difficulty |
|---|---|---|
| NtOpenFile | open() | Easy |
| NtDeleteFile | unlink() | Easy |
| NtQueryInformationFile | fstat() | Easy |
| NtSetInformationFile | fchmod(), futimens() | Medium |
| NtQueryDirectoryFile | getdents64() | Medium |
| NtCreateDirectory | mkdir() | Easy |
| NtCreateSection | shmget() or memfd_create() | Medium |
| NtMapViewOfSection | mmap() | Easy |
| NtQueryPerformanceCounter | clock_gettime() | Easy |
| NtDelayExecution | nanosleep() | Easy |
| NtDuplicateObject | dup() | Easy |
Most map 1:1 to Linux! That's why Wine took so long - they reverse-engineered. We just read the specs and map to Linux properly.
- ✅ 50 syscalls implemented
- ✅ Notepad++ Portable launches
- ✅ Can open, edit, save files
- ✅ Menus work
- ✅ No crashes
Timeline: 2 weeks of focused work
Wine's equivalent: 5+ years
Advantage: We work at kernel level with documentation
- Registry can be stubbed - most apps don't require it to function
- Exception handling can be minimal - just don't crash
- Focus on file I/O and process management first
- Test continuously with real apps
- Each syscall implemented CORRECTLY, not guessed
Let's get to 50 and prove LSW can run real Windows apps! 🏴☠️
Generated: 2025-12-30
Project: LSW (Linux Subsystem for Windows)
License: BFSL v1.2
Copyright © 2025 BarrerSoftware