mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-24 11:30: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
|
@ -330,11 +330,11 @@ static void StrikeDownCrapware(int sig) {
|
|||
}
|
||||
|
||||
static long AsMilliseconds(long double ts) {
|
||||
return lrintl(ts * 1e3);
|
||||
return rintl(ts * 1e3);
|
||||
}
|
||||
|
||||
static long AsNanoseconds(long double ts) {
|
||||
return lrintl(ts * 1e9);
|
||||
return rintl(ts * 1e9);
|
||||
}
|
||||
|
||||
static long double GetGraceTime(void) {
|
||||
|
@ -733,7 +733,7 @@ static void RenderIt(void) {
|
|||
if (ttymode_ && stats_) {
|
||||
bpc = bpf = p - vt;
|
||||
bpc /= wsize_.ws_row * wsize_.ws_col;
|
||||
sprintf(status_[4], " %s/%s/%s %zu×%zu → %zu×%zu pixels ",
|
||||
sprintf(status_[4], " %s/%s/%s %d×%d → %u×%u pixels ",
|
||||
kPrimaries[primaries_].name, DescribeSwing(swing_),
|
||||
kLightings[lighting_].name, plm_get_width(plm_),
|
||||
plm_get_height(plm_), g2_->xn, g2_->yn);
|
||||
|
@ -1069,7 +1069,7 @@ static void SetQuant(enum TtyQuantizationAlgorithm alg,
|
|||
enum TtyQuantizationChannels chans,
|
||||
enum TtyBlocksSelection blocks) {
|
||||
tuned_ = true;
|
||||
ttyquantinit(alg, chans, blocks);
|
||||
ttyquantsetup(alg, chans, blocks);
|
||||
}
|
||||
|
||||
static void SetQuantizationAlgorithm(enum TtyQuantizationAlgorithm alg) {
|
||||
|
@ -1516,7 +1516,7 @@ static void PickDefaults(void) {
|
|||
* strcmp(nulltoempty(getenv("TERM")), "xterm-direct") == 0
|
||||
*/
|
||||
if (strcmp(nulltoempty(getenv("TERM")), "xterm-kitty") == 0) {
|
||||
ttyquantinit(kTtyQuantTrue, TTYQUANT()->chans, kTtyBlocksUnicode);
|
||||
ttyquantsetup(kTtyQuantTrue, TTYQUANT()->chans, kTtyBlocksUnicode);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue