Skip to content

FAQ: Tools to Use

Nathaniel Wesley Filardo edited this page Jul 26, 2021 · 2 revisions

Building a new software stack involves ... a lot of other software. Below is a list of software you'll interact with. If you are not familiar with them now, you may want to spend some time changing that. It could save you heartache later.

What tools would be good to know beforehand?

QEMU

QEMU is a processor emulator, sometimes classified as a userland hypervisor. Whichever way you slice it, there is a forked version that supports CHERI-MIPS, CHERI-RISC-V, and Morello. The CHERI-RISC-V is the principal focus for development, but Qemu CHERI-MIPS was the stable option until earlier this year.

New users should now start with RISCV invocations. I have both MIPS and RISCV listed where applicable, but you should not use the MIPS without a very good reason.

FreeBSD Basics

CheriBSD is based on FreeBSD. Much of the team has extensive FreeBSD experience. I don’t however, and definitely wandered in a few weeds as a result. If you would like to learn more about FreeBSD and how the kernel is structured, there is the FreeBSD Handbook. If you are more of a textbook learner, or would like a more polished survey of the kernel than the Handbook, The Design and Implementation of the FreeBSD Operating System 2nd ed (ACM link, amz link) was recommended to me by a long time FreeBSD committer. Yes, one of the authors is part of CHERI and worked on Capsicum.

C Language

CheriBSD is primarily written in C and the principal CHERI targets are TCBs (Trusted Computing Bases), which are generally written in C or in something that secretly uses C. As a result, you’ll probably have a more pleasant time if you are conversant with C, and pointers in particular. I tend to have my trusty K&R C book within reach whenever I revisit C. You may want your C reference of choice handy as you read the CHERI C/C++ Programming Guide. I understand that C is no longer taught as often and C fluency is much less common now, so if this a weak area for you, please be patient with yourself.

If you’re in the mood for a spot of UNIX & C history, consider reading The UNIX time-sharing system, by Dennis M. Ritchie & Ken Thompson (1974). It may help you understand FreeBSD and C a little better.

Command Line Interface (CLI)

Cheribuild, qemu, and various other bits largely live and run out of your terminal. The build & install process largely assumes familiarity with the CLI. Familiarity with your package manager might also save you some pain and troubleshooting later on.

Git & Github

As I mentioned earlier, the CHERI main github page is a bit overwhelming. However, the documentation on the build system is very good, Alex has done a stellar job, and can be found on Cheribuild github. If you are interested in CheriBSD, then of course you should also check out the CheriBSD github.


The first version of this appeared on Allison Naaktgeboren's page.

Clone this wiki locally