A C standard library for sh3eb-elf.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Memallox b27b8de827 Add _console_read() implementation which is called by the read syscall (does not work yet!) pirms 1 gada
config Sync with upstream gcc. pirms 3 gadiem
etc Remove spurious empty line in changelog entry. pirms 3 gadiem
include Sync with upstream gcc. pirms 3 gadiem
libgloss [Aarch64] Syscalls: fix prototypes pirms 1 gada
newlib Add _console_read() implementation which is called by the read syscall (does not work yet!) pirms 1 gada
texinfo * texinfo/texinfo.tex: Update to version 2009-03-28.05. pirms 10 gadiem
winsup Move common <sys/dirent.h> content to <dirent.h> pirms 1 gada
.drone.yml Continuous Integration: Add Tea CI build configuration. pirms 3 gadiem
.gitattributes Add .gitattributes pirms 4 gadiem
.gitignore Add IDE-specific paths to .gitignore pirms 1 gada
COPYING 2005-07-14 Kelley Cook <kcook@gcc.gnu.org> pirms 14 gadiem
COPYING.LIB Sync toplevel with upstream GCC. pirms 3 gadiem
COPYING.LIBGLOSS Add Synopsys license for newlib and libgloss pirms 4 gadiem
COPYING.NEWLIB Update Arm entry in COPYING.NEWLIB. pirms 1 gada
COPYING3 * COPYING3: New file. Contains version 3 of the GNU General Public License. pirms 12 gadiem
COPYING3.LIB * COPYING3: New file. Contains version 3 of the GNU General Public License. pirms 12 gadiem
ChangeLog Sync with upstream gcc. pirms 3 gadiem
MAINTAINERS MAINTAINERS: clarify policy with config/ (and other top level files) pirms 7 gadiem
Makefile.def Sync with upstream gcc. pirms 3 gadiem
Makefile.in Introduce @unless/@endunless and postbootstrap Makefile targets pirms 1 gada
Makefile.tpl Introduce @unless/@endunless and postbootstrap Makefile targets pirms 1 gada
README 19990502 sourceware import pirms 20 gadiem
README-maintainer-mode Cleanups after the update to Autoconf 2.64, Automake 1.11. pirms 10 gadiem
README.md Add README.md pirms 1 gada
compile Sync toplevel with upstream GCC. pirms 3 gadiem
config-ml.in Sync toplevel with upstream GCC. pirms 3 gadiem
config.guess Update config.guess and config.sub pirms 1 gada
config.rpath Remove freebsd1 from libtool.m4 macros and config.rpath. pirms 8 gadiem
config.sub Update config.guess and config.sub pirms 1 gada
configure Introduce @unless/@endunless and postbootstrap Makefile targets pirms 1 gada
configure.ac Introduce @unless/@endunless and postbootstrap Makefile targets pirms 1 gada
depcomp Sync toplevel with upstream GCC. pirms 3 gadiem
djunpack.bat * djunpack.bat: Use ".." quoting in Sed command, for the sake of pirms 10 gadiem
install-sh Sync toplevel with upstream GCC. pirms 3 gadiem
libtool.m4 Sync toplevel with upstream GCC. pirms 3 gadiem
ltgcc.m4 * libtool.m4: Update to libtool 2.2.6. pirms 11 gadiem
ltmain.sh PR target/59788 pirms 5 gadiem
ltoptions.m4 Sync Libtool from GCC. pirms 10 gadiem
ltsugar.m4 * libtool.m4: Update to libtool 2.2.6. pirms 11 gadiem
ltversion.m4 Sync Libtool from GCC. pirms 10 gadiem
lt~obsolete.m4 Sync Libtool from GCC. pirms 10 gadiem
makefile.vms 19990502 sourceware import pirms 20 gadiem
missing Sync toplevel with upstream GCC. pirms 3 gadiem
mkdep * mkdep: New file. pirms 20 gadiem
mkinstalldirs Sync toplevel with upstream GCC. pirms 3 gadiem
move-if-change Sync toplevel with upstream GCC. pirms 3 gadiem
setup.com 2009-09-01 Tristan Gingold <gingold@adacore.com> pirms 10 gadiem
src-release * src-release (do-proto-toplevel): Support subdir-path-prefixed pirms 6 gadiem
symlink-tree 2005-07-14 Kelley Cook <kcook@gcc.gnu.org> pirms 14 gadiem
ylwrap Sync toplevel with upstream GCC. pirms 3 gadiem

README.md

Newlib - a C Standard Library for Casio Calulators

Motivation

Until now there was no complete C standard library (aka libc) available for the Casio calculators. Although some parts of this library have been provided by fxlib and gint, there was no libc implementation complying with the standard and compatible with the sh3eb architecture ready to use.

To change that, I decided to port newlib to the Casio CPU. Newlib is an alternative libc implementation intended for use on embedded systems.

Alpha

Follow this link and click the download button in the top right corner:

v1.1

Installation

For a complete tutorial on how to setup a toolchain for Casio calculators, see Compiler sous Linux avec GCC.

To build newlib, you first need binutils and gcc for the target sh3eb-elf. Make sure to configure gcc with the arguments --with-newlib --without-headers.

Now you can install newlib. Simply call configure and make:

../newlib-cygwin/configure --target=sh3eb-elf --prefix=...
make
make install

Afterwards, you have to build gcc again with the argument --with-newlib.

For a more detailes tutorial about how to setup newlib in general, see this more detailed turorial.

Features for Casio fx9860g calculators:

  • C standard library libc
    • printf implementation to print text to the display
    • Dynamic allocation of memory using malloc and free
    • Memory manipulation using memcpy, memcmp, memset etc.
    • String manipulation using strcpy, strcmp, strstr, strtok
  • Math library libm
    • Floating point arithmetics
  • Automatic library and include path recognition after installation
  • Basic Casio features:
    • implementation of GetKey, Bdisp_AllClr_DDVRAM, Bdisp_PutDisp_DD, Print and locate without fxlib (but you can use it if you want)

Further information

Upstream Repository

Newlib provides releases in their ftp directory and their code on their git repository. I try to rebase my fork regulary to their master branch to keep it up-to-date.

The target sh3eb-elf

There is a great explanation on the naming convention of targets. To really understand what sh3eb-elf means, I’ll boil it down for you:

To compile code for our Casio calulator, we need to tell newlib where we want to run the code. In our case, the target’s name is sh3eb-elf.

sh is here short for the SuperH processor architecture. (Fortunately, newlib supports SuperH the by default.)

To be more specific, sh3 is a 32-bit CPU architecture of the SuperH family. Furthermore, eb stands for the big endian format (that indicates the byte order used for multi-byte variables). Usually a target also indicates a vendor which in this case is unknown. Lastly, the end of the target’s name is elf (which is usually the kernel). Here, we have no kernel (and hence no operating system) at all.

For newlib, the target sh3eb had to be specifically added.