Compare commits

...

16 Commits

Author SHA1 Message Date
Memallox 805ba09050 Add documentation for stdio 4 years ago
Memallox 25b53f80eb Add _console_read() implementation which is called by the read syscall (does not work yet!) 4 years ago
Memallox e780de19b4 Pseudo-implement syscalls: lseek, close, fstat, isatty, raise, read 4 years ago
Memallox c9845b3687 Remove legacy syscall definitions and changed syscall signatures 4 years ago
Memallox fc3d7418d9 Add errno information to some not implemented syscalls. See https://sourceware.org/newlib/libc.html#Syscalls 4 years ago
Memallox 481abf21ad Enable newlib_io_c99_format to provide support for the %zu format specifier 4 years ago
Memallox c4024e42ed Disable some newlib features by default to safe space 4 years ago
Memallox c40e651d90 Implement a console which is fed by the _write() syscall (and thus e.g. stdout) and redirect locate() to the console 4 years ago
Memallox c81076ab88 Add stdlib Casio syscall definitions 4 years ago
Memallox f0ae05e7c8 Add basic Casio syscalls (non-stdlib functionality) which are included into stdio.h 4 years ago
Memallox 9e1879908d Add target sh3eb to newlib/configure.host 4 years ago
Memallox 30e5cab3b5 Add floating point definitions for sh3eb in ieeefp.c 4 years ago
Memallox 5b11518570 Update the copied configure.ac files and run autoconf 4 years ago
Memallox ff76b3b326 Copy code from target sh to sh3eb 4 years ago
Memallox b64c66c8b6 Add IDE-specific paths to .gitignore 4 years ago
Memallox 12b246c01c Add README.md 4 years ago
  1. 8
      .gitignore
  2. 64
      README.md
  3. BIN
      doc/casio_charset/mini/0x01.png
  4. BIN
      doc/casio_charset/mini/0x03.png
  5. BIN
      doc/casio_charset/mini/0x07.png
  6. BIN
      doc/casio_charset/mini/0x08.png
  7. BIN
      doc/casio_charset/mini/0x09.png
  8. BIN
      doc/casio_charset/mini/0x0a.png
  9. BIN
      doc/casio_charset/mini/0x0b.png
  10. BIN
      doc/casio_charset/mini/0x0c.png
  11. BIN
      doc/casio_charset/mini/0x0d.png
  12. BIN
      doc/casio_charset/mini/0x0f.png
  13. BIN
      doc/casio_charset/mini/0x10.png
  14. BIN
      doc/casio_charset/mini/0x11.png
  15. BIN
      doc/casio_charset/mini/0x12.png
  16. BIN
      doc/casio_charset/mini/0x13.png
  17. BIN
      doc/casio_charset/mini/0x1a.png
  18. BIN
      doc/casio_charset/mini/0x1b.png
  19. BIN
      doc/casio_charset/mini/0x1c.png
  20. BIN
      doc/casio_charset/mini/0x1d.png
  21. BIN
      doc/casio_charset/mini/0x1e.png
  22. BIN
      doc/casio_charset/mini/0x1f.png
  23. BIN
      doc/casio_charset/mini/0x21.png
  24. BIN
      doc/casio_charset/mini/0x22.png
  25. BIN
      doc/casio_charset/mini/0x23.png
  26. BIN
      doc/casio_charset/mini/0x24.png
  27. BIN
      doc/casio_charset/mini/0x25.png
  28. BIN
      doc/casio_charset/mini/0x26.png
  29. BIN
      doc/casio_charset/mini/0x27.png
  30. BIN
      doc/casio_charset/mini/0x28.png
  31. BIN
      doc/casio_charset/mini/0x29.png
  32. BIN
      doc/casio_charset/mini/0x2a.png
  33. BIN
      doc/casio_charset/mini/0x2b.png
  34. BIN
      doc/casio_charset/mini/0x2c.png
  35. BIN
      doc/casio_charset/mini/0x2d.png
  36. BIN
      doc/casio_charset/mini/0x2e.png
  37. BIN
      doc/casio_charset/mini/0x2f.png
  38. BIN
      doc/casio_charset/mini/0x30.png
  39. BIN
      doc/casio_charset/mini/0x31.png
  40. BIN
      doc/casio_charset/mini/0x32.png
  41. BIN
      doc/casio_charset/mini/0x33.png
  42. BIN
      doc/casio_charset/mini/0x34.png
  43. BIN
      doc/casio_charset/mini/0x35.png
  44. BIN
      doc/casio_charset/mini/0x36.png
  45. BIN
      doc/casio_charset/mini/0x37.png
  46. BIN
      doc/casio_charset/mini/0x38.png
  47. BIN
      doc/casio_charset/mini/0x39.png
  48. BIN
      doc/casio_charset/mini/0x3a.png
  49. BIN
      doc/casio_charset/mini/0x3b.png
  50. BIN
      doc/casio_charset/mini/0x3c.png
  51. BIN
      doc/casio_charset/mini/0x3d.png
  52. BIN
      doc/casio_charset/mini/0x3e.png
  53. BIN
      doc/casio_charset/mini/0x3f.png
  54. BIN
      doc/casio_charset/mini/0x40.png
  55. BIN
      doc/casio_charset/mini/0x41.png
  56. BIN
      doc/casio_charset/mini/0x42.png
  57. BIN
      doc/casio_charset/mini/0x43.png
  58. BIN
      doc/casio_charset/mini/0x44.png
  59. BIN
      doc/casio_charset/mini/0x45.png
  60. BIN
      doc/casio_charset/mini/0x46.png
  61. BIN
      doc/casio_charset/mini/0x47.png
  62. BIN
      doc/casio_charset/mini/0x48.png
  63. BIN
      doc/casio_charset/mini/0x49.png
  64. BIN
      doc/casio_charset/mini/0x4a.png
  65. BIN
      doc/casio_charset/mini/0x4b.png
  66. BIN
      doc/casio_charset/mini/0x4c.png
  67. BIN
      doc/casio_charset/mini/0x4d.png
  68. BIN
      doc/casio_charset/mini/0x4e.png
  69. BIN
      doc/casio_charset/mini/0x4f.png
  70. BIN
      doc/casio_charset/mini/0x50.png
  71. BIN
      doc/casio_charset/mini/0x51.png
  72. BIN
      doc/casio_charset/mini/0x52.png
  73. BIN
      doc/casio_charset/mini/0x53.png
  74. BIN
      doc/casio_charset/mini/0x54.png
  75. BIN
      doc/casio_charset/mini/0x55.png
  76. BIN
      doc/casio_charset/mini/0x56.png
  77. BIN
      doc/casio_charset/mini/0x57.png
  78. BIN
      doc/casio_charset/mini/0x58.png
  79. BIN
      doc/casio_charset/mini/0x59.png
  80. BIN
      doc/casio_charset/mini/0x5a.png
  81. BIN
      doc/casio_charset/mini/0x5b.png
  82. BIN
      doc/casio_charset/mini/0x5c.png
  83. BIN
      doc/casio_charset/mini/0x5d.png
  84. BIN
      doc/casio_charset/mini/0x5e.png
  85. BIN
      doc/casio_charset/mini/0x5f.png
  86. BIN
      doc/casio_charset/mini/0x60.png
  87. BIN
      doc/casio_charset/mini/0x61.png
  88. BIN
      doc/casio_charset/mini/0x62.png
  89. BIN
      doc/casio_charset/mini/0x63.png
  90. BIN
      doc/casio_charset/mini/0x64.png
  91. BIN
      doc/casio_charset/mini/0x65.png
  92. BIN
      doc/casio_charset/mini/0x66.png
  93. BIN
      doc/casio_charset/mini/0x67.png
  94. BIN
      doc/casio_charset/mini/0x68.png
  95. BIN
      doc/casio_charset/mini/0x69.png
  96. BIN
      doc/casio_charset/mini/0x6a.png
  97. BIN
      doc/casio_charset/mini/0x6b.png
  98. BIN
      doc/casio_charset/mini/0x6c.png
  99. BIN
      doc/casio_charset/mini/0x6d.png
  100. BIN
      doc/casio_charset/mini/0x6e.png
  101. Some files were not shown because too many files have changed in this diff Show More

8
.gitignore vendored

@ -17,6 +17,14 @@
*.swp
*.tmp
**/.astyle
**/.vscode
**/.cproject
**/.project
.settings/
/Release/
/Debug/
.deps
.libs

@ -0,0 +1,64 @@
# Newlib - a C Standard Library for Casio Calulators
## Motivation
Until now there was no complete [C standard library]([https://en.wikipedia.org/wiki/C_standard_library]) (aka libc) available for the Casio calculators. Although some parts of this library have been provided by fxlib and [gint](https://git.planet-casio.com/lephe/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](https://sourceware.org/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](https://git.planet-casio.com/Memallox/libc/tags/sh3eb_v1.01)
## Installation
*For a complete tutorial on how to setup a toolchain for Casio calculators, see [Compiler sous Linux avec GCC](https://www.planet-casio.com/Fr/programmation/tutoriels.php?id=61#E7).*
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:
```bash
../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](http://www.ifp.illinois.edu/~nakazato/tips/xgcc.html#newlib).
## 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](ftp://sourceware.org/pub/newlib/index.html) and their code on their [git repository](https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git). 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](https://wiki.gentoo.org/wiki/Embedded_Handbook/Tuples) 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](https://www.renesas.com/us/en/products/microcontrollers-microprocessors/superh.html#) 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](https://en.wikipedia.org/wiki/Endianness) 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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save