A C standard library for sh3eb-elf.
Go to file
Memallox b27b8de827 Add _console_read() implementation which is called by the read syscall (does not work yet!) 2018-10-13 13:26:48 +02:00
config Sync with upstream gcc. 2016-06-23 15:54:55 -04:00
etc Remove spurious empty line in changelog entry. 2016-03-22 10:29:22 +01:00
include Sync with upstream gcc. 2016-06-23 15:54:55 -04:00
libgloss [Aarch64] Syscalls: fix prototypes 2018-10-08 14:39:16 +01:00
newlib Add _console_read() implementation which is called by the read syscall (does not work yet!) 2018-10-13 13:26:48 +02:00
texinfo * texinfo/texinfo.tex: Update to version 2009-03-28.05. 2009-04-21 12:36:46 +00:00
winsup Move common <sys/dirent.h> content to <dirent.h> 2018-10-11 08:29:16 +02:00
.drone.yml Continuous Integration: Add Tea CI build configuration. 2016-06-28 13:42:59 +02:00
.gitattributes Add .gitattributes 2015-03-09 20:53:11 +01:00
.gitignore Add IDE-specific paths to .gitignore 2018-10-13 13:19:59 +02:00
COPYING 2005-07-14 Kelley Cook <kcook@gcc.gnu.org> 2005-07-14 01:24:56 +00:00
COPYING.LIB Sync toplevel with upstream GCC. 2016-03-22 10:25:20 +01:00
COPYING.LIBGLOSS Add Synopsys license for newlib and libgloss 2015-11-12 14:16:32 +01:00
COPYING.NEWLIB Update Arm entry in COPYING.NEWLIB. 2018-09-25 15:10:46 -04:00
COPYING3 * COPYING3: New file. Contains version 3 of the GNU General Public License. 2007-07-17 13:50:23 +00:00
COPYING3.LIB * COPYING3: New file. Contains version 3 of the GNU General Public License. 2007-07-17 13:50:23 +00:00
ChangeLog Sync with upstream gcc. 2016-06-23 15:54:55 -04:00
MAINTAINERS MAINTAINERS: clarify policy with config/ (and other top level files) 2012-05-12 03:10:17 +00:00
Makefile.def Sync with upstream gcc. 2016-06-23 15:54:55 -04:00
Makefile.in Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 00:12:40 -03:00
Makefile.tpl Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 00:12:40 -03:00
README 19990502 sourceware import 1999-05-03 07:29:06 +00:00
README-maintainer-mode Cleanups after the update to Autoconf 2.64, Automake 1.11. 2009-08-22 17:08:06 +00:00
README.md Add README.md 2018-10-13 13:19:59 +02:00
compile Sync toplevel with upstream GCC. 2016-03-22 10:25:20 +01:00
config-ml.in Sync toplevel with upstream GCC. 2016-03-22 10:25:20 +01:00
config.guess Update config.guess and config.sub 2018-07-06 10:46:43 +02:00
config.rpath Remove freebsd1 from libtool.m4 macros and config.rpath. 2011-02-13 21:00:08 +00:00
config.sub Update config.guess and config.sub 2018-07-06 10:46:43 +02:00
configure Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 00:12:40 -03:00
configure.ac Introduce @unless/@endunless and postbootstrap Makefile targets 2018-06-30 00:12:40 -03:00
depcomp Sync toplevel with upstream GCC. 2016-03-22 10:25:20 +01:00
djunpack.bat * djunpack.bat: Use ".." quoting in Sed command, for the sake of 2009-03-27 13:37:09 +00:00
install-sh Sync toplevel with upstream GCC. 2016-03-22 10:25:20 +01:00
libtool.m4 Sync toplevel with upstream GCC. 2016-03-22 10:25:20 +01:00
ltgcc.m4 * libtool.m4: Update to libtool 2.2.6. 2008-09-29 15:28:14 +00:00
ltmain.sh PR target/59788 2014-02-05 13:17:47 +00:00
ltoptions.m4 Sync Libtool from GCC. 2010-01-09 21:11:32 +00:00
ltsugar.m4 * libtool.m4: Update to libtool 2.2.6. 2008-09-29 15:28:14 +00:00
ltversion.m4 Sync Libtool from GCC. 2010-01-09 21:11:32 +00:00
lt~obsolete.m4 Sync Libtool from GCC. 2010-01-09 21:11:32 +00:00
makefile.vms 19990502 sourceware import 1999-05-03 07:29:06 +00:00
missing Sync toplevel with upstream GCC. 2016-03-22 10:25:20 +01:00
mkdep * mkdep: New file. 1999-08-08 17:46:02 +00:00
mkinstalldirs Sync toplevel with upstream GCC. 2016-03-22 10:25:20 +01:00
move-if-change Sync toplevel with upstream GCC. 2016-03-22 10:25:20 +01:00
setup.com 2009-09-01 Tristan Gingold <gingold@adacore.com> 2009-09-01 13:38:26 +00:00
src-release * src-release (do-proto-toplevel): Support subdir-path-prefixed 2013-10-15 20:45:52 +00:00
symlink-tree 2005-07-14 Kelley Cook <kcook@gcc.gnu.org> 2005-07-14 01:24:56 +00:00
ylwrap Sync toplevel with upstream GCC. 2016-03-22 10:25:20 +01:00

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.