Save 37% off PRO during our Black Friday Sale! »

2021 - RubyKaigi - It is time to build your mruby VM on the microcontroller?

888339de9e7a88688b6acb30d33e66cd?s=47 蒼時弦や
September 14, 2021

2021 - RubyKaigi - It is time to build your mruby VM on the microcontroller?

In 2020, I find a mini-arcade maker product that uses ESP8622 and MicroPython. Since I know the mruby/c can run on the ESP32 but it doesn't support running on the ESP8622. Is it possible to implement our own mruby VM and execute Ruby on any microcontroller we want to use it? This talk will show my progress to run a simple mruby script on the ESP8622 by implementing my own small mruby VM.

888339de9e7a88688b6acb30d33e66cd?s=128

蒼時弦や

September 14, 2021
Tweet

Transcript

  1. It is time to build your mruby VM on the

    microcontroller? Photo by Johannes Plenio from Pexels
  2. THE ENGINEER OF CREATIVE ૵ ࣌ ݭ໵ @elct9620

  3. None
  4. None
  5. Does build a mruby VM is hard Question

  6. Yes, but we can do it easier My Answer

  7. This is my fi rst time trying it, how can

    I start it? Question
  8. mruby-L1VM

  9. A mruby VM running on the Web only ~1000 lines

    mruby-L1VM
  10. Everyone can read it without spending a lot of time

    mruby-L1VM
  11. How does it work? mruby-L1VM

  12. Start Program End Program Read Byte Code Execute Exit? No

    Yes IREP OPCODE
  13. None
  14. How to read the IREP from mrb binary? IREP

  15. None
  16. None
  17. None
  18. example.mrb RITE Header IREP Debug Section

  19. example.mrb RITE Header IREP Debug Section 34 bytes

  20. None
  21. example.mrb RITE Header IREP Debug Section IREP Header

  22. None
  23. IREP ISEQ Pools Symbols Sub-IREP OPCODE

  24. None
  25. None
  26. None
  27. Sample Code

  28. IREP ISEQ Pools Symbols Sub-IREP Ex. String

  29. None
  30. How does the "method" work in mruby? Call Method

  31. IREP ISEQ Pools Symbols Sub-IREP Method Name

  32. IREP ISEQ Pools Symbols Sub-IREP Method Body

  33. None
  34. Pointer

  35. None
  36. None
  37. None
  38. Sample Code

  39. None
  40. None
  41. Run your VM on the microcontroller Demo

  42. None
  43. Prototype Code Series Article (Chinese)

  44. I am trying to build my own plant keeper IoT

    device The Next
  45. Thanks