riscemu/libc
2023-05-29 11:48:09 +01:00
..
crt0.s runtime: move start of libc into separate folder 2023-05-29 11:48:09 +01:00
README.md runtime: move start of libc into separate folder 2023-05-29 11:48:09 +01:00
stdlib.s runtime: move start of libc into separate folder 2023-05-29 11:48:09 +01:00
string.s runtime: move start of libc into separate folder 2023-05-29 11:48:09 +01:00

RiscEmu LibC

This is a very basic implementation of libc in risc-v assembly, meant specifically for the riscemu emulator.

This is currently very incomplete, only a handful of methods are implemented, and most of them pretty basic.

Contents:

stdlib.s

Basic implementations of:

  • malloc/free (that leaks memory)
  • rand/srand (using xorshift)
  • exit/atexit (supporting up to 8 exit handlers)

string.s

Somewhat nice implementations of:

  • strlen
  • strncpy
  • strcpy
  • memchr
  • memset (very basic byte-by-byte copy)

Correctness:

This library is 100% untested. Feel free to report bugs using github issues. I'm sure ther are many. We are working on testing!