All Projects → ghivert → Ocarm

ghivert / Ocarm

Licence: mit
OCaml VM on Nucleo STM32.

Programming Languages

c
50402 projects - #5 most used programming language
ocaml
1615 projects

Labels

Projects that are alternatives of or similar to Ocarm

F9 Kernel
An efficient and secure microkernel built for ARM Cortex-M cores, inspired by L4
Stars: ✭ 596 (+9833.33%)
Mutual labels:  arm
Amacc
Small C Compiler generating ELF executable Arm architecture, supporting JIT execution
Stars: ✭ 661 (+10916.67%)
Mutual labels:  arm
Androidnativeemu
Allows you to partly emulate an Android native library.
Stars: ✭ 717 (+11850%)
Mutual labels:  arm
Retro Board
Retrospective Board
Stars: ✭ 622 (+10266.67%)
Mutual labels:  arm
Sha256 Simd
Accelerate SHA256 computations in pure Go using Accelerate SHA256 computations in pure Go using AVX512, SHA Extensions for x86 and ARM64 for ARM. On AVX512 it provides an up to 8x improvement (over 3 GB/s per core). SHA Extensions give a performance boost of close to 4x over native.
Stars: ✭ 657 (+10850%)
Mutual labels:  arm
Cemu
Cheap EMUlator: lightweight multi-architecture assembly playground
Stars: ✭ 666 (+11000%)
Mutual labels:  arm
Kubernetes On Arm
Kubernetes ported to ARM boards like Raspberry Pi.
Stars: ✭ 572 (+9433.33%)
Mutual labels:  arm
Citra
A Nintendo 3DS Emulator
Stars: ✭ 7,009 (+116716.67%)
Mutual labels:  arm
Rt Thread
RT-Thread is an open source IoT operating system.
Stars: ✭ 6,466 (+107666.67%)
Mutual labels:  arm
Inxi
inxi is a full featured CLI system information tool. It is available in most Linux distribution repositories, and does its best to support the BSDs.
Stars: ✭ 691 (+11416.67%)
Mutual labels:  arm
Cortex M Rtic
Real-Time Interrupt-driven Concurrency (RTIC) framework for ARM Cortex-M microcontrollers
Stars: ✭ 623 (+10283.33%)
Mutual labels:  arm
Mnn
MNN is a blazing fast, lightweight deep learning framework, battle-tested by business-critical use cases in Alibaba
Stars: ✭ 6,284 (+104633.33%)
Mutual labels:  arm
Ultra Light Fast Generic Face Detector 1mb
💎1MB lightweight face detection model (1MB轻量级人脸检测模型)
Stars: ✭ 6,182 (+102933.33%)
Mutual labels:  arm
Aria2 Ariang Docker
The Docker image for Aria2 + AriaNg + File Browser + Rclone
Stars: ✭ 610 (+10066.67%)
Mutual labels:  arm
Arm now
arm_now is a qemu powered tool that allows instant setup of virtual machines on arm cpu, mips, powerpc, nios2, x86 and more, for reverse, exploit, fuzzing and programming purpose.
Stars: ✭ 719 (+11883.33%)
Mutual labels:  arm
Rop Tool
A tool to help you write binary exploits
Stars: ✭ 590 (+9733.33%)
Mutual labels:  arm
Exploit me
Very vulnerable ARM/AARCH64 application (CTF style exploitation tutorial with 14 vulnerability techniques)
Stars: ✭ 665 (+10983.33%)
Mutual labels:  arm
Ml Kws For Mcu
Keyword spotting on Arm Cortex-M Microcontrollers
Stars: ✭ 823 (+13616.67%)
Mutual labels:  arm
Raspberrypipkg
DEPRECATED - DO NOT USE | Go here instead ->
Stars: ✭ 758 (+12533.33%)
Mutual labels:  arm
Freenos
FreeNOS (Free Niek's Operating System) is an experimental microkernel based operating system for learning purposes written in C++. You may use the code as you wish under the terms of the GPLv3.
Stars: ✭ 683 (+11283.33%)
Mutual labels:  arm

OCARM — A functionnal Ocaml VM on Nucleo

Context

OCARM project has been written during an internship at both the INRIA and the UPMC. Using OCaPIC as an inspiration, OCARM is focusing on Nucleo STM32.

Objectives

OCARM project aims to provide the more complete implementation of OCaml on Nucleo STM32. The actual version is working on boards, and allow to run complete OCaml program, without modules which are not available on Nucleos. The modules which are not available are :

  • Unix

Requirements

While Nucleo STM32 uses many commercial IDE working with Windows, we are using the original firmware of the Nucleo and its library (HAL, i.e. High Abstraction Level) with OpenOCD (Open On Chip Debugger) in order to push the code onto the board. The original ARM compiler provided by ARM (ARM GCC) and the Red Hat Newlib are also used to compile the code.

Choices

The VM is working by turning the OCaml code into bytecode, exporting it into the program, packing it with the VM, and pushing it onto the board.

  • The bytecode is exported into the code as an array of bytes.
  • Every data is exactly the same as in the OCaml VM, i.e. 32 bits, with standard OCaml Header. A good solution would be to reduce the size of each data (i.e. on 16 bits) to gain a lot of memory.
  • The Garbage Collector is one of our own, i.e. a simpler GC (stop & copy) in order to maximize performances of the VM. It will probably have to be rewrote in the future.
  • The HAL modules are implemented to manipulate the Nucleo.

How to use

In the state of art, OCARM works, but need to be automated. However, with hand-compiling, everything works. It needs to compile the VM, compile the OCaml sources, and compile the rest to target the Nucleo.

The compiling chain follows :

gcc -c stm32f3xx_hal_ml.c
ocaml -custom stm32.ml stm32f3xx_hal_ml.o my_file.ml *.ml -o my_prog
elf2bc my_prog -o my_prog_bc
ocamlclean my_prog_bc -o my_prog_clean
bin2c my_prog_clean -o bytecode.h
modinc *.ml
make
make program

It is possible to find the different files in the correct folders. This schema is an obligatory passage, for the linker to correctly link the different file into one executable. my_file.ml and *.ml represent the user files written by the user.
elf2bc, modincand bin2care utilities which can be found in the appropriate utils folder. ocamlclean is an utility written during the OCaPIC project to clean the bytecode.
The compiling chain is approximative, because files are dependent each other. However, it is important to compile files in the good order, one after the other.

Interoperability with C

As OCaml allows to use C for certain functions, OCARM can also use C functions provided by the user. It allows the user to use the full potential of the Nucleo with low-level code and use it into his program in OCaml.

We hope that you will find it useful, because both Darius Mercadier and I will not touch the project anymore. For any questions, do not hesitate to send me a mail, I will help you as much as I can.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].