UART What You Read

Computers are not much use unless you can interact with them. This means that the user must be able to input data into the system’s memory, and that data can be retrieved and displayed (or output) for the user. The most common way to interact with computers (i.e. smartphones) is via a touch screen which […]

The Rationality of Irrationality

Rationalism is a sociological philosophy which, in a general sense, eschews the understanding of reality through mystery and magic. This has parallels with computing where results can often seem magical. This is doubly true when dealing with real-world numbers: although the hardware seems ill equipped to express real numerical values complex calculations are nonetheless possible. […]

RISC-V Bare Metal Programming – Chapter 5: It’s a Trap!

Up to this point, the RISC-V tutorial has focused on single applications running on a single hardware thread. The application’s environment was composed of the processor’s state and memory map. The processor state was controlled via assembly instructions, and the memory map was defined at build time via a linker script. However, modern systems are […]

RISC-V Bare Metal Programming – Chapter 4: Another Brick in the Wall

Chapter 3 of this RISC-V bare metal tutorial studied the linking process and how a developer can control where code and data are placed in memory. Constants, initialized variables and uninitialized variables were defined and explicitly positioned in RAM as prescribed by a linker script. The running example program was updated to read operands from […]

RISC-V Bare Metal Programming Chapter 3: A Link to the Past

Previous chapters of the RISC-V bare metal programming tutorial have focused primarily on the assembler. In chapter 2, assembler directives were discussed along with their relationship to the positioning of code in an executable. The various sections of where code and data reside have well defined semantics in the Executable and Linkable Format specification. In […]

RISC-V Bare Metal Programming Chapter 2: OpCodes Assemble!

The previous chapter of this tutorial went over the steps required to setup a RISC-V development environment to create a program that runs on a bare metal VirtIO board using QEMU. Even though the example program – which calculates the sum two integers – was written in RISC-V assembly, no prior knowledge was required to […]

RISC-V Bare Metal Programming Chapter 1: The Setup

This tutorial, will walk through the process of building and running a RISC-V program on bare metal hardware. The reader is assumed to be familiar with the GNU toolchain and basic C programming. Assembly experience is useful but should not be required to follow along. There are many tutorials available to get started with bare […]