Skip to content

Development.en

yuuki410 edited this page Jan 10, 2023 · 3 revisions

Developer Guide

Before we start, please clone this git repo first:

git clone https://github.com/ExistOS-Team/ExistOS-For-HP39GII.git --recursive # https
git clone [email protected]:ExistOS-Team/ExistOS-For-HP39GII.git --recursive # ssh

Please also init all the git submodule.

Then enter the directory:

cd ExistOS-For-HP39GII

Unless otherwise specified, the following steps assume that you are already in the root directory of this project by default.

Notes

The main environments used by the developers of this project are:

  • Windows 10
    • Windows 11
  • Debian
    • Ubuntu
  • Arch Linux
    • Manjaro
  • NixOS

The following environments are not supported:

  • Windows 8.1
    • Windows Vista and earlier
  • CentOS
  • Apline

Prerequisites

You need to add 99-hp39gii.rules to /etc/udev/rules.d/:

System Installation
Windows This step is not required
Linux (most distributions) sudo cp 99-hp39gii.rules /etc/udev/rules.d/
Then restart udev to load the rules:
sudo service udev restart
If the command above doesn't work:
sudo udevadm control --reload-rules
sudo udevadm trigger

Toolchain

Please compile sbtools first:

System Installation
Windows Precompiled, located in the tools/ directory
Linux cd tools/sbtools/ && make
cp sb_loader ../
cp elftosb ../
cd ../../
cd Libs/src/micropython-master/ports/eoslib/ && make
cd ../../../../../

edb

For Windows, precompiled binaries are provided at tools/edb.exe.

For Linux systems, please execute the following command to compile edb-unix.

cd tools/edb-unix/
mkdir build
cmake -B build
cmake --build build
cp build /edb ../
cd ../../

sys signer

Compile sys_signer:

System Installation
Windows Binary executable in tools/
Linux cd tools/sys_signer/
mkdir build
cmake -B build/
cmake --build build/
cp build/sys_signer ../
cd ../../

Compile ExistOS

Create a new directory to store binary files and caches:

mkdir build
cd build

Execute following commands in the build/ directory to compile ExistOS:

cmake .. # Equivalent to cmake -S .. -B . -G "Unix Makefiles"
          # Use -G Niinja to specify Ninja instead of Make
make

Install ExistOS

Please execute the following commands in the build/ directory.

First time installation

Tips:
You can skip this step if the OSLoader has been installed on your device, unless it's broken down :-( OSLoader is a bootloader that loads ExistOS and provides low-level API and virtual memory related functions,

When installing ExistOS for the first time, you need to load OSLoader into the calculator RAM first:

# Before flashing, power off your calculator completely by removing the batteries, and then plug in USB cable while holding down the `ON/C` key. Then your calculator will enter the flashing mode.
# Under the Windows system, an HID device named "USB Input Device" with the ID of 066F:3770 will show up in the Device Manager under Windows.
make flash

Do not disconnect your calculator, continue with the following steps.

Install via edb

make edb_flash_loader # this will write the OSLoader to the calculator's flash memory and the calculator will reboot
make edb_flash_sys # This will write the ExistOS ontology to the calculator's flash, and the calculator will reboot

Debug ExistOS by using emulator

Experience ExistOS first with ExistOS Emulator for Windows.

Emulator download link: https://github.com/ExistOS-Team/ExistOS-Emulator/releases/tag/Latest

File transfer

After system finishes booting, drag & drop files onto the emulator window to transfer them.

Updating system

Replace ExistOS.sys directly.