---
id: 3013
lang: en
translation_of: index.md
source_sha256: 328b5aaac5cff7189bc723a235f50199937c7a661e12d3e91c186928c6c14b76
title: "Programming on the RISC-V Platform (Part 1)"
description: "How to run a bare-metal C program on QEMU's RISC-V emulator: the boot flow, the ELF format, a linker script, and debugging with GDB."
tags: ["RISC-V","C"]
translated: 2026-11-27
translator: Claude Opus 5.5
translator_model: claude-opus-5-5
translation_notes:
  - "Dropped the English glosses the author put in parentheses after Chinese terms where the English term itself is now the text (链接（Linking） → Linking; toolchain, emulation, base address, paging, entry point, section, address, size, Preprocessing, macro, assembly, assembler, object file, linker script, metadata, stack pointer register); kept the (stdout), (program counter), (ISA) and (CRT) parentheticals, which still carry information in English."
  - "坎德人的小包包, the name of the external blog in a further-reading link, rendered literally as “Kender's Little Pouch” (坎德人 = the Kender of Dragonlance)."
  - "呼之欲出 rendered as “was ready to burst onto the scene”; 中间程序 as “intermediary programs”."
---

## Introduction

> The authors of RISC-V aim to provide several CPU designs that can be used freely under the [BSD license](https://zh.wikipedia.org/wiki/BSD%E8%AE%B8%E5%8F%AF%E8%AF%81); the license allows derivative works such as RISC-V chip designs to be open and freely distributed like RISC-V itself, or to be closed-source or proprietary.
>
> RISC-V - Wikipedia

Over the past few decades of the open-source software movement, a whole series of open-source software, represented by GNU/Linux and others, has become indispensable infrastructure in the tech industry, benefiting every individual and group that uses open-source software equally. Beyond open-source operating systems, the open-source movement has never stopped in other areas either. All kinds of software development frameworks and system software are embracing open source (for example, Microsoft, which once called Linux a “cancer”, is now also actively contributing to the open-source community).

<!--more-->

However, besides software, computers also have hardware. The open-source movement has likewise “spread” to hardware. An open-source hardware movement, open-sourcing PCB designs, CAD files, chip design files and so on, is under way as well. The CPU is the core component of a computer, so naturally it also falls within the open-source movement's “firing range”. However, the instruction sets (ISAs) of popular CPUs are either commercially closed (x86_64, ARM) or look dated (MIPS). Against this backdrop, the open instruction set RISC-V was ready to burst onto the scene.

[Further reading on the history of RISC-V: [RISC-V - Wikipedia](https://en.wikipedia.org/wiki/RISC-V#History)]

Compared with the traditional x86_64 instruction set, RISC-V has many advantages:

- RISC-V assembly is more natural to write.
- RISC-V was designed in the past decade and integrates more features of modern processors at the instruction-set level, which makes it better for learning and development; x86_64 carries too much historical baggage, so learning and developing for its instruction set is rather complicated.
- Academia and industry are very interested in RISC-V.

However, RISC-V is, after all, still a fairly young instruction-set standard, and it has a great many shortcomings too:

- It lacks implementations of high-performance processors.
- Current RISC-V platform development mostly targets QEMU; development on real hardware is still rare.

This post, and posts I may publish in the future, will form a series recording some of the experience and insights I have gained developing on the RISC-V platform.

## What This Post Covers

In this post, I will show how to get a C program running on QEMU's RISC-V emulator. Along the way, I will touch on the following:

- The RISC-V boot flow
- The ELF format
- Linking

## Runtime Environment

### **Compiler Toolchain**

The GNU toolchain is widely used in everyday development, and we can choose GNU's toolchain for the RISC-V platform (please choose the toolchain version that produces ELF files). [[The RISC-V GNU toolchain on GitHub](https://github.com/riscv-collab/riscv-gnu-toolchain)] (build and installation steps for the toolchain included)

### QEMU Emulator

The QEMU emulator supports emulation of many instruction sets; the installation guide is in the official documentation. [[QEMU official website](https://www.qemu.org/)]

## Where Does the Program Run From?

We are doing something really cool right now: throwing away the operating system and running our own program directly on the platform. Bypassing the operating system sounds really great: when I run long computing jobs on a server, I always wish I could take the operating system away so the job could use the computing resources without any loss. But if we really did take the operating system away, we might run into some real trouble. When we program, we rely on help from a lot of “intermediary programs”: for example, all of our program's I/O is handled by the operating system on its behalf. Without the operating system, we have to do a lot of extra work.

Let's take QEMU as an example and go over how a RISC-V platform behaves after power-on. To start a QEMU emulation instance:

```bash
qemu-system-riscv64 \
   -machine virt \     # 模拟器类型;
   -bios none \        # BIOS 类型;
   -m 128M \           # 内存大小;
   -nographic          # 禁用图像，在这里只需要让 QEMU 在控制台中与我们交互即可;
```

After running it, you should get nothing at all. Why? After QEMU powers on, it does some preparation, and once the preparation is done, the Program Counter jumps to `0x80000000` in memory and executes code with `Machine Mode` privileges; from then on, the machine does whatever the program tells it to do. When QEMU starts, memory is completely blank, so naturally there is no output at all.

So if we want to run a program, we need to put the program's first instruction at `0x80000000` and then let the machine keep fetching instructions and executing them from there.

How do we do that? One idea is to write the program, compile it into a binary file, and then inject it into QEMU byte by byte by modifying memory through GDB (this is a joke, of course; don't take it seriously). That is rather tedious, and it isn't work a programmer should be responsible for, so how should we solve this problem?

Think about how our everyday computers boot: after entering the BIOS/EFI Firmware, you can use the BIOS/EFI Firmware to choose which medium to boot from (hard drive, CD/DVD, USB drive, etc.); once a medium is chosen, taking the common case of booting from a hard drive, the BIOS/EFI Firmware reads the boot entry information from the drive (MBR/GPT provide the relevant information), then loads the operating system or a Bootloader (e.g. GRUB, bootmgr) into memory based on the contents of the drive, and booting is done; after that, the operating system continues initializing, or the Bootloader carries on with the boot.

That's a bit of a hassle. Is there some quick way to inject the program straight into QEMU's memory and have QEMU directly run the code we put at `0x80000000`?

Actually, there is, though it's a convenience that QEMU provides. The `-kernel` option loads a file from our file system into QEMU's memory. Sounds really great; it looks like dawn is about to break.

## Program Loading

But how does QEMU know how to load a file into memory? This sounds a bit dumb, since the file is all binary; the instinctive idea is: just put everything in the file into memory byte by byte, and if extra information is really needed, give QEMU an address and have it write the whole file at that base address. In practice, however, this approach is just far too impractical:

- In common runtime environments, the operating system often turns on memory paging, and sometimes we need to put different parts of a program (executable binary, data) on the same/different pages, or at different addresses; then loading the different parts of the program to their corresponding addresses becomes really necessary.
- Sometimes the C programs we write have fairly large static arrays (for example: `int buf[10000000]`). If at compile time we reserved `10000000` blank `int` slots in the file, space efficiency would be extremely low. If instead the program loading the file could allocate `10000000` blank `int` slots in memory for us, rather than copying all `10000000` blank `int` slots in the file into memory, the efficiency of the whole system would improve enormously.

So crudely copying the file's contents straight onto the corresponding memory block is not an option. We need to load the different parts of the file to their corresponding locations according to some plan. How does Linux do it? Suppose we want to run the file `riscv-test`: first, the way to load it into memory should be provided by **the file itself**; Linux first reads the memory-loading plan written in advance inside `riscv-test`, then places the specified chunks of `riscv-test` into memory according to the plan, and starts running the code in `riscv-test` from the program entry point given by the plan.

Linux and `riscv-test` agree to use the ELF format. A file in this format contains not only the file contents (executable binary, data, and so on) but also rules for how to load the data into memory. Since the details of the ELF format are rather complicated, I have excerpted some parts here to help readers understand.

### Executable and Linkable Format - ELF

![CC BY-SA 3.0](media/1280px-Elf-layout--en.svg.png)

The diagram above shows the rough structure of an ELF file. Data is stored in the file in the form of sections, such as `.text`, `.rodata`, `.data`, etc. The addresses and sizes of these sections are defined in the Section Header Table at the bottom.

We will get to know the ELF format by dissecting an executable file. Let's write a program, `test_elf.c`:

```c
// test_elf.c
#include <stdio.h>
​
int main()
{
   int a = 10, b = 20;
   printf("%d\n", a + b);
   return 0;
}
```

Compile it with the RISC-V GNU toolchain's compiler (the toolchain prefix may vary depending on the platform; for example, for a toolchain built on Ubuntu 22.04, the prefix is `riscv64-unknown-linux-gnu-gcc`):

```bash
riscv64-unknown-linux-gnu-gcc test_elf.c -o test_elf
```

Now we have `test_elf`, and we use a tool called `readelf` (please install it yourself) to read the ELF information in `test_elf`:

```bash
readelf -a test_elf > elf_report
```

[[The elf_report file - elf_report on GitHub Gist](https://gist.github.com/kaloronahuang/b7d37d33b5a4e840041cd5c65c773b3c)]

Open `elf_report`; its outline is roughly:

- ELF Header
- Section Headers
- Program Headers
- Dynamic Section
- Relocation Section
- Symbol Table
- ...

Let's first take a look at the **ELF Header**:

```text
ELF Header:
Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
Class:                             ELF64
Data:                             2's complement, little endian
Version:                           1 (current)
OS/ABI:                           UNIX - System V
ABI Version:                       0
Type:                             EXEC (Executable file)
Machine:                           RISC-V
Version:                           0x1
Entry point address:               0x10450
Start of program headers:         64 (bytes into file)
Start of section headers:         12152 (bytes into file)
Flags:                             0x5, RVC, double-float ABI
Size of this header:               64 (bytes)
Size of program headers:           56 (bytes)
Number of program headers:         10
Size of section headers:           64 (bytes)
Number of section headers:         35
Section header string table index: 34
```

The ELF Header records some basic information about the program, such as the ELF format, OS/ABI, architecture, and so on.

Next, let's look at the **Section Headers** (the text is quite wide; reading it full-screen on a wide-screen device is recommended):

```text
Section Headers:
[Nr] Name             Type             Address           Offset
      Size             EntSize         Flags Link Info Align
[ 0]                   NULL             0000000000000000 00000000
      0000000000000000 0000000000000000           0     0     0
[ 1] .interp           PROGBITS         0000000000010270 00000270
      0000000000000021 0000000000000000   A       0     0     1
[ 2] .note.ABI-tag     NOTE             0000000000010294 00000294
      0000000000000020 0000000000000000   A       0     0     4
[ 3] .hash             HASH             00000000000102b8 000002b8
      0000000000000024 0000000000000004   A       5     0     8
[ 4] .gnu.hash         GNU_HASH         00000000000102e0 000002e0
      0000000000000030 0000000000000000   A       5     0     8
[ 5] .dynsym           DYNSYM           0000000000010310 00000310
      0000000000000060 0000000000000018   A       6     1     8
[ 6] .dynstr           STRTAB           0000000000010370 00000370
      0000000000000041 0000000000000000   A       0     0     1
[ 7] .gnu.version     VERSYM           00000000000103b2 000003b2
      0000000000000008 0000000000000002   A       5     0     2
[ 8] .gnu.version_r   VERNEED         00000000000103c0 000003c0
      0000000000000020 0000000000000000   A       6     1     8
[ 9] .rela.plt         RELA             00000000000103e0 000003e0
      0000000000000030 0000000000000018 AI       5   19     8
[10] .plt             PROGBITS         0000000000010410 00000410
      0000000000000040 0000000000000010 AX       0     0     16
[11] .text             PROGBITS         0000000000010450 00000450
      0000000000000134 0000000000000000 AX       0     0     4
[12] .rodata           PROGBITS         0000000000010588 00000588
      0000000000000004 0000000000000000   A       0     0     8
[13] .eh_frame_hdr     PROGBITS         000000000001058c 0000058c
      0000000000000014 0000000000000000   A       0     0     4
[14] .eh_frame         PROGBITS         00000000000105a0 000005a0
      000000000000002c 0000000000000000   A       0     0     8
[15] .preinit_array   PREINIT_ARRAY   0000000000011e08 00000e08
      0000000000000008 0000000000000008 WA       0     0     1
[16] .init_array       INIT_ARRAY       0000000000011e10 00000e10
      0000000000000008 0000000000000008 WA       0     0     8
[17] .fini_array       FINI_ARRAY       0000000000011e18 00000e18
      0000000000000008 0000000000000008 WA       0     0     8
[18] .dynamic         DYNAMIC         0000000000011e20 00000e20
      00000000000001e0 0000000000000010 WA       6     0     8
[19] .got             PROGBITS         0000000000012000 00001000
      0000000000000028 0000000000000008 WA       0     0     8
[20] .sdata           PROGBITS         0000000000012028 00001028
      0000000000000010 0000000000000000 WA       0     0     8
[21] .bss             NOBITS           0000000000012038 00001038
      0000000000000008 0000000000000000 WA       0     0     1
[22] .comment         PROGBITS         0000000000000000 00001038
      000000000000002d 0000000000000001 MS       0     0     1
[23] .riscv.attributes RISCV_ATTRIBUTE 0000000000000000 00001065
      0000000000000035 0000000000000000           0     0     1
[24] .debug_aranges   PROGBITS         0000000000000000 000010a0
      00000000000000a0 0000000000000000           0     0     16
[25] .debug_info       PROGBITS         0000000000000000 00001140
      0000000000000683 0000000000000000           0     0     1
[26] .debug_abbrev     PROGBITS         0000000000000000 000017c3
      000000000000027b 0000000000000000           0     0     1
[27] .debug_line       PROGBITS         0000000000000000 00001a3e
      0000000000000244 0000000000000000           0     0     1
[28] .debug_frame     PROGBITS         0000000000000000 00001c88
      0000000000000068 0000000000000000           0     0     8
[29] .debug_str       PROGBITS         0000000000000000 00001cf0
      00000000000004e0 0000000000000001 MS       0     0     1
[30] .debug_line_str   PROGBITS         0000000000000000 000021d0
      0000000000000174 0000000000000001 MS       0     0     1
[31] .debug_loclists   PROGBITS         0000000000000000 00002344
      000000000000012b 0000000000000000           0     0     1
[32] .symtab           SYMTAB           0000000000000000 00002470
      0000000000000768 0000000000000018         33   61     8
[33] .strtab           STRTAB           0000000000000000 00002bd8
      0000000000000239 0000000000000000           0     0     1
[34] .shstrtab         STRTAB           0000000000000000 00002e11
      0000000000000160 0000000000000000           0     0     1
```

Let's look at the table header here:

```text
[Nr] Name             Type             Address           Offset
      Size             EntSize         Flags Link Info Align
```

Following this header, let's look at the information for the `.text` section:

```text
[11] .text             PROGBITS         0000000000010450 00000450
      0000000000000134 0000000000000000 AX       0     0     4
```

The data type of `.text` is defined as `PROGBITS`, and it asks the loader to load this data at `0000000000010450` in memory. This data is located at `00000450` in the file, its size is `0000000000000134`, it is aligned in memory on `4` bytes, it needs to occupy this memory at run time (**A**), and this data is executable (**X**).

[Supplementary reading: [Executable and Linkable Format - Wikipedia](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format)][Supplementary reading: [elf(5) - Linux manual page](https://man7.org/linux/man-pages/man5/elf.5.html)]

So if we need to put our program in memory and have the QEMU emulator run it, we have to generate a correct ELF file from our code and have QEMU load the contents according to the ELF format.

## Linking

I believe that when you all learned C or other languages, you at least skimmed an introduction to the “compilation process”, which includes a step called linking. Most people probably won't dig into it (I myself only came across these details quite late), but it helps a lot with getting our programs to run correctly.

[Further reading: [Understand the C++ Compilation Process in 10 Minutes | Kender's Little Pouch](https://oicebot.github.io/2020/03/20/c-compilers-explained.html)]

Compiling a C program usually starts with preprocessing the C file. During preprocessing, the compiler copies the entire contents of the header files into the source file and expands the corresponding macros according to the macro definitions in the text. After that, the compiler compiles the C program into assembly code, which the assembler then assembles to produce an object file.

Next comes linking. Linking puts the executable binary contents of the object files in their corresponding places and rearranges the contents' locations and references.

[Further reading: [Linking - Computer Systems A Programmers Perspective - 3rd](media/linking_csapp.pdf)]

The tool that helps us assemble object files into an ELF-format file is the ld linker from GNU Binutils. The way ld works is: following a linker script, it places the object files at their corresponding positions in the file, marks where they should be loaded in memory, organizes metadata such as the ELF header, and finally outputs a standard ELF file.

For a C program, one extra thing is needed to run correctly: the C Runtime (CRT for short). Although a compiled C program runs directly as an executable binary, its execution relies on the C Runtime. When GCC compiles a C program, besides compiling the C code into an object file, it also adds the C Runtime's object files to the link, finally forming an ELF-format file. And when Linux reads and runs an ELF-format C program, it first enters the C Runtime's entry point, and the C Runtime then jumps to main.

Why is it designed this way? Although we say the C language is a high-level abstraction of assembly language, and C's behavior can be mapped to assembly code, the **stack structure that C needs does not inherently exist** in memory. One of the C Runtime's major jobs is to set up the stack structure in memory and set up the stack pointer register before main runs. So we need to write a separate piece of assembly code to set up the stack, and then link them together. We rewrite `test_elf.c` as:

```c
// test_elf.c
char stack[4096];

void main()
{
    int a = 10, b = 20, c = 0;
    for (;;)
        c += a + b;
}
```

Since we're running on bare metal, there is no such thing as a “standard output stream” (stdout), and naturally `printf` can't be used either. So how do we verify that our program is running? We can use QEMU's debug port to let GDB connect to the virtual machine, and then we can observe what the CPU and memory are doing.

Then we write a bootstrap program in assembly, `entry.S`:

```text
# entry.S
# To create a stack for C-compiled program and handover control to C world.

# Useful in linking;
.section .text
.global __entry
__entry:
    # Create the stack for C world;
    la a0, stack
    # Stack pointer decreases gradually with the more data loaded into the stack;
    li a1, 4096
    add a0, a0, a1
    mv sp, a0
    # Go!
    call main
```

What `entry.S` does is set up the stack space and jump to `main`. Note here that `.section .text` means “the following executable code should be put into the `.text` region”; its purpose is to make the linker put this code into the corresponding ELF section; `.global __entry` defines a global symbol, assigning the address of this instruction to the symbol `__entry`. This symbol will be used in the script later. Also, we defined a block of memory, `stack`, in `test_elf.c`, so here we set `sp` to the bottom of `stack`.

We also need a linker script to put the program together:

```text
/*
    linking.ld
*/

OUTPUT_ARCH( "riscv" ) /* 设置目标指令集 */
ENTRY( __entry ) /* 设置程序入口点 */

/* 段定义信息 */
SECTIONS
{
    /* "." 是内存指针，它的作用是定位内容、将内容放置于指定位置 */
    . = 0x80000000;

    /* 我们把内存指针设置为 0x80000000，然后在 0x80000000 的位置上定义 .text 段 */
    .text : {
        /* 放置内容 */
        *(.text .text.*)
        /* 内容放置完毕之后，为了内存对齐，我们还需要留一部分的白，这里我们使用 ALIGN 来计算对齐之后的内存位置 */
        . = ALIGN(0x1000);
    }

    /* 以下三个段都存储了程序所需要的数据，就不再细讲 */

    .rodata : {
        . = ALIGN(16);
        *(.srodata .srodata.*)
        . = ALIGN(16);
        *(.rodata .rodata.*)
        . = ALIGN(16);
    }

    .data : {
        *(.sdata .sdata.*)
        . = ALIGN(16);
        *(.data .data.*)
        . = ALIGN(16);
    }

    .bss : {
        *(.sbss .sbss.*)
        . = ALIGN(16);
        *(.bss .bss.*)
        . = ALIGN(16);
    }
}
```

Then we write a script, `make.sh`, to do the compiling:

```bash
riscv64-unknown-linux-gnu-gcc test_elf.c \
    -Wall -O0 -ggdb -gdwarf-2 \
    -ffreestanding -fno-common -nostdlib -MD \
    -I. -mno-relax -fno-pie -no-pie -mcmodel=medany \
    -c -o test_elf.o

riscv64-unknown-linux-gnu-gcc entry.S -c -o entry.o

riscv64-unknown-linux-gnu-ld -z max-page-size=4096 -T linking.ld -o test_elf entry.o test_elf.o
```

The first thing to note is how the C source file is compiled. We need `-c -o test_elf.o` to tell the compiler to output an object file named `test_elf.o`. Besides that, there are many other compiler options: `-O0` turns off compiler optimization, `-ggdb -gdwarf-2` keeps the debug information, and `-ffreestanding -fno-common -nostdlib` turn off referencing and linking the standard library.

Next, load the ELF file into QEMU, open a debug port on TCP port 10024, and start our program in the virtual machine:

```bash
qemu-system-riscv64 \
   -machine virt \
   -bios none \
   -m 128M \
   -nographic \
   -kernel test_elf \
   -gdb tcp::10024 -S
```

Since this is debug mode, QEMU pauses after power-on and waits for GDB to act. Use GDB to start debugging:

```bash
gdb-multiarch
```

In the GDB console, set the target architecture and the symbol file, turn on automatic disassembly, and connect to QEMU:

```text
(gdb) set architecture riscv:rv64
The target architecture is set to "riscv:rv64".
(gdb) symbol-file test_elf
Reading symbols from test_elf...
(gdb) set disassemble-next-line auto
(gdb) target remote 127.0.0.1:10024
Remote debugging using 127.0.0.1:10024
```

After connecting, it shows where the machine is currently running (the program counter):

```text
0x0000000000001000 in ?? ()
```

First, we set a breakpoint at the entry point:

```text
(gdb) b *0x80000000
Breakpoint 1 at 0x80000000
(gdb) c
Continuing.
```

We arrive at `__entry`:

```text
Breakpoint 1, 0x0000000080000000 in __entry ()
=> 0x0000000080000000 <__entry+0>:      17 15 00 00     auipc   a0,0x1
(gdb) si
0x0000000080000004 in __entry ()
=> 0x0000000080000004 <__entry+4>:      13 05 05 00     mv      a0,a0
(gdb) si
0x0000000080000008 in __entry ()
=> 0x0000000080000008 <__entry+8>:      85 65   lui     a1,0x1
(gdb) si
0x000000008000000a in __entry ()
=> 0x000000008000000a <__entry+10>:     2e 95   add     a0,a0,a1
(gdb) si
0x000000008000000c in __entry ()
=> 0x000000008000000c <__entry+12>:     2a 81   mv      sp,a0
(gdb) si
0x000000008000000e in __entry ()
=> 0x000000008000000e <__entry+14>:     ef 00 40 00     jal     ra,0x80000012 <main>
```

Into `main`:

```text
(gdb) si
main () at test_elf.c:5
5       {
(gdb) si
0x0000000080000014      5       {
(gdb) si
0x0000000080000016      5       {
(gdb) si
6           int a = 10, b = 20, c = 0;
(gdb) si
0x000000008000001a      6           int a = 10, b = 20, c = 0;
(gdb) si
6           int a = 10, b = 20, c = 0;
(gdb) si
0x0000000080000020      6           int a = 10, b = 20, c = 0;
(gdb) si
6           int a = 10, b = 20, c = 0;
(gdb) si
8               c += a + b;
```

## Conclusion

In this post we put a program in memory and gave all the computing resources to it, which is very cool. On this basis, we can do some embedded programming, or even implement a lot of system software.

If this post has any errors or shortcomings, I'd be grateful if you could point them out. Thank you.

## Reference

[1]Wikipedia, "RISC-V - Wikipedia," retrieved 16 March 2023, https://en.wikipedia.org/wiki/RISC-V\
[2]riscv-collab, "GNU toolchain for RISC-V, including GCC," retrieved 16 March 2023, https://github.com/riscv-collab/riscv-gnu-toolchain\
[3]QEMU, "QEMU," retrieved 16 March 2023, https://www.qemu.org\
[4]twilco, "RISC-V from scratch 2: Hardware layouts, linker scripts, and C runtimes, " retrieved 16 March 2023, https://twilco.github.io/riscv-from-scratch/2019/04/27/riscv-from-scratch-2.html\
[5]Massachusetts Institute of Technology, "xv6-riscv," retrieved 16 March 2023, https://pdos.csail.mit.edu/6.828/2022/xv6.html\
[6]Editors Andrew Waterman and Krste Asanovi ́c, "The RISC-V Instruction Set Manual, Volume I: User-Level ISA, Document Version 20191213," RISC-V Foundation, December 2019\
[7]Editors Andrew Waterman, Krste Asanovi ́c, and John Hauser, "The RISC-V Instruction Set Manual, Volume II: Privileged Architecture, Docu- ment Version 20211203," RISC-V International, December 2021\
[8]Wikipedia, "Executable and Linkable Format - Wikipedia," retrieved 16 March 2023, https://en.wikipedia.org/wiki/Executable_and_Linkable_Format\
[9]Atish Patra, Anup Patel, "An Introduction to RISC-V Boot Flow"\
[10]Jagan Teki, "An Introduction to RISC-V Boot flow: Overview,\
Blob vs Blobfree standards"
