{"id":18163756,"url":"https://github.com/chuckb/haikuvm","last_synced_at":"2025-05-08T20:38:24.904Z","repository":{"id":58569274,"uuid":"163991931","full_name":"chuckb/haikuVM","owner":"chuckb","description":"A small JAVA VM for microcontrollers","archived":false,"fork":false,"pushed_at":"2020-05-11T20:26:02.000Z","size":45530,"stargazers_count":31,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T18:03:45.900Z","etag":null,"topics":["arduino","arm","avr","bare-metal","gradle","java","jvm","raspberry-pi"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chuckb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-03T15:43:32.000Z","updated_at":"2025-03-17T16:03:00.000Z","dependencies_parsed_at":"2022-09-07T10:20:44.613Z","dependency_job_id":null,"html_url":"https://github.com/chuckb/haikuVM","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuckb%2FhaikuVM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuckb%2FhaikuVM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuckb%2FhaikuVM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuckb%2FhaikuVM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chuckb","download_url":"https://codeload.github.com/chuckb/haikuVM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253146877,"owners_count":21861484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","arm","avr","bare-metal","gradle","java","jvm","raspberry-pi"],"created_at":"2024-11-02T11:06:05.787Z","updated_at":"2025-05-08T20:38:24.869Z","avatar_url":"https://github.com/chuckb.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to haikuVM\n\nThis is a small Java Virtual Machine targeting Arduino compatible microcontrollers. It is based on work from Genom Bob and was pulled from [the haikuVM Sourceforge project](http://haiku-vm.sourceforge.net/). The base version pulled was 1.4.3.\n\n## Bare Metal Java on Raspberry Pi\n\nWhile, at the time of this writing, the HaikuVM project only supported the VM on the Raspberry Pi running Linux, I have added the capability to run the Haiku Java VM bare metal (no operating system). This has been tested on the Pi Zero, Pi 2B, Pi 3A+, Pi 3B.\n\nYou can view a [sample exerciser application for the Pi](examples/src/main/java/rpi/tutorial/PiExerciser.java).\n\nTo run this example:\n\n- Clone this repo:\n```bash\ngit clone https://github.com/chuckb/haikuVM.git\n```\n- Install Java 8 or better\n```bash\nsudo apt-get install openjdk-8-jdk\n```\n- Install [ARM cross compiler](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)\n- Connect USB serial cable to Pi GPIO 14/15. You need to know the port assigned by your host OS. For Mac, my Adafruit serial dongle was assigned to ```/dev/tty.SLAB_USBtoUART```.\n- Clone the bootloader repo:\n```bash\ngit clone https://github.com/chuckb/raspbootin.git\n```\n- Build a bootloader for your Pi:\n```bash\ncd raspbootin/raspbootin2\nmake (rpi | rpi2 | rpi3)\n```\n- Get an SD card, remove all files, copy just built ```kernel.img``` to root of SD card.\n- Copy the following [Raspberry Pi firmware files](https://github.com/raspberrypi/firmware/tree/master/boot) to the root of your SD card:\n  - ```bootcode.bin```\n  - ```fixup.dat```\n  - ```start.elf```\n- Create a ```config.txt``` on the SD card with the following in it:\n```\nstart_file=start.elf\nfixup_file=fixup.dat\nkernel_address=0x02000000\n```\n- Insert SD card into Pi, and power up the Pi.\n- Outside of haikuVM directory, make another project directory:\n```bash\nmkdir myproject\ncd myproject\n```\n- Build and deploy (assume a Pi 3A+, a serial port of ```/dev/tty.SLAB_USBtoUART```, and the location of the haikuVM directory is ```/Users/chuck_benedict/haikuVM```):\n```bash\n/Users/chuck_benedict/haikuVM/bin/haiku -v --Config rpi3apbp --Config:Port /dev/tty.SLAB_USBtoUART /Users/chuck_benedict/haikuVM/examples/src/main/java/rpi/tutorial/PiExerciser.java\n```\n\nAt the end of the build process, the app should run, you should note the ACT LED on the Pi flashing, and on the console: \n```\nJRaspBootCom Raspberry Pi Boot Loader Version 1.0\nhttp://github.com/chuckb/raspbootin\nCopyright (c) 2020, Chuck Benedict\n### Listening on /dev/tty.SLAB_USBtoUART\n\nRaspbootin V2\n#############\nBuilt for: Raspberry Pi 3\n#############\n### sending kernel PiExerciser.img [37216 byte]\n### finished sending\nboot...\nBare Metal Java on Raspberry Pi Exercise Program.\nBoard Model: 0\nBoard Revision: 9445600\nFirmware Version: 1588356021\nSerial Number: 76458c3200000000\nMac Address: b8:27:eb:45:8c:32\nMax ARM Clock Rate: 1400000000Hz\nTick: 7444\nTick: 7545\nTick: 7646\nTick: 7747\nTick: 7848\nTick: 7949\nTick: 8050\nTick: 8151\nTick: 8252\nTick: 8353\nTick: 8454\n```\n\n## WIP\n\nI have added this project to github because the original project is located in a subversion repo, and that makes it harder to collaborate (for me anyway). Second, I am slowly adding gradle build capabilities to each of the sub-projects. Finally, my eventual goal is to make this work on the Teensyduino (done), Raspberry Pi bare metal (almost done...Pi 4 support pending) and the Cross The Road Electronics Hero board (pending).\n\nSubproject builds are now working for most projects, however haikufier tests are not yet working from gradle. Use ```gradlew build -x :haikufier:test``` to exclude.\n\nA [gradle plugin](https://github.com/chuckb/HaikuVMPlugin) to automate downloading the HaikuVM build system, compiling Java classes using the gradle Java plugin (so that IDEs will work nicely), running the haikulink tools, running the cross compiler, and then running a boot loader to upload your kernel to the target, is done, but needs a bit more TLC. It also automates building a bootable SD card image for the Raspberry Pi with a serial bootloader.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuckb%2Fhaikuvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchuckb%2Fhaikuvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuckb%2Fhaikuvm/lists"}