mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-25 20:10:29 +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
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_ABORTED 2 -2 -2 -2 0
|
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_APPEND 0x20 1 1 1 0
|
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_DOOFFS 8 2 2 2 0
|
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_ERR 1 4 4 4 0
|
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_MARK 2 8 8 8 0
|
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_NOCHECK 0x10 0x10 0x10 0x10 0
|
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_NOESCAPE 0x40 0x2000 0x2000 0x1000 0
|
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_NOMATCH 3 -3 -3 -3 0
|
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_NOSORT 4 0x20 0x20 0x20 0
|
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_NOSPACE 1 -1 -1 -1 0
|
|
@ -1,2 +0,0 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon glob GLOB_NOSYS 4 -4 -4 -4 0
|
|
@ -1,2 +1,2 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon misc UTIME_NOW 0x3fffffff 0 -1 -2 0
|
||||
.syscon utime UTIME_NOW 0x3fffffff 0x3fffffff -1 -2 0x3fffffff
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
.include "libc/sysv/consts/syscon.inc"
|
||||
.syscon misc UTIME_OMIT 0x3ffffffe 0 -2 -1 0
|
||||
.syscon utime UTIME_OMIT 0x3ffffffe 0x3ffffffe -2 -1 0x3ffffffe
|
||||
|
|
|
@ -14,14 +14,16 @@ hidden extern const long AT_SYMLINK_FOLLOW;
|
|||
hidden extern const long AT_SYMLINK_NOFOLLOW;
|
||||
hidden extern const long AT_REMOVEDIR;
|
||||
hidden extern const long AT_EACCESS;
|
||||
hidden extern const long AT_EMPTY_PATH;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
||||
#define AT_FDCWD SYMBOLIC(AT_FDCWD)
|
||||
#define AT_SYMLINK_FOLLOW SYMBOLIC(AT_SYMLINK_FOLLOW)
|
||||
#define AT_FDCWD SYMBOLIC(AT_FDCWD)
|
||||
#define AT_SYMLINK_FOLLOW SYMBOLIC(AT_SYMLINK_FOLLOW)
|
||||
#define AT_SYMLINK_NOFOLLOW SYMBOLIC(AT_SYMLINK_NOFOLLOW)
|
||||
#define AT_REMOVEDIR SYMBOLIC(AT_REMOVEDIR)
|
||||
#define AT_EACCESS SYMBOLIC(AT_EACCESS)
|
||||
#define AT_REMOVEDIR SYMBOLIC(AT_REMOVEDIR)
|
||||
#define AT_EACCESS SYMBOLIC(AT_EACCESS)
|
||||
#define AT_EMPTY_PATH SYMBOLIC(AT_EMPTY_PATH)
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_AT_H_ */
|
||||
|
|
|
@ -9,7 +9,6 @@ hidden extern const long AT_BASE_PLATFORM;
|
|||
hidden extern const long AT_CLKTCK;
|
||||
hidden extern const long AT_DCACHEBSIZE;
|
||||
hidden extern const long AT_EGID;
|
||||
hidden extern const long AT_EMPTY_PATH;
|
||||
hidden extern const long AT_ENTRY;
|
||||
hidden extern const long AT_EUID;
|
||||
hidden extern const long AT_EXECFD;
|
||||
|
@ -33,30 +32,29 @@ hidden extern const long AT_UID;
|
|||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
||||
#define AT_BASE SYMBOLIC(AT_BASE)
|
||||
#define AT_BASE SYMBOLIC(AT_BASE)
|
||||
#define AT_BASE_PLATFORM SYMBOLIC(AT_BASE_PLATFORM)
|
||||
#define AT_CLKTCK SYMBOLIC(AT_CLKTCK)
|
||||
#define AT_DCACHEBSIZE SYMBOLIC(AT_DCACHEBSIZE)
|
||||
#define AT_EGID SYMBOLIC(AT_EGID)
|
||||
#define AT_EMPTY_PATH SYMBOLIC(AT_EMPTY_PATH)
|
||||
#define AT_ENTRY SYMBOLIC(AT_ENTRY)
|
||||
#define AT_EUID SYMBOLIC(AT_EUID)
|
||||
#define AT_EXECFD SYMBOLIC(AT_EXECFD)
|
||||
#define AT_EXECFN SYMBOLIC(AT_EXECFN)
|
||||
#define AT_GID SYMBOLIC(AT_GID)
|
||||
#define AT_ICACHEBSIZE SYMBOLIC(AT_ICACHEBSIZE)
|
||||
#define AT_NOTELF SYMBOLIC(AT_NOTELF)
|
||||
#define AT_NO_AUTOMOUNT SYMBOLIC(AT_NO_AUTOMOUNT)
|
||||
#define AT_OSRELDATE SYMBOLIC(AT_OSRELDATE)
|
||||
#define AT_PAGESZ SYMBOLIC(AT_PAGESZ)
|
||||
#define AT_PHDR SYMBOLIC(AT_PHDR)
|
||||
#define AT_PHENT SYMBOLIC(AT_PHENT)
|
||||
#define AT_PHNUM SYMBOLIC(AT_PHNUM)
|
||||
#define AT_PLATFORM SYMBOLIC(AT_PLATFORM)
|
||||
#define AT_RANDOM SYMBOLIC(AT_RANDOM)
|
||||
#define AT_SECURE SYMBOLIC(AT_SECURE)
|
||||
#define AT_SYSINFO_EHDR SYMBOLIC(AT_SYSINFO_EHDR)
|
||||
#define AT_UCACHEBSIZE SYMBOLIC(AT_UCACHEBSIZE)
|
||||
#define AT_UID SYMBOLIC(AT_UID)
|
||||
#define AT_CLKTCK SYMBOLIC(AT_CLKTCK)
|
||||
#define AT_DCACHEBSIZE SYMBOLIC(AT_DCACHEBSIZE)
|
||||
#define AT_EGID SYMBOLIC(AT_EGID)
|
||||
#define AT_ENTRY SYMBOLIC(AT_ENTRY)
|
||||
#define AT_EUID SYMBOLIC(AT_EUID)
|
||||
#define AT_EXECFD SYMBOLIC(AT_EXECFD)
|
||||
#define AT_EXECFN SYMBOLIC(AT_EXECFN)
|
||||
#define AT_GID SYMBOLIC(AT_GID)
|
||||
#define AT_ICACHEBSIZE SYMBOLIC(AT_ICACHEBSIZE)
|
||||
#define AT_NOTELF SYMBOLIC(AT_NOTELF)
|
||||
#define AT_NO_AUTOMOUNT SYMBOLIC(AT_NO_AUTOMOUNT)
|
||||
#define AT_OSRELDATE SYMBOLIC(AT_OSRELDATE)
|
||||
#define AT_PAGESZ SYMBOLIC(AT_PAGESZ)
|
||||
#define AT_PHDR SYMBOLIC(AT_PHDR)
|
||||
#define AT_PHENT SYMBOLIC(AT_PHENT)
|
||||
#define AT_PHNUM SYMBOLIC(AT_PHNUM)
|
||||
#define AT_PLATFORM SYMBOLIC(AT_PLATFORM)
|
||||
#define AT_RANDOM SYMBOLIC(AT_RANDOM)
|
||||
#define AT_SECURE SYMBOLIC(AT_SECURE)
|
||||
#define AT_SYSINFO_EHDR SYMBOLIC(AT_SYSINFO_EHDR)
|
||||
#define AT_UCACHEBSIZE SYMBOLIC(AT_UCACHEBSIZE)
|
||||
#define AT_UID SYMBOLIC(AT_UID)
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_CALLS_AUXV_H_ */
|
||||
|
|
16
libc/sysv/consts/utime.h
Normal file
16
libc/sysv/consts/utime.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_UTIME_H_
|
||||
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_UTIME_H_
|
||||
#include "libc/runtime/symbolic.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
hidden extern const int UTIME_NOW;
|
||||
hidden extern const int UTIME_OMIT;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
||||
#define UTIME_NOW SYMBOLIC(UTIME_NOW)
|
||||
#define UTIME_OMIT SYMBOLIC(UTIME_OMIT)
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_UTIME_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue