72
MT7688 Emulator MakerBoard

MakerBoard: MT7688 Emulator

Embed Size (px)

Citation preview

Page 1: MakerBoard: MT7688 Emulator

MT7688 Emulator

Mak

erB

oard

Page 2: MakerBoard: MT7688 Emulator

錢逢祥Fred Chien

Page 3: MakerBoard: MT7688 Emulator

Open Source Developer開放原始碼自幹者

Page 4: MakerBoard: MT7688 Emulator

黑客松台灣 共同創辦人

Hackathon Taiwan Co-founder

Page 5: MakerBoard: MT7688 Emulator
Page 6: MakerBoard: MT7688 Emulator

多年前years ago

Page 7: MakerBoard: MT7688 Emulator

在那又大又土又慢又貴的年代

Page 8: MakerBoard: MT7688 Emulator

雖然我 慣 CC Language Enthusiast

Page 9: MakerBoard: MT7688 Emulator

但我也受不了每天和這些硬體一起醉

Page 10: MakerBoard: MT7688 Emulator

在這追求應用的時代需要快速打造

Page 11: MakerBoard: MT7688 Emulator

我夢想能有個易開發的方法在嵌入式系統上

Page 12: MakerBoard: MT7688 Emulator

自從 JavaScript 抬頭聽說一個語言 20 年會進入成熟期

Page 13: MakerBoard: MT7688 Emulator

希望能用 JavaScript進行各種物聯網或嵌入式應用開發

Page 14: MakerBoard: MT7688 Emulator

很多的人當我瘋子在當時

Page 15: MakerBoard: MT7688 Emulator

有一天成真了,有大廠親自跳下來

Page 16: MakerBoard: MT7688 Emulator

我發現我真是瘋子現在

Page 17: MakerBoard: MT7688 Emulator

Play in Pain

Page 18: MakerBoard: MT7688 Emulator

Less Memory記憶體好少

Page 19: MakerBoard: MT7688 Emulator

Less Storage儲存空間好少

Page 20: MakerBoard: MT7688 Emulator

Keep Connection Alive必須連著線開發

Page 21: MakerBoard: MT7688 Emulator

SAVE ME !Please!

Page 22: MakerBoard: MT7688 Emulator

Linux Kernel

Userspace

Node.js (JavaScript Engine)

Applications

Libraries

Page 23: MakerBoard: MT7688 Emulator

Linux Kernel

Userspace

Node.js (JavaScript Engine)

Applications

Libraries

footprint

Memory Usage

Page 24: MakerBoard: MT7688 Emulator

這不是 PC 啊!也不是 Server!

Page 25: MakerBoard: MT7688 Emulator

等等!?

Page 26: MakerBoard: MT7688 Emulator

我可以在 PC 上模擬嗎?

Page 27: MakerBoard: MT7688 Emulator

MakerBoard

Page 28: MakerBoard: MT7688 Emulator

Git Repositoryhttp://github.com/cfsghost/makerboard

Page 29: MakerBoard: MT7688 Emulator

Run an Emulationon your computer

Page 30: MakerBoard: MT7688 Emulator

QEMUVirtual Machine

Page 31: MakerBoard: MT7688 Emulator

Containertechnology

Page 32: MakerBoard: MT7688 Emulator
Page 33: MakerBoard: MT7688 Emulator

其實你也可以自幹You can make it

Page 34: MakerBoard: MT7688 Emulator

什麼是 Container ?What's that?

LXC? Docker ?

Page 35: MakerBoard: MT7688 Emulator
Page 36: MakerBoard: MT7688 Emulator

Chroot System CallUnix

Page 37: MakerBoard: MT7688 Emulator
Page 38: MakerBoard: MT7688 Emulator

觀察 Linux 開機流程了解 chroot 機制

Page 39: MakerBoard: MT7688 Emulator

Bootloader

Linux Kernel

Initrd/ramdisk image

bin lib

usrsbin tmp

etc

Root Filesystem

Page 40: MakerBoard: MT7688 Emulator

Bootloader

Linux Kernel

Initrd/ramdisk image

Root Filesystem on Disk

bin lib

usrsbin tmp

etc

Root Filesystem

var

Page 41: MakerBoard: MT7688 Emulator

Bootloader

Linux Kernel

Initrd/ramdisk image

Root Filesystem on Disk

bin lib

usrsbin tmp

etc

Root Filesystem

var

Detecting Disk & Selecting run level

Page 42: MakerBoard: MT7688 Emulator

Bootloader

Linux Kernel

Initrd/ramdisk image

Root Filesystem on Disk

bin lib

usrsbin tmp

etc

Root Filesystem

var

chroot system call

(note: privot_root)

Page 43: MakerBoard: MT7688 Emulator

Root Filesystem

Chroot

Linux Kernel

bin lib usr ...

Chroot

...

Chroot

...

Chroot

...

* Run different systems on the same kernel

Page 44: MakerBoard: MT7688 Emulator
Page 45: MakerBoard: MT7688 Emulator
Page 46: MakerBoard: MT7688 Emulator

這一切只是個開始It's jsut the beginning

Page 47: MakerBoard: MT7688 Emulator

cgroup

Page 48: MakerBoard: MT7688 Emulator

我能自幹 Container 了然後呢?

Page 49: MakerBoard: MT7688 Emulator

Userspace

Chroot

Linux Kernel

bin lib usr ...

x86

Execute ELF files

Page 50: MakerBoard: MT7688 Emulator

Userspace

Chroot

Linux Kernel

bin lib usr ...

x86

Execute non-x86 ELF files

Page 51: MakerBoard: MT7688 Emulator

non-x86 ELF怎麼跑?

Page 52: MakerBoard: MT7688 Emulator

Binary Format Supportapt-get install binfmt-support

Page 53: MakerBoard: MT7688 Emulator

qemu-user-staticapt-get install qemu-user-static

Page 54: MakerBoard: MT7688 Emulator

Register ELF on kernel/proc/sys/binfmt_misc

Page 55: MakerBoard: MT7688 Emulator

Userspace

Chroot

Linux Kernel

bin lib usr ...

QEMU

Recognize ELF for ARM, MIPS and other architectures

x86

binfmt support

Page 56: MakerBoard: MT7688 Emulator
Page 57: MakerBoard: MT7688 Emulator

MT7688MIPS & Little-endian

Page 58: MakerBoard: MT7688 Emulator

qemu-mipsel-static<rootfs>/usr/bin/qemu-mipsel-static

Page 59: MakerBoard: MT7688 Emulator
Page 60: MakerBoard: MT7688 Emulator

Userspace

Chroot

Linux Kernel

bin lib usr ...

x86 Hardware

Execute Your MIPS Application

Page 61: MakerBoard: MT7688 Emulator

All Memory and Storage on computer you can use

With Emulation

Page 62: MakerBoard: MT7688 Emulator

Sweet!Thank God!

Page 63: MakerBoard: MT7688 Emulator

Userspace

Chroot

Linux Kernel

bin lib usr ...

x86 Hardware

Execute Your MIPS Application

Page 64: MakerBoard: MT7688 Emulator

Userspace

Chroot

Linux Kernel

x86 Hardware

Userspace

Linux Kernel

MT7688 Hardware

Copying your application to MT7688

Page 65: MakerBoard: MT7688 Emulator
Page 66: MakerBoard: MT7688 Emulator

InstallationHow to install MakerBoard?

Page 67: MakerBoard: MT7688 Emulator

Install Dependencissudo apt-get install qemu-user-static squashfs-tools

Page 68: MakerBoard: MT7688 Emulator

Install MakerBoardnpm install makerboard -g

Page 69: MakerBoard: MT7688 Emulator

UsageHow to use MakerBoard?

Page 70: MakerBoard: MT7688 Emulator

Create an Emulationmakerboard create my7688

Page 71: MakerBoard: MT7688 Emulator

Run Emulationmakerboard run my7688

Page 72: MakerBoard: MT7688 Emulator

Live Demo:-)