This repository hosts the sources and utilities to build a datapack that boots a very minimal Linux image in vanilla Minecraft.
Written against Minecraft 1.20.6.
Its a RISC-V I+M+A+Zicsr+Zifencei emulator written in cbscript, a scripting language that compiles relatively normal code to a set of minecraft command functions and places them in a datapack.
Data is mostly stored in scoreboards scores. Scoreboard score values are 32-bit signed integers. Additionally, minecraft allows some operations on these scores, which allows "relatively" efficient implementation of the emulator. There are only a few operations though, so most of the other ones (bit operations, 64-bit multiply, division, etc) are emulated.
Memory is stored in minecrafts data storage. There is a B-tree of 3 levels of 256 elements, each cell a 32-bit value.