about summary refs log tree commit diff stats
path: root/010vm.cc
Commit message (Expand)AuthorAgeFilesLines
* 7094Kartik Agaram2020-10-241-2/+2
* 6924Kartik Agaram2020-10-011-1/+0
* 6888Kartik Agaram2020-09-271-1/+1
* 6886 - floating-point divisionKartik Agaram2020-09-271-0/+6
* 6885 - starting on floating-point instructionsKartik Agaram2020-09-271-3/+12
* 6397Kartik Agaram2020-05-241-0/+397
* 5485 - promote SubX to top-levelKartik Agaram2019-07-271-900/+0
* 4428Kartik Agaram2018-07-261-0/+2
* 4421Kartik Agaram2018-07-261-1/+2
* 4417Kartik Agaram2018-07-261-1/+1
* 4272 - type-check variables in non-local spacesKartik Agaram2018-06-251-0/+2
* 4243Kartik Agaram2018-05-121-11/+16
* 4241Kartik Agaram2018-05-121-2/+2
* 4240Kartik Agaram2018-05-121-1/+1
* 4223Kartik K. Agaram2018-03-141-0/+1
* 4162Kartik K. Agaram2017-12-221-0/+25
* 3966Kartik K. Agaram2017-07-091-3/+3
* 3877Kartik K. Agaram2017-05-261-7/+2
* 3876Kartik K. Agaram2017-05-211-0/+1
* 3872Kartik K. Agaram2017-05-201-0/+14
* 3848Kartik K. Agaram2017-05-061-6/+3
* 3809Kartik K. Agaram2017-04-041-1/+2
* 3744Kartik K. Agaram2017-02-071-1/+0
* 3743Kartik K. Agaram2017-02-071-0/+1
* 3742 - move instruction.old_name to a later layerKartik K. Agaram2017-02-061-2/+0
* 3741Kartik K. Agaram2017-02-061-12/+20
* 3740Kartik K. Agaram2017-02-061-1/+2
* 3739Kartik K. Agaram2017-02-061-1/+11
* 3666Kartik K. Agaram2016-11-111-0/+2
* 3665Kartik K. Agaram2016-11-111-22/+22
* 3663 - fix a refcounting bug: '(type)' != 'type'Kartik K. Agaram2016-11-101-18/+49
* 3561Kartik K. Agaram2016-10-221-5/+5
* 3560Kartik K. Agaram2016-10-221-1/+1
* 3549Kartik K. Agaram2016-10-221-1/+1
* 3522Kartik K. Agaram2016-10-191-20/+20
* 3408Kartik K. Agaram2016-09-221-0/+4
* 3313Kartik K. Agaram2016-09-101-0/+83
* 3310Kartik K. Agaram2016-09-101-1/+2
* 3309Kartik K. Agaram2016-09-091-73/+88
* 3305 - show all available precision in numbersKartik K. Agaram2016-09-081-0/+1
* 3293Kartik K. Agaram2016-09-021-1/+4
* 3292Kartik K. Agaram2016-09-021-12/+12
* 3286Kartik K. Agaram2016-08-311-1/+21
* 3285Kartik K. Agaram2016-08-311-0/+1
* 3279Kartik K. Agaram2016-08-291-1/+1
* 3273Kartik K. Agaram2016-08-281-2/+2
* 3272Kartik K. Agaram2016-08-281-1/+1
* 3267Kartik K. Agaram2016-08-281-2/+0
* 3260Kartik K. Agaram2016-08-261-6/+6
* 3101 - purge .traces/ dir from repo historyKartik K. Agaram2016-07-051-2/+1
/ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/bin/sh
# Build one or more .subx files into an ELF binary, and package it up into a
# bootable ISO image with a Linux kernel.
#
# Must be run on Linux.
#
# Dependencies:
#   apt install build-essential flex bison wget libelf-dev libssl-dev xorriso
#
# Based on http://minimal.linux-bg.org (GPLv3)

set -e

if [ $# -eq 0 ]
then
  echo "Usage: `basename $0` file.subx ..."
  exit 1
fi

echo "=== building SubX binary"
./ntranslate $*
mv a.elf init
chmod +x init

echo "=== constructing initramfs out of SubX binary"
rm -rf tmp/isoimage
mkdir -p tmp/isoimage/boot
echo init | cpio -R root:root -H newc -o | xz -9 --check=none > tmp/isoimage/boot/rootfs.xz

if [ ! -d kernel.linux ]
then
  echo "=== cloning linux kernel"
  git clone https://github.com/akkartik/kernel kernel.linux
fi

echo "=== building linux kernel"
( cd kernel.linux
  make bzImage -j $(grep ^processor /proc/cpuinfo | wc -l)
)
cp *.linux/arch/x86/boot/bzImage tmp/isoimage/boot/kernel.xz

echo "=== downloading syslinux"
test -f tmp/syslinux-6.03.tar.xz  ||  wget https://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.xz -P tmp
echo "=== unpacking syslinux"
tar xf tmp/syslinux-*.tar.xz -C tmp

mkdir -p tmp/isoimage/boot/syslinux
cp syslinux.cfg \
   tmp/syslinux-*/bios/core/isolinux.bin \
   tmp/syslinux-*/bios/com32/elflink/ldlinux/ldlinux.c32 \
   tmp/isoimage/boot/syslinux

echo "=== generating mu-linux.iso"
# 'hybrid' ISO can also be used on non-optical media such as a disk or USB stick
xorriso -as mkisofs \
  -isohybrid-mbr tmp/syslinux-*/bios/mbr/isohdpfx.bin \
  -c boot/syslinux/boot.cat \
  -b boot/syslinux/isolinux.bin \
    -no-emul-boot \
    -boot-load-size 4 \
    -boot-info-table \
  tmp/isoimage -o mu_linux.iso