mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
f4f4caab0e
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
282 lines
5.3 KiB
C
282 lines
5.3 KiB
C
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
|
|
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
|
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
|
│ Copyright 2020 Justine Alexandra Roberts Tunney │
|
|
│ │
|
|
│ This program is free software; you can redistribute it and/or modify │
|
|
│ it under the terms of the GNU General Public License as published by │
|
|
│ the Free Software Foundation; version 2 of the License. │
|
|
│ │
|
|
│ This program is distributed in the hope that it will be useful, but │
|
|
│ WITHOUT ANY WARRANTY; without even the implied warranty of │
|
|
│ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU │
|
|
│ General Public License for more details. │
|
|
│ │
|
|
│ You should have received a copy of the GNU General Public License │
|
|
│ along with this program; if not, write to the Free Software │
|
|
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
|
│ 02110-1301 USA │
|
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
|
#include "dsp/tty/xtermname.h"
|
|
|
|
/**
|
|
* 256-entry double-nul-terminated list of XTERM256 names.
|
|
*/
|
|
const char kXtermName[] = "\
|
|
Black\0\
|
|
Maroon\0\
|
|
Green\0\
|
|
Olive\0\
|
|
Navy\0\
|
|
Purple\0\
|
|
Teal\0\
|
|
Silver\0\
|
|
Grey\0\
|
|
Red\0\
|
|
Lime\0\
|
|
Yellow\0\
|
|
Blue\0\
|
|
Fuchsia\0\
|
|
Aqua\0\
|
|
White\0\
|
|
Grey0\0\
|
|
NavyBlue\0\
|
|
DarkBlue\0\
|
|
Blue3\0\
|
|
Blue3\0\
|
|
Blue1\0\
|
|
DarkGreen\0\
|
|
DeepSkyBlue4\0\
|
|
DeepSkyBlue4\0\
|
|
DeepSkyBlue4\0\
|
|
DodgerBlue3\0\
|
|
DodgerBlue2\0\
|
|
Green4\0\
|
|
SpringGreen4\0\
|
|
Turquoise4\0\
|
|
DeepSkyBlue3\0\
|
|
DeepSkyBlue3\0\
|
|
DodgerBlue1\0\
|
|
Green3\0\
|
|
SpringGreen3\0\
|
|
DarkCyan\0\
|
|
LightSeaGreen\0\
|
|
DeepSkyBlue2\0\
|
|
DeepSkyBlue1\0\
|
|
Green3\0\
|
|
SpringGreen3\0\
|
|
SpringGreen2\0\
|
|
Cyan3\0\
|
|
DarkTurquoise\0\
|
|
Turquoise2\0\
|
|
Green1\0\
|
|
SpringGreen2\0\
|
|
SpringGreen1\0\
|
|
MediumSpringGreen\0\
|
|
Cyan2\0\
|
|
Cyan1\0\
|
|
DarkRed\0\
|
|
DeepPink4\0\
|
|
Purple4\0\
|
|
Purple4\0\
|
|
Purple3\0\
|
|
BlueViolet\0\
|
|
Orange4\0\
|
|
Grey37\0\
|
|
MediumPurple4\0\
|
|
SlateBlue3\0\
|
|
SlateBlue3\0\
|
|
RoyalBlue1\0\
|
|
Chartreuse4\0\
|
|
DarkSeaGreen4\0\
|
|
PaleTurquoise4\0\
|
|
SteelBlue\0\
|
|
SteelBlue3\0\
|
|
CornflowerBlue\0\
|
|
Chartreuse3\0\
|
|
DarkSeaGreen4\0\
|
|
CadetBlue\0\
|
|
CadetBlue\0\
|
|
SkyBlue3\0\
|
|
SteelBlue1\0\
|
|
Chartreuse3\0\
|
|
PaleGreen3\0\
|
|
SeaGreen3\0\
|
|
Aquamarine3\0\
|
|
MediumTurquoise\0\
|
|
SteelBlue1\0\
|
|
Chartreuse2\0\
|
|
SeaGreen2\0\
|
|
SeaGreen1\0\
|
|
SeaGreen1\0\
|
|
Aquamarine1\0\
|
|
DarkSlateGray2\0\
|
|
DarkRed\0\
|
|
DeepPink4\0\
|
|
DarkMagenta\0\
|
|
DarkMagenta\0\
|
|
DarkViolet\0\
|
|
Purple\0\
|
|
Orange4\0\
|
|
LightPink4\0\
|
|
Plum4\0\
|
|
MediumPurple3\0\
|
|
MediumPurple3\0\
|
|
SlateBlue1\0\
|
|
Yellow4\0\
|
|
Wheat4\0\
|
|
Grey53\0\
|
|
LightSlateGrey\0\
|
|
MediumPurple\0\
|
|
LightSlateBlue\0\
|
|
Yellow4\0\
|
|
DarkOliveGreen3\0\
|
|
DarkSeaGreen\0\
|
|
LightSkyBlue3\0\
|
|
LightSkyBlue3\0\
|
|
SkyBlue2\0\
|
|
Chartreuse2\0\
|
|
DarkOliveGreen3\0\
|
|
PaleGreen3\0\
|
|
DarkSeaGreen3\0\
|
|
DarkSlateGray3\0\
|
|
SkyBlue1\0\
|
|
Chartreuse1\0\
|
|
LightGreen\0\
|
|
LightGreen\0\
|
|
PaleGreen1\0\
|
|
Aquamarine1\0\
|
|
DarkSlateGray1\0\
|
|
Red3\0\
|
|
DeepPink4\0\
|
|
MediumVioletRed\0\
|
|
Magenta3\0\
|
|
DarkViolet\0\
|
|
Purple\0\
|
|
DarkOrange3\0\
|
|
IndianRed\0\
|
|
HotPink3\0\
|
|
MediumOrchid3\0\
|
|
MediumOrchid\0\
|
|
MediumPurple2\0\
|
|
DarkGoldenrod\0\
|
|
LightSalmon3\0\
|
|
RosyBrown\0\
|
|
Grey63\0\
|
|
MediumPurple2\0\
|
|
MediumPurple1\0\
|
|
Gold3\0\
|
|
DarkKhaki\0\
|
|
NavajoWhite3\0\
|
|
Grey69\0\
|
|
LightSteelBlue3\0\
|
|
LightSteelBlue\0\
|
|
Yellow3\0\
|
|
DarkOliveGreen3\0\
|
|
DarkSeaGreen3\0\
|
|
DarkSeaGreen2\0\
|
|
LightCyan3\0\
|
|
LightSkyBlue1\0\
|
|
GreenYellow\0\
|
|
DarkOliveGreen2\0\
|
|
PaleGreen1\0\
|
|
DarkSeaGreen2\0\
|
|
DarkSeaGreen1\0\
|
|
PaleTurquoise1\0\
|
|
Red3\0\
|
|
DeepPink3\0\
|
|
DeepPink3\0\
|
|
Magenta3\0\
|
|
Magenta3\0\
|
|
Magenta2\0\
|
|
DarkOrange3\0\
|
|
IndianRed\0\
|
|
HotPink3\0\
|
|
HotPink2\0\
|
|
Orchid\0\
|
|
MediumOrchid1\0\
|
|
Orange3\0\
|
|
LightSalmon3\0\
|
|
LightPink3\0\
|
|
Pink3\0\
|
|
Plum3\0\
|
|
Violet\0\
|
|
Gold3\0\
|
|
LightGoldenrod3\0\
|
|
Tan\0\
|
|
MistyRose3\0\
|
|
Thistle3\0\
|
|
Plum2\0\
|
|
Yellow3\0\
|
|
Khaki3\0\
|
|
LightGoldenrod2\0\
|
|
LightYellow3\0\
|
|
Grey84\0\
|
|
LightSteelBlue1\0\
|
|
Yellow2\0\
|
|
DarkOliveGreen1\0\
|
|
DarkOliveGreen1\0\
|
|
DarkSeaGreen1\0\
|
|
Honeydew2\0\
|
|
LightCyan1\0\
|
|
Red1\0\
|
|
DeepPink2\0\
|
|
DeepPink1\0\
|
|
DeepPink1\0\
|
|
Magenta2\0\
|
|
Magenta1\0\
|
|
OrangeRed1\0\
|
|
IndianRed1\0\
|
|
IndianRed1\0\
|
|
HotPink\0\
|
|
HotPink\0\
|
|
MediumOrchid1\0\
|
|
DarkOrange\0\
|
|
Salmon1\0\
|
|
LightCoral\0\
|
|
PaleVioletRed1\0\
|
|
Orchid2\0\
|
|
Orchid1\0\
|
|
Orange1\0\
|
|
SandyBrown\0\
|
|
LightSalmon1\0\
|
|
LightPink1\0\
|
|
Pink1\0\
|
|
Plum1\0\
|
|
Gold1\0\
|
|
LightGoldenrod2\0\
|
|
LightGoldenrod2\0\
|
|
NavajoWhite1\0\
|
|
MistyRose1\0\
|
|
Thistle1\0\
|
|
Yellow1\0\
|
|
LightGoldenrod1\0\
|
|
Khaki1\0\
|
|
Wheat1\0\
|
|
Cornsilk1\0\
|
|
Grey100\0\
|
|
Grey3\0\
|
|
Grey7\0\
|
|
Grey11\0\
|
|
Grey15\0\
|
|
Grey19\0\
|
|
Grey23\0\
|
|
Grey27\0\
|
|
Grey30\0\
|
|
Grey35\0\
|
|
Grey39\0\
|
|
Grey42\0\
|
|
Grey46\0\
|
|
Grey50\0\
|
|
Grey54\0\
|
|
Grey58\0\
|
|
Grey62\0\
|
|
Grey66\0\
|
|
Grey70\0\
|
|
Grey74\0\
|
|
Grey78\0\
|
|
Grey82\0\
|
|
Grey85\0\
|
|
Grey89\0\
|
|
Grey93\0\
|
|
\0";
|