Win 32 syscall emulator based on Open Solaris
Win 32 syscall emulator based on Open. Solaris branded zone Chimera project team: Vizovitin Nicolay Sizov Mikhail Kolbin Dmitry Khlebnikov Sergey Tutor: Irtegov D. V.
Outline 1. 2. 3. 4. 5. Idea behind the project Sources and the goal How system call emulation works Project status: progress and plans Q&A 2
The idea… …is to mix Open. Solaris and Windows 3
Why Open. Solaris? 1. 2. 3. 4. Open source Zones & Containers Brand. Z infrastructure – support for non-native kernel personalities Numerous interesting kernel features (e. g. DTrace) 4
The chimera parts 1. 2. 3. Open. Solaris sources (ON) Windows Research Kernel (WRK) – some kernel parts of Windows 2003 SP 1 Other open-source projects like Wine and React. OS 5
Our goal Create new win brand, that supports execution of Windows applications on top of Open. Solaris kernel 6
System call emulation: global zone Global zone (native) Solaris process { … open(); … } userland kernel Solaris kernel Syscall handler if (process is branded) brand_syscall_handler(); else rval = do_native_syscall(); return to userspace; Native ‘open’ implementation open() { … return (fd); } 7
System call emulation: win zone Windows process { … Nt. Create. File(); … } userland Win brand support library win_Nt. Create. File(args) { fd = open(win 2 sol(args)); if (fd < 0) return (sol 2 win(errno)); else return (fd); } kernel Solaris kernel Syscall handler if (process is branded) brand_syscall_handler(); else rval = do_native_syscall(); return to userspace; Windows brand module Native ‘open’ implementation open() { … return (fd); } win_syscall() { trampoline to userland; } 8
Project progress 1. 2. 3. 4. 5. Set of scripts for convenient brand testing Dynamic memory allocation is now available in brand support library Arbitrary calls to libraries from brand support library is safe now (first of all to libc. so) Partially implemented PE loader Emulation code for several syscalls 9
Current project status 1. 2. 3. Extensive documentation of WRK sources Learned to build ON and WRK Created basic win zone l l 4. 5. 6. win brand kernel module win brand support library zone configuration files support for system calls via sysenter Number of test programs Partial PE loader implementation Some system calls implemented 10
Plans on project development 1. 2. 3. 4. Finish PE loader implementation Emulation code for other Windows system calls Create minimal Windows environment in the zone Allowing other technics for entering the kernel (int 2 e, syscall) 11
Q&A 12
- Slides: 12