Commit Graph

65 Commits

Author SHA1 Message Date
aa2bbb1e1c Refactor heap and add dynamic expansion (increments of 64 MiB) 2025-11-20 01:32:04 -07:00
64511becf2 kernel32/wincon cleanup 2025-11-18 21:53:16 -07:00
2304c05ed0 Add getThreadId helper using pthread_{gettid,threadid}_np/gettid 2025-11-18 21:52:23 -07:00
ecd8231dee ci: Test on macos-15-intel 2025-11-11 23:38:08 -07:00
276d4cd7af Fix warning 2025-11-11 23:24:49 -07:00
5cc8d239dc Minor cleanups 2025-11-11 22:56:13 -07:00
f012b22101 LoadLibraryA: Skip import resolution & DllMain for EXEs 2025-11-11 21:22:09 -07:00
bb0687d00d Fix Linux build 2025-11-11 10:48:13 -07:00
09a7452c77 Implement WaitOnAddress, WakeByAddress*; macOS impl for atomic waits 2025-11-11 10:44:14 -07:00
f18f2a929d setup_linux: Improve segments init & add modify_ldt fallback 2025-11-11 00:28:44 -07:00
6c4f332705 Improve synchapi impls; fix heap races & 64-bit fixes 2025-11-10 18:15:33 -07:00
d85671e3c6 Download and use embedded msvcrt.dll 2025-11-09 13:18:33 -07:00
cc0a887302 Initial macOS support (x86_64 with Rosetta 2) 2025-11-08 01:45:47 -07:00
f56bd8e2a7 More ntdll impls; fix 64-bit Clang assembly 2025-11-08 01:22:11 -07:00
3dd9fb77ff Experimental 64-bit host support 2025-11-06 19:14:48 -07:00
463686d01a GlobalAlloc: Add VirtualAlloc fallback for large sizes 2025-11-04 00:15:26 -07:00
a59e002ed0 Fix a few compiler regressions 2025-11-03 23:22:29 -07:00
4dc599381f Refactor memory management into wibo::heap
- Removes blockUpper2GB hack; we now start early in the process
  and reserve all (available) space in the lower 2GB address
  space, leaving the upper 2GB untouched for host code
- All virtual memory operations flow through wibo::heap for
  bookkeeping
- All guest code uses a guest mimalloc area + thread-local heaps
  reserved in the guest address space
2025-11-03 13:58:33 -07:00
52cdd7c811 Fully functional guest<->host trampolines 2025-10-31 00:45:32 -06:00
55a62a27c9 Initial guest-to-host trampoline generation 2025-10-30 02:23:09 -06:00
9367f003c5 Refactor to use TIB LastErrorValue 2025-10-28 10:01:21 -06:00
8bd15bd272 Fix heapapi ownership checks
`mi_heap_check_owned` does not work for allocations that span
multiple blocks; `mi_is_in_heap_region` is a less precise but
working way for us to check if a pointer is in our heap.

See https://github.com/microsoft/mimalloc/issues/298
2025-10-27 17:04:57 -06:00
27860f0300 Implement ntdll NtWriteFile 2025-10-27 14:56:51 -06:00
a240e3dc4b Support TlsExpansionSlots (>64 TLS slots) 2025-10-27 12:27:26 -06:00
cf166f828a Disable exceptions and RTTI 2025-10-27 10:47:38 -06:00
50a457c5e3 Begin reworking TLS impl & add TLS loader support 2025-10-27 01:03:30 -06:00
1500a4f815 ReadFile/WriteFile: Require overlapped I/O on overlapped handles (#99) 2025-10-23 23:07:56 -07:00
5597da607a Fix GetOverlappedResult without event & improve overlapped handling 2025-10-23 11:33:09 -06:00
4d5caf91e1 Implement ConnectNamedPipe 2025-10-23 11:31:35 -06:00
8e532ccf78 Implement CreateNamedPipeA 2025-10-23 11:31:35 -06:00
2e2128b4ac Implement kernel32::FlushViewOfFile and ntdll::memset 2025-10-15 18:33:26 -06:00
0c2c0f653b Add Handles::clear() and run it on exit 2025-10-09 16:48:33 -06:00
e185629d19 Always use _exit to terminate (for now) 2025-10-09 13:14:59 -06:00
dc5a91c480 Simplify process spawning using SYS_clone 2025-10-09 12:33:58 -06:00
3078cef12b Cleanup various lints and warnings 2025-10-09 12:33:13 -06:00
cac944400f Rework subprocess spawning using clone3/execveat 2025-10-08 18:13:54 -06:00
15ea650fd5 Use VERBOSE_LOG for more common calls 2025-10-08 18:12:50 -06:00
2ffc56f5c2 Improve heapapi implementation 2025-10-08 18:11:37 -06:00
061228c971 Make liburing optional; rewrite CMakeLists.txt and enable LTO 2025-10-07 14:12:37 -06:00
df36de18bf Implement async (overlapped) I/O with io_uring 2025-10-06 23:51:09 -06:00
f366e77956 Rewrite FindFirstFile/FindNextFile (again), add comprehensive tests 2025-10-06 17:57:54 -06:00
f5aa320800 Minor cleanup 2025-10-06 13:12:00 -06:00
f52ca2803f Tests for handleapi, synchapi, processes 2025-10-06 10:14:03 -06:00
166b9036fd Dont set ERROR_SUCCESS generally
Turns out we should only be setting this in a select few cases.
2025-10-06 00:03:10 -06:00
01ed50c4b4 Fix pipe reads; add tests for NtReadFile & pipes 2025-10-05 23:24:50 -06:00
ff04eb9f41 Fix OpenProcessToken pseudo-handle regression 2025-10-05 18:16:15 -06:00
0d76e541c1 Reorg headers, module_registry -> modules, remove ActCtx msvcr80.dll hack 2025-10-05 17:46:16 -06:00
b87fb5e472 Implement some ActCtx functions for msvcr80.dll 2025-10-05 15:52:38 -06:00
5a2f8e2926 Docker build fixes 2025-10-05 14:37:45 -06:00
0bc80b6618 Split into HostContextGuard/GuestContextGuard 2025-10-05 14:32:06 -06:00