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:
@@ -1,6 +1,6 @@
|
||||
#ifndef COSMOPOLITAN_LIBC_NT_TEB_H_
|
||||
#define COSMOPOLITAN_LIBC_NT_TEB_H_
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/bits/segmentation.h"
|
||||
#include "libc/nt/struct/peb.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
#define NtGetErr() gs((int *)(0x68))
|
||||
#define NtGetVersion() \
|
||||
((NtGetPeb()->OSMajorVersion & 0xff) << 8 | NtGetPeb()->OSMinorVersion)
|
||||
#define _NtGetSeh() gs((void **)(0x00))
|
||||
#define _NtGetStackHigh() gs((void **)(0x08))
|
||||
#define _NtGetStackLow() gs((void **)(0x10))
|
||||
#define _NtGetSeh() gs((void **)(0x00))
|
||||
#define _NtGetStackHigh() gs((void **)(0x08))
|
||||
#define _NtGetStackLow() gs((void **)(0x10))
|
||||
#define _NtGetSubsystemTib() gs((void **)(0x18))
|
||||
#define _NtGetFib() gs((void **)(0x20))
|
||||
#define _NtGetEnv() gs((char16_t **)(0x38))
|
||||
#define _NtGetRpc() gs((void **)(0x50))
|
||||
#define _NtGetTls() gs((void **)(0x58))
|
||||
#define _NtGetFib() gs((void **)(0x20))
|
||||
#define _NtGetEnv() gs((char16_t **)(0x38))
|
||||
#define _NtGetRpc() gs((void **)(0x50))
|
||||
#define _NtGetTls() gs((void **)(0x58))
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_NT_TEB_H_ */
|
||||
|
||||
Reference in New Issue
Block a user