Upgrade to Pro — share decks privately, control downloads, hide ads and more …

how to embed mruby (en)

how to embed mruby (en)

Tomoyuki Sahara

June 02, 2013
Tweet

More Decks by Tomoyuki Sahara

Other Decks in Programming

Transcript

  1. How to embed mruby Tomoyuki Sahara ([email protected]) Internet Initiative Japan

    Inc. $PQZSJHIU $ *OUFSOFU*OJUJBUJWF+BQBO*OD"MMSJHIUTSFTFSWFE
  2. What is mruby? mruby is the lightweight implementation of the

    Ruby language... https://github.com/mruby/mruby google://mruby/
  3. CPU: ARM 32bit Memory: 128MB FlashROM: 32MB OS: NetBSD SA-W1

    (www.sacm.jp/#saw1) Router built with mruby
  4. Why mruby? interface.ge1.ipv4.address : 192.168.0.1/24 interface.wlan0.service : enable interface.wlan0.ssid :

    guest interface.wlan0.security : wpa-psk-aes route.ipv4.0.destination : default route.ipv4.0.gateway : 100.100.0.1 dhcp.server.0.interface : wlan0 dhcp.server.0.pool.address : 192.168.0.4/24 dhcp.server.0.pool.count : 100 Configuration parse/validate/evalute/execute mruby!
  5. Running mruby CPU ARM 32bit is not uncommon Memory 128MB

    is large enough FlashROM 32MB is tight OS NetBSD is a kind of Unix ≒ a (poor) PC ≒ a (poor) PC Not difficult to run mruby on it.
  6. What we have done: • ػೳ֦ு • ෆ۩߹मਖ਼ • Make

    a stable version ←New! • Build a firmware
  7. What we have done: • ػೳ֦ு • ෆ۩߹मਖ਼ • Make

    a stable version • Build a firmware
  8. What we have done: • ػೳ֦ு • ෆ۩߹मਖ਼ • Make

    a stable version • Build a firmware
  9. What we have done: • ػೳ֦ு • Fix bugs ←New!

    • Make a stable version • Build a firmware
  10. To fix bugs • Write debugging tools: • backtrace •

    “require” to module • disassembler (app/mrbdump) • testing framework (mruby-mtest) • debugger (mruby-mdebug)
  11. What we have done: • ػೳ֦ு • Fix bugs •

    Make a stable version • Build a firmware
  12. What we have done: • Add features ←New! • Fix

    bugs • Make a stable version • Build a firmware
  13. Enhancement • Create modules dependent on Unix • IO, File,

    Socket, Regexp, Errno, ... • Enhance built-in modules • Array, String, ...
  14. iij/mruby-* mruby-io mruby-socket mruby-regexp-pcre mruby-errno mruby-simple-random mruby-env mruby-require mruby-pack mruby-mock

    mruby-syslog mruby-mtest mruby-tempfile mruby-process mruby-pcap mruby-dir (more...)
  15. Ship it! • Add features • Fix bugs • Make

    a stable version • Build a firmware