Giter Club home page Giter Club logo

leterminal's Introduction

Logo

L.E. Terminal (let for short) is a little UNIX-inspired terminal for the Numworks Calculator.

Screenshot

Features

Bare bones multi-user system

Each user have an username, a UID (universal id), and an execution level (low to root)

Let introduces four default user accounts, each assigned to a specific execution level :

  • root is, obviously, the root user : it have the highest execution level (well, named root)
  • boat, who takes the lowest execution level (low)
  • cacahuete, who takes the normal execution level (normal)
  • coconut, who takes the high (right below root) execution level.

Users can also be added dynamically using the useradd command.

Filesystem

The standard UNIX filesystem commands that are implemented currently interfaces with a virtual file system (VFS). The Numworks' Ion Storage is mounted by default in /ram/

A text editor is actually in development, called kilo (inspired from nano)

Commands

Here are the implemented commands :

  • uname : same command as UNIX : displays kernel info such as Epsilon's version, etc...

  • echo : print the passed arguments to the screen

  • clear : clear the terminal

  • history : displays the commands history

  • whoami: displays the current user name

  • ion : interfaces with Ion (Numworks low level library)

    Arguments :

    • -s : put the calculator in sleep mode (like the power button)
    • -D : enter DFU mode (needs root privileges)
    • -S : shutdown the calculator
    • -r : reboot the calculator (not working for the moment)
    • -b : shows the battery level as a nice bar
    • -u : shows USB infos
  • rm, touch, cp, cat : same as UNIX

  • ls : list all files in the Numworks' storage (because of a limitation within Ion, ls needs a file extension to list files, default is set to py)

  • pyscr : creates the default samples Python scripts in Epsilon (i.e. squares.py, etc...)

  • args : displays every arguments on screen, including the command

  • chars : displays every char in the range 0-255 (for debug purposes)

  • poincare : an interactive poincare shell (for calculation) (Warning : it crashes if you throw it letters in input)

  • su : means here switch user, who switches to root if no arguments passed, or the user who is passed in arguments (user name)

  • useradd : add an user to the user repository

  • users : list available users, use -d as argument for detailed output

  • chmod : modify the access flags of a file, only support execute flag (+x/-x) for now

  • daemon : list the currently running daemons

Building instructions

Note : let does not support the simulator

As a "subfirmware"

If you want to use let as a "subfirmware" (kind of a firmware in a firmware), follow these steps :

  • Clone the source of the firmware you want to use (ex: Epsilon) (for Omega, see Sidenote for Omega further down)
# Example
$ git clone https://github.com/numworks/epsilon
$ cd epsilon
  • Clone this repository in the apps/terminal folder of the firmware source (the terminal folder needs to be created, of course)
$ git clone https://github.com/CacahueteSansSel/leterminal apps/terminal
#                                                          ^~~~~~~~~~~~~
#                                                          Important!
  • Add the following line to the makefile apps/Makefile at the top :
include apps/terminal/Makefile
  • Go to the main.cpp file and add this line to the top :
#include "terminal/startup.h"
  • In the same file, call the terminal's main function right below Poincare::Init(); :
void ion_main(int argc, const char * const argv[]) {
  // Initialize Poincare::TreePool::sharedPool
  Poincare::Init();

  terminal_startup_check(argc, argv);

And done ! You will be able to launch the terminal at startup when pressing the HOME key !

Sidenote for including L.E. Terminal in Omega

To avoid errors such as cannot move location counter backwards (issue #3), you will probably need to do an additional step for Omega :

  • Decreasing the Python heap size (in apps/code/app.h) in order to give some room to let. 80000 is the recommended value, but you can try to go higher.

At this line :

static constexpr int k_pythonHeapSize = 100000;

Replace 100000 to a lower value, example :

static constexpr int k_pythonHeapSize = 80000;

leterminal's People

Contributors

artichowo avatar cacahuetesanssel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

artichowo

leterminal's Issues

Crash with LeT

Hi,
I'm having troubles with LET, every time I enter a command the calculator just resets itself, I believe that it's due to a parser error but i(m not sure. I'm going to search in the code but i'm not sure that i will be able to find the issue.
Thanks by advance,
Bzyli

undefined reference to `Code::ScriptTemplate::[ScriptName]()' (Epsilon 15)

Tried with Epsilon 15.3.1 (to avoid Omega-related errors), but I have this error :

/usr/local/Cellar/arm-none-eabi-gcc/9-2019q4-update/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /var/folders/w2/sy9f6ygx2935d8xnqqgj5pt80000gn/T//epsilon.elf.8MWz63.ltrans0.ltrans.o: in function `terminal_main(int, char const* const*) [clone .constprop.0]':
/Users/leo/Downloads/EpsilonTerm/apps/terminal/commands/commands.h:300: undefined reference to `Code::ScriptTemplate::Squares()'
/usr/local/Cellar/arm-none-eabi-gcc/9-2019q4-update/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /Users/leo/Downloads/EpsilonTerm/apps/terminal/commands/commands.h:301: undefined reference to `Code::ScriptTemplate::Parabola()'
/usr/local/Cellar/arm-none-eabi-gcc/9-2019q4-update/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /Users/leo/Downloads/EpsilonTerm/apps/terminal/commands/commands.h:302: undefined reference to `Code::ScriptTemplate::Mandelbrot()'
/usr/local/Cellar/arm-none-eabi-gcc/9-2019q4-update/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /Users/leo/Downloads/EpsilonTerm/apps/terminal/commands/commands.h:303: undefined reference to `Code::ScriptTemplate::Polynomial()'
collect2: error: ld returned 1 exit status
make: *** [output/release/device/n0110/epsilon.elf] Error 1

error: 'class Ion::Events::Event' has no member named 'id'

I have this error when compiling with make binpack -j8 with Omega on the omega-dev branch :

apps/terminal/external/extapp_api.cpp: In function 'int extapp_getKey(bool, bool*)':
apps/terminal/external/extapp_api.cpp:300:19: error: 'class Ion::Events::Event' has no member named 'id'; did you mean 'uint8_t Ion::Events::Event::m_id'? (not accessible from this context)
  300 |       key = event.id();
      |                   ^~
In file included from ion/include/ion.h:9,
                 from apps/terminal/external/extapp_api.cpp:1:
ion/include/ion/events.h:41:11: note: declared private here
   41 |   uint8_t m_id;
      |           ^~~~

When changing event.id() to event.m_id(), I have this error :

apps/terminal/external/extapp_api.cpp: In function 'int extapp_getKey(bool, bool*)':
apps/terminal/external/extapp_api.cpp:300:19: error: 'uint8_t Ion::Events::Event::m_id' is private within this context
  300 |       key = event.m_id();
      |                   ^~~~
In file included from ion/include/ion.h:9,
                 from apps/terminal/external/extapp_api.cpp:1:
ion/include/ion/events.h:41:11: note: declared private here
   41 |   uint8_t m_id;
      |           ^~~~
apps/terminal/external/extapp_api.cpp:300:24: error: expression cannot be used as a function
  300 |       key = event.m_id();
      |                        ^

What should I do ?

Building errors [bug]

Your project seems awesome, but I can't build it (I tried with let in the apps folder, but there's a lot of .h missing and other errors), so if you could put some building instructions (I saw a todo in the readme, but nobody can test it without these)
I'd love to contribute, so thanks in advance ^^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.