Skip to content

Latest commit

 

History

History
22 lines (12 loc) · 1.99 KB

README.md

File metadata and controls

22 lines (12 loc) · 1.99 KB

Baremetal OS for Advanced Performance Monitoring Unit

This project is a WIP.

To build this a the custom LLVM port for APMU needs to be compiled which is available at: https://github.com/maskedarray/llvm-project/tree/rv-apmu-sw/

The compilation steps, although summarized in the repository, follow typical LLVM compilation workflow.

Asdditionally some libraries (libc) and headers need to be included from GCC installation. Following are the details:

  1. RISC-V GNU toolchain needs to be downloaded from: https://github.com/riscv-collab/riscv-gnu-toolchain. Following configuration should be used: ./configure --prefix=/your/install/dir --with-arch=rv32imcb --with-abi=ilp32 --enable-multilib and then make the toolchain.
  2. Additionally the toolchain from lowrisc: lowrisc-toolchain-rv32imcb-20230811-1 needs to be downloaded from https://github.com/lowRISC/lowrisc-toolchains/releases/tag/20230811-1.

TODO: only one toolchain should be needed to suffice for the headers and newlib-nano. Need to remove redundancy and check if everything builds fine.

These toolchains have to linked in the Makefile. In the current repository: lowrisc-riscv32 represents the lowrisc-toolchain-rv32imcb-20230811-1 toolchain and riscv-gnu-toolchain represents the generic GNU toolchain.

TODO: add environmental variables to point to toolchain or add the toolchain to the PATH environmental variable (issues with this approach)

This project will yeild a binary for APMU with make all which can be split into two binaries for .text and .data sections with make generate-bin-files. All the binaries are put in build folder. To clean the build use make clean. A disassembly is generated by default with make all present in the build folder.

The linker script needs to be changed to match the hardware description for the APMU. The ISPM start address is intentionally made the actual start address - 4 bytes to fix an issue with PC of the APMU core. The memory regions as well as stack sizes can be changed within the linker script.