Skip to content

Added libc functionalities#26

Open
scratch-er wants to merge 4 commits into
openecos-projects:mainfrom
scratch-er:libc
Open

Added libc functionalities#26
scratch-er wants to merge 4 commits into
openecos-projects:mainfrom
scratch-er:libc

Conversation

@scratch-er

@scratch-er scratch-er commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

This PR introduces many standard libc functionalities, including:

  • Full ctype support
  • Most stdlib features (excluding malloc and free)
  • Complete printf functionality, except for floating-point formatting
  • putchar and puts

Additionally, it addresses the following issue:

  • memcmp had a signature that did not conform to the standard.

The added libc functions are sourced from Sonnet libc. I also replaced the original printf in the ECOS SDK with the printf from Sonnet libc, which supports all standard format specifiers except floating-point numbers. I am the author of Sonnet libc. By submitting this PR, I license all contributed code under the Apache License, as used by the ECOS SDK.

I planned to include malloc support, but it requires both the start and the end of the heap. Currently, the SDK’s linker script provides only a symbol for the heap’s beginning. We may also want to discuss which allocation algorithm to adopt.

Please note that I am currently unable to test this code using the ECOS SDK build system. I could not build any target with it, as the build system appears to be broken. And I failed to figure out how to use testdir to develop this SDK. Furthermore, I do not have all the boards supported by this SDK. I have, however, tested the code on my own setup and on the Starry Sky C1 board, compiling with Clang under the Sonnet SDK build system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant