
RISC-V from scratch 4: Creating a function prologue for our UART driver (2 / 3) - twilco
https://twilco.github.io/riscv-from-scratch/2019/07/28/riscv-from-scratch-4.html
======
twilco
I just completed part four in my blog post series, RISC-V from scratch,
throughout which I explore various low-level concepts (compilation and
linking, primitive runtimes, assembly, and more), typically through the lens
of RISC-V and its ecosystem.

In this post, we continue implementation of our virt QEMU UART driver by
implementing a function prologue for our two functions, uart_get_char and
uart_put_char. Changes to the stack and registers are diagrammed and explained
instruction-by-instruction.

You don't need to have read any of the previous posts to understand or follow
along with this one. You can expect to learn about what a function prologue
is, why it's sometimes necessary, and how to both recognize and implement one.

I enjoyed making this post. I hope you might be able to take something from
it, too! Feel free to leave any questions, comments, or corrections here or as
a comment on the post itself.

