{"id":20120904,"url":"https://github.com/nthnn/rishka","last_synced_at":"2026-05-06T13:12:44.852Z","repository":{"id":222503541,"uuid":"757452021","full_name":"nthnn/rishka","owner":"nthnn","description":"RISC-V core virtual runtime written in C/C++ (Arduino platform) intended for ESP32-WROVER with PSRAM.","archived":false,"fork":false,"pushed_at":"2024-04-15T09:11:10.000Z","size":39325,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-17T07:47:47.069Z","etag":null,"topics":["arduino","arduino-platform","arduino-platformio","arduino-project","esp32","esp32-arduino","kernel","kernel-development","kernel-source","operating-system","operating-system-kernel","os-dev","os-development","risc-v","risc-v-emulator","risc-v-simulator"],"latest_commit_sha":null,"homepage":"https://rishka.vercel.app","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nthnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/install_rishka_cc.sh","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"nthnn","custom":"https://www.buymeacoffee.com/nthnn"}},"created_at":"2024-02-14T14:24:00.000Z","updated_at":"2024-05-13T08:38:55.083Z","dependencies_parsed_at":"2024-03-02T11:26:07.985Z","dependency_job_id":"9f47b529-c9a7-453b-8681-9d54009dfb48","html_url":"https://github.com/nthnn/rishka","commit_stats":null,"previous_names":["nthnn/rishka"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nthnn/rishka","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthnn%2Frishka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthnn%2Frishka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthnn%2Frishka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthnn%2Frishka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nthnn","download_url":"https://codeload.github.com/nthnn/rishka/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nthnn%2Frishka/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32694982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","arduino-platform","arduino-platformio","arduino-project","esp32","esp32-arduino","kernel","kernel-development","kernel-source","operating-system","operating-system-kernel","os-dev","os-development","risc-v","risc-v-emulator","risc-v-simulator"],"created_at":"2024-11-13T19:23:50.382Z","updated_at":"2026-05-06T13:12:44.816Z","avatar_url":"https://github.com/nthnn.png","language":"C++","funding_links":["https://github.com/sponsors/nthnn","https://www.buymeacoffee.com/nthnn"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/rishka-logo.png\" width=\"140\" /\u003e\n    \u003ch1 align=\"center\"\u003eRishka\u003c/h1\u003e\n\u003c/p\u003e\n\n![Arduino CI](https://github.com/nthnn/rishka/actions/workflows/arduino_ci.yml/badge.svg) ![Arduino Lint](https://github.com/nthnn/rishka/actions/workflows/arduino_lint.yml/badge.svg) ![Rust Build CI](https://github.com/nthnn/rishka/actions/workflows/rust_ci.yml/badge.svg) ![SDK Build CI](https://github.com/nthnn/rishka/actions/workflows/sdk_ci.yml/badge.svg) ![GitHub repo size](https://img.shields.io/github/repo-size/nthnn/rishka?logo=git\u0026label=Repository%20Size)\n\nRishka is a RISC-V virtual runtime in C/C++ made for ESP32-WROVER with PSRAM specifically developed as kernel for [Jessy OS](https://github.com/nthnn/Jessy-OS).\n\n\u003e [!NOTE]\n\u003e Work in progress.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/rishka-ili9341.gif\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003ci\u003eRishka running shell example with an ILI9341 TFT LCD and FabGL.\u003c/i\u003e\u003c/p\u003e\n\n## How Does It Work?\n\nThe Rishka virtual runtime is a system designed to run special RISC-V binaries smoothly on ESP32-WROVER microcontroller units. Under the hood, the virtual machine serves as the main engine, while the kernel acts as its core component. The kernel handles system calls efficiently, providing a range of interfaces for accessing different system features and services.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/rishka-flow.png\" width=\"65%\" /\u003e\n    \u003cbr/\u003e\n    \u003ci\u003eSimple comparison of Rishka-based OS and Linux-based OS (with an Ubuntu logo, lol).\u003c/i\u003e\n\u003c/p\u003e\n\nThese include basic functions like managing files, as well as more complex tasks like controlling GPIO pins, attaching and detaching interrupts, and communication protocols such as I2C and SPI. Additionally, the kernel manages system utilities specific to the Jessy OS, handling tasks like sub-process runtime and memory allocation.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/board_test.jpg\" width=\"45%\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003ci\u003eNodeMCU ESP32-WROVER and microSD card adapter where Rishka is being developed.\u003c/i\u003e\u003c/p\u003e\n\n## Installation\n\n### Rishka VM\n\nRishka VM is a lightweight and efficient virtual runtime environment designed for RISC-V binaries on ESP32-WROVER microcontrollers. Follow these steps to integrate Rishka into your Arduino projects:\n\n1. Clone Rishka to your Arduino libraries, by typing the command below:\n\n```bash\ncd ~/Arduino/libraries\ngit clone --depth 1 https://github.com/nthnn/rishka.git\n```\n\n2. Open your Arduino IDE, then navigate to `File \u003e Examples \u003e rishka` and select an example suitable for your project.\n\n3. You're all set! Integrate Rishka into your project and start leveraging its capabilities.\n\n### Compiling Examples\n\n#### Using `rishka-cc` tool\n\nTo use `rishka-cc`, you can get it from the release page if available or compile it yourself by typing the following on your terminal. Just make sure you have installed Rust compiler and Cargo package manager on your system.\n\n```bash\ncargo build --release\n```\n\nAlternatively, you can install the `rishka-cc` tool by typing the following below on your system terminal:\n\n```bash\nsh -c \"$(curl -fsSL https://raw.githubusercontent.com/nthnn/rishka/main/support/install_rishka_cc.sh)\"\n```\n\nBefore using `rishka-cc`, you must configure two (2) environment variables, as shown below.\n\n```bash\nexport RISHKA_LIBPATH=\u003cpath to sdk library folder\u003e\nexport RISHKA_SCRIPTS=\u003cpath to scripts folder\u003e\n```\n\nThe `RISHKA_LIBPATH` must be a folder where the `librishka.h` header file is located, while the `RISHKA_SCRIPTS` should be a folder where both `launch.s` and the `link.ld` files are located. For example, assuming Rishka was moved to the libraries folder on Arduino IDE:\n\n```bash\nexport RISHKA_LIBPATH=/Arduino/libraries/rishka/sdk\nexport RISHKA_SCRIPTS=/Arduino/libraries/rishka/scripts\n```\n\nIf no problems occured and was configured as instructed, you can now seamlessly use the `rishka-cc`.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/rishka-cc.png\" width=\"90%\" /\u003e\n\u003c/p\u003e\n\n#### Manually Compiling\n\nTo compile SDK examples provided with Rishka, follow these steps:\n\n1. If you haven't already, install Qrepo by following the instructions available [here](https://github.com/nthnn/Qrepo).\n\n2. Ensure you have the RISC-V64 GCC toolchain installed by running:\n\n```bash\nsudo apt install gcc-riscv64-unknown-elf\n```\n\n3. Open a terminal and navigate to the directory where you cloned the Rishka repository.\n\n4. Use Qrepo to compile the examples by executing the following command:\n\n```bash\nqrepo run compile \u003csource-file\u003e \u003coutput-name\u003e\n```\n\nReplace `\u003csource-file\u003e` with the path to the source file of the example you want to compile and `\u003coutput-name\u003e` with the desired name for the output binary.\n\nExamples:\n\n```bash\nqrepo run compile examples/sdk/hello.cpp hello\n# This will output the binary file to dist/hello.bin\n```\n\nNow you have successfully compiled the example and can proceed with using the generated binary file.\n\n## Dumping Raw Binaries\n\nDumping raw binary files can be helpful in debugging programs, traditionally. Hence, a simple script in Qrepo is available to dump instructions from a raw binary file of Rishka. You can utilize it by typing the following:\n\n```bash\nqrepo run dump \u003cfilename\u003e\n```\n\n## Example\n\nThis example demonstrates the usage of Rishka virtual machine on an ESP32-WROVER microcontroller. It initializes serial communication and SD card, waits for user input via serial port, loads the specified file into the Rishka VM, executes it, and then waits for the next input.\n\n```cpp\n#include \u003cfabgl.h\u003e\n#include \u003crishka.h\u003e\n#include \u003cSD.h\u003e\n#include \u003cSPI.h\u003e\n\n#define TFT_CS     5            // TFT SPI select pin\n#define TFT_SCK    18           // TFT SPI clock pin\n#define TFT_MOSI   23           // TFT SPI MOSI pin\n#define TFT_DC     15           // TFT data/command pin\n#define TFT_RESET  4            // TFT reset pin\n#define TFT_SPIBUS VSPI_HOST    // TFT SPI bus\n\n#define SD_CS      2            // SD card chip select pin\n#define SD_SCK     14           // SD card SPI clock pin\n#define SD_MOSI    13           // SD card SPI MOSI pin\n#define SD_MISO    12           // SD card SPI MISO pin\n\n// TFT display controller and Terminal instance\nfabgl::ILI9341Controller DisplayController;\nfabgl::Terminal Terminal;\n\n// SPI instance for SD card\nSPIClass sdSpi(HSPI);\n\nvoid setup() {\n    // Initialize TFT display\n    DisplayController.begin(TFT_SCK, TFT_MOSI, TFT_DC, TFT_RESET, TFT_CS, TFT_SPIBUS);\n    DisplayController.setResolution(\"\\\"TFT_320x240\\\" 320 240\");\n\n    // Initialize terminal\n    Terminal.begin(\u0026DisplayController);\n    Terminal.loadFont(\u0026fabgl::FONT_8x14);\n    Terminal.enableCursor(true);\n\n    // Initialize SD card\n    sdSpi.begin(SD_SCK, SD_MISO, SD_MOSI, SD_CS);\n    if(!SD.begin(SD_CS, sdSpi, 80000000)) {\n        Terminal.println(\"Card \\e[94mMount\\e[97m Failed\");\n        return;\n    }\n\n    // Rishka virtual machine instance\n    RishkaVM* vm = new RishkaVM();\n    // Initialize Rishka VM\n    vm-\u003einitialize(\u0026Terminal);\n\n    if(!vm-\u003eloadFile(\"/sysinfo.bin\"))\n        vm-\u003epanic(\"Failed to \\e[94mload\\e[97m specified file.\");\n\n    // Run loaded program\n    vm-\u003erun(0, NULL);\n    // Reset VM after program execution\n    vm-\u003ereset();\n}\n\nvoid loop() {\n    // Delay to prevent continuous execution\n    vTaskDelay(10);\n}\n```\n\n## Contributing\n\nContributions to Rishka are highly encouraged and appreciated! To contribute new features, bug fixes, or enhancements, please adhere to the following guidelines:\n\n1. Fork the Rishka repository.\n2. Create a new branch for your changes: `git checkout -b feature-name`.\n3. Implement your changes and commit them: `git commit -m \"Added new feature\"`.\n4. Push your changes to the branch: `git push origin feature-name`.\n5. Submit a pull request for review and inclusion.\n\n## License\n\nRishka is distributed under the GNU General Public License v3.0. For further details, refer to the [LICENSE](LICENSE) file.\n\n```\nThis program is free software: you can redistribute it and/or modify  \nit under the terms of the GNU General Public License as published by  \nthe Free Software Foundation, version 3.\n\nThis program is distributed in the hope that it will be useful, but \nWITHOUT ANY WARRANTY; without even the implied warranty of \nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU \nGeneral Public License for more details.\n\nYou should have received a copy of the GNU General Public License \nalong with this program. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnthnn%2Frishka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnthnn%2Frishka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnthnn%2Frishka/lists"}