mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-17 08:00:32 +00:00
Add x86_64-linux-gnu emulator
I wanted a tiny scriptable meltdown proof way to run userspace programs and visualize how program execution impacts memory. It helps to explain how things like Actually Portable Executable works. It can show you how the GCC generated code is going about manipulating matrices and more. I didn't feel fully comfortable with Qemu and Bochs because I'm not smart enough to understand them. I wanted something like gVisor but with much stronger levels of assurances. I wanted a single binary that'll run, on all major operating systems with an embedded GPL barrier ZIP filesystem that is tiny enough to transpile to JavaScript and run in browsers too. https://justine.storage.googleapis.com/emulator625.mp4
This commit is contained in:
parent
467504308a
commit
f4f4caab0e
1052 changed files with 65667 additions and 7825 deletions
11
libc/nt/thunk/accounting.inc
Normal file
11
libc/nt/thunk/accounting.inc
Normal file
|
@ -0,0 +1,11 @@
|
|||
#define GetProcessTimes(...) __imp_GetProcessTimes(__VA_ARGS__)
|
||||
extern typeof(GetProcessTimes) *const __imp_GetProcessTimes __msabi;
|
||||
|
||||
#define GetThreadTimes(...) __imp_GetThreadTimes(__VA_ARGS__)
|
||||
extern typeof(GetThreadTimes) *const __imp_GetThreadTimes __msabi;
|
||||
|
||||
#define GetUserName(...) __imp_GetUserNameW(__VA_ARGS__)
|
||||
extern typeof(GetUserName) *const __imp_GetUserNameW __msabi;
|
||||
|
||||
#define GetExitCodeProcess(...) __imp_GetExitCodeProcess(__VA_ARGS__)
|
||||
extern typeof(GetExitCodeProcess) *const __imp_GetExitCodeProcess __msabi;
|
|
@ -1,3 +1,5 @@
|
|||
#define CopyFile(...) __imp_CopyFileW(__VA_ARGS__)
|
||||
#define FlushFileBuffers(...) __imp_FlushFileBuffers(__VA_ARGS__)
|
||||
|
||||
extern typeof(CopyFile) *const __imp_CopyFileW __msabi;
|
||||
extern typeof(FlushFileBuffers) *const __imp_FlushFileBuffers __msabi;
|
||||
|
|
10
libc/nt/thunk/memory.inc
Normal file
10
libc/nt/thunk/memory.inc
Normal file
|
@ -0,0 +1,10 @@
|
|||
#define CreateFileMappingNuma(...) __imp_CreateFileMappingNumaW(__VA_ARGS__)
|
||||
#define MapViewOfFileExNuma(...) __imp_MapViewOfFileExNuma(__VA_ARGS__)
|
||||
#define FlushViewOfFile(...) __imp_FlushViewOfFile(__VA_ARGS__)
|
||||
#define UnmapViewOfFile(...) __imp_UnmapViewOfFile(__VA_ARGS__)
|
||||
|
||||
extern typeof(UnmapViewOfFile) *const __imp_UnmapViewOfFile __msabi;
|
||||
extern typeof(FlushViewOfFile) *const __imp_FlushViewOfFile __msabi;
|
||||
extern typeof(MapViewOfFileExNuma) *const __imp_MapViewOfFileExNuma __msabi;
|
||||
extern typeof(CreateFileMappingNuma) *const
|
||||
__imp_CreateFileMappingNumaW __msabi;
|
|
@ -1,8 +1,19 @@
|
|||
#define GetEnvironmentVariable(...) __imp_GetEnvironmentVariableW(__VA_ARGS__)
|
||||
#define GetPriorityClass(...) __imp_GetPriorityClass(__VA_ARGS__)
|
||||
#define SetPriorityClass(...) __imp_SetPriorityClass(__VA_ARGS__)
|
||||
|
||||
extern typeof(GetEnvironmentVariable) *const
|
||||
__imp_GetEnvironmentVariableW __msabi;
|
||||
|
||||
#define SetEnvironmentVariable(...) __imp_SetEnvironmentVariableW(__VA_ARGS__)
|
||||
extern typeof(SetEnvironmentVariable) *const
|
||||
__imp_SetEnvironmentVariableW __msabi;
|
||||
|
||||
#define GetPriorityClass(...) __imp_GetPriorityClass(__VA_ARGS__)
|
||||
extern typeof(GetPriorityClass) *const __imp_GetPriorityClass __msabi;
|
||||
|
||||
#define SetPriorityClass(...) __imp_SetPriorityClass(__VA_ARGS__)
|
||||
extern typeof(SetPriorityClass) *const __imp_SetPriorityClass __msabi;
|
||||
|
||||
#define GetCurrentProcessId(...) __imp_GetCurrentProcessId(__VA_ARGS__)
|
||||
extern typeof(GetCurrentProcessId) *const __imp_GetCurrentProcessId __msabi;
|
||||
|
||||
#define CreateProcess(...) __imp_CreateProcessW(__VA_ARGS__)
|
||||
extern typeof(CreateProcess) *const __imp_CreateProcessW __msabi;
|
||||
|
|
|
@ -1,23 +1,33 @@
|
|||
#define ExitProcess(...) __imp_ExitProcess(__VA_ARGS__)
|
||||
#define FreeEnvironmentStrings(...) __imp_FreeEnvironmentStringsW(__VA_ARGS__)
|
||||
#define GetCommandLine(...) __imp_GetCommandLineW(__VA_ARGS__)
|
||||
#define GetEnvironmentStrings(...) __imp_GetEnvironmentStringsW(__VA_ARGS__)
|
||||
#define GetStdHandle(...) __imp_GetStdHandle(__VA_ARGS__)
|
||||
#define SetStdHandle(...) __imp_SetStdHandle(__VA_ARGS__)
|
||||
#define ReadFile(...) __imp_ReadFile(__VA_ARGS__)
|
||||
#define WriteFile(...) __imp_WriteFile(__VA_ARGS__)
|
||||
#define SetDefaultDllDirectories(...) \
|
||||
__imp_SetDefaultDllDirectories(__VA_ARGS__)
|
||||
|
||||
#define ExitProcess(...) __imp_ExitProcess(__VA_ARGS__)
|
||||
extern typeof(ExitProcess) *const __imp_ExitProcess __msabi;
|
||||
|
||||
#define FreeEnvironmentStrings(...) __imp_FreeEnvironmentStringsW(__VA_ARGS__)
|
||||
extern typeof(FreeEnvironmentStrings) *const
|
||||
__imp_FreeEnvironmentStringsW __msabi;
|
||||
|
||||
#define GetCommandLine(...) __imp_GetCommandLineW(__VA_ARGS__)
|
||||
extern typeof(GetCommandLine) *const __imp_GetCommandLineW __msabi;
|
||||
|
||||
#define GetEnvironmentStrings(...) __imp_GetEnvironmentStringsW(__VA_ARGS__)
|
||||
extern typeof(GetEnvironmentStrings) *const
|
||||
__imp_GetEnvironmentStringsW __msabi;
|
||||
|
||||
#define GetStdHandle(...) __imp_GetStdHandle(__VA_ARGS__)
|
||||
extern typeof(GetStdHandle) *const __imp_GetStdHandle __msabi;
|
||||
|
||||
#define SetStdHandle(...) __imp_SetStdHandle(__VA_ARGS__)
|
||||
extern typeof(SetStdHandle) *const __imp_SetStdHandle __msabi;
|
||||
|
||||
#define ReadFile(...) __imp_ReadFile(__VA_ARGS__)
|
||||
extern typeof(ReadFile) *const __imp_ReadFile __msabi;
|
||||
|
||||
#define WriteFile(...) __imp_WriteFile(__VA_ARGS__)
|
||||
extern typeof(WriteFile) *const __imp_WriteFile __msabi;
|
||||
|
||||
#define SetDefaultDllDirectories(...) \
|
||||
__imp_SetDefaultDllDirectories(__VA_ARGS__)
|
||||
extern typeof(SetDefaultDllDirectories) *const
|
||||
__imp_SetDefaultDllDirectories __msabi;
|
||||
|
||||
#define GetCurrentProcess(...) __imp_GetCurrentProcess(__VA_ARGS__)
|
||||
extern typeof(GetCurrentProcess) *const __imp_GetCurrentProcess __msabi;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue