mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +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
|
@ -6,29 +6,29 @@
|
|||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#define REG_R8 REG_R8
|
||||
#define REG_R9 REG_R9
|
||||
#define REG_R10 REG_R10
|
||||
#define REG_R11 REG_R11
|
||||
#define REG_R12 REG_R12
|
||||
#define REG_R13 REG_R13
|
||||
#define REG_R14 REG_R14
|
||||
#define REG_R15 REG_R15
|
||||
#define REG_RDI REG_RDI
|
||||
#define REG_RSI REG_RSI
|
||||
#define REG_RBP REG_RBP
|
||||
#define REG_RBX REG_RBX
|
||||
#define REG_RDX REG_RDX
|
||||
#define REG_RAX REG_RAX
|
||||
#define REG_RCX REG_RCX
|
||||
#define REG_RSP REG_RSP
|
||||
#define REG_RIP REG_RIP
|
||||
#define REG_EFL REG_EFL
|
||||
#define REG_CSGSFS REG_CSGSFS
|
||||
#define REG_ERR REG_ERR
|
||||
#define REG_TRAPNO REG_TRAPNO
|
||||
#define REG_R8 REG_R8
|
||||
#define REG_R9 REG_R9
|
||||
#define REG_R10 REG_R10
|
||||
#define REG_R11 REG_R11
|
||||
#define REG_R12 REG_R12
|
||||
#define REG_R13 REG_R13
|
||||
#define REG_R14 REG_R14
|
||||
#define REG_R15 REG_R15
|
||||
#define REG_RDI REG_RDI
|
||||
#define REG_RSI REG_RSI
|
||||
#define REG_RBP REG_RBP
|
||||
#define REG_RBX REG_RBX
|
||||
#define REG_RDX REG_RDX
|
||||
#define REG_RAX REG_RAX
|
||||
#define REG_RCX REG_RCX
|
||||
#define REG_RSP REG_RSP
|
||||
#define REG_RIP REG_RIP
|
||||
#define REG_EFL REG_EFL
|
||||
#define REG_CSGSFS REG_CSGSFS
|
||||
#define REG_ERR REG_ERR
|
||||
#define REG_TRAPNO REG_TRAPNO
|
||||
#define REG_OLDMASK REG_OLDMASK
|
||||
#define REG_CR2 REG_CR2
|
||||
#define REG_CR2 REG_CR2
|
||||
|
||||
enum GeneralRegister {
|
||||
REG_R8,
|
||||
|
@ -60,16 +60,12 @@ struct XmmRegister {
|
|||
uint64_t u64[2];
|
||||
};
|
||||
|
||||
static_assert(sizeof(struct XmmRegister) == 16);
|
||||
|
||||
struct FpuStackEntry {
|
||||
uint16_t significand[4];
|
||||
uint16_t exponent;
|
||||
uint16_t padding[3];
|
||||
};
|
||||
|
||||
static_assert(sizeof(struct FpuStackEntry) == 16);
|
||||
|
||||
struct FpuState {
|
||||
uint16_t cwd;
|
||||
uint16_t swd;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue