2025-09-03
"woah, I made a thing"
use it to build disk images and run emulation of your program with cargo!
see vlunnr(1) and vlunnr.cfg(5) for usage details!
SPDX-License-Identifier: CC-BY-NC-SA-4.0 OR GPL-3.0-or-later
Copyright (C) 2025 Ayzee Patton vlpatton@vlpatton.gay
vlunnr is licensed under the GNU General Public License version 3.0, or later, or the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license, at your option.
You should have received a copy of the licenses with this distribution. If not, you may find them at https://www.gnu.org/licenses/gpl-3.0.txt or https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.
shell:
vlunnr build mnt disk.img
shell:
vlunnr run build/program.elf
.cargo/config.toml:
[target]
runner = "vlunnr run"
vlunnr.cfg:
run_cmd = [
"qemu-system-x86_64",
"-drive", "format=raw,file={disk}"
]
shell:
cargo r
When a disk image path isn't supplied to vlunnr run, vlunnr(1) will
automatically generate a new disk image based on vlunnr.cfg(5), and the path
to this generated disk image can be passed as a string substitution with
{disk} in run_cmd or test_cmd. After doing the string substitution,
vlunnr(1) will then run execute the command as a child process.
Since we have Cargo set to execute vlunnr run as the runner for cargo r,
running cargo r will build our executable Rust code, pass the path to the
built executable to vlunnr(1), and then it will build the temporary disk image
and run it according to vlunnr.cfg(5).