LoginSignup
3
2

More than 5 years have passed since last update.

webOS Open Source Edition の観察(1)

Last updated at Posted at 2018-04-06

なぜwebOSを調べているのか

私の立ち位置を明らかにしておきましょう。私はアプリケーションを書くよりも、システムを構築する側の人です。なのでwebOSをブラックボックスとして使おうとするのでなく、今時のこのくらいの規模のシステムでは中がどのようになっているのかを調べて、自分で何かを構築するときの参考にしたいと考えています。
というわけで、私がwebOSを見て、おお!とか、ほう!となったことを何回かに分けて書いていきます。今回はさくっと表面をなぞってわかること。

ブートログ

ブートログをgistに貼っておきました。ここ

[ 0.000000] Linux version 4.4.50 (koba@instance-5) (gcc version 6.2.0 (GCC) ) #1 SMP Tue Apr 3 01:06:49 UTC 2018
[ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d

CPUをARMv7 として認識しています。このカーネルは32bitのARM用ですね。

動いているプロセス

ps ax のログはこちら

# pstree
systemd-+-LunaDownloadMgr
        |-LunaSysService
        |-PmKLogDaemon
        |-PmLogDaemon---{PmLogDaemon}
        |-SettingsService---{SettingsService}
        |-WebAppMgr-+-WebAppMgr---WebAppMgr-+-{Chrome_ChildIOT}
        |           |                       |-3*[{CompositorTileW}]
        |           |                       |-{Compositor}
        |           |                       |-{HTMLParserThrea}
        |           |                       |-{Renderer::FILE}
        |           |                       `-{WebOSWatchdog W}
        |           |-{AudioThread}
        |           |-{BrowserBlocking}
        |           |-{Chrome_CacheThr}
        |           |-{Chrome_ChildIOT}
        |           |-{Chrome_DBThread}
        |           |-{Chrome_DevTools}
        |           |-{Chrome_FileThre}
        |           |-{Chrome_FileUser}
        |           |-{Chrome_IOThread}
        |           |-{Chrome_InProcGp}
        |           |-{Chrome_ProcessL}
        |           |-{CompositorTileW}
        |           |-{IndexedDB}
        |           |-{NetworkChangeNo}
        |           |-{SimpleCacheWork}
        |           |-{WaylandDisplayP}
        |           |-2*[{WebOSWatchdog W}]
        |           |-{inotify_reader}
        |           `-{sandbox_ipc_thr}
        |-activitymanager
        |-3*[agetty]
        |-appinstalld
        |-audiod---{audiod}
        |-avoutputd
        |-boosterd---2*[qml-runner---{QQmlThread}]
        |-bootd---2*[{bootd}]
        |-configd
        |-connmand
        |-crashd
        |-dbus-daemon
        |-dropbear---dropbear---sh---pstree
        |-event-monitor
        |-klogd
        |-ls-hubd-+-{gmain}
        |         `-{ls-hubd}
        |-maliit-server.s---MaliitServer---{QQmlThread}
        |-2*[mojodb-luna---3*[{mojodb-luna}]]
        |-mojodb-luna---4*[{mojodb-luna}]
        |-node_fork_serve-+-4*[{V8 WorkerThread}]
        |                 `-{node}
        |-notificationmgr
        |-ntpd---{ntpd) S 1 193 19
        |-pacrunner
        |-pulseaudio-+-2*[{alsa-sink-bcm28}]
        |            `-9*[{null-sink}]
        |-rdxd
        |-sam
        |-sleepd
        |-surface-manager-+-{QQmlThread}
        |                 |-{QQuickPixmapRea}
        |                 |-{QSGRenderThread}
        |                 `-{Qt bearer threa}
        |-syslogd
        |-systemd-journal
        |-systemd-logind
        |-systemd-udevd
        |-umediaserver---{umediaserver}
        |-webos-connman-a-+-{gdbus}
        |                 `-{gmain}
`-wpa_supplicant

initにはsystemd が使われています。PC用のLinuxディストリビューションの主要なものは、すでにsystemdに変わっていますが、その流れがこちらにも来ています。
そろそろ一度集中的にsystemd を勉強したほうがいいかな。

sshd にはopenSSHでなくてdropbearが使われています。dropbearは省メモリのssh実装ということで、最近私も使い始めました。sftpが無いのですが、それ以外ではdropbearで困ったことはまだありません。

ドキュメントによるとウインドウシステムにはXでなくてwaylandが使用されているそうです。確かにXサーバらしきプロセスはありません。waylandのことはまだよく知らないので、どのプロセスがXサーバに相当する仕事をしているのか名前ではよくわかりませんが、おいおい調べます。

pstreeに出てきているスレッド名から想像して、Webブラウザの基本部分はChromeベースで、javascriptのランタイムはV8のようです。

基本コマンドはbusyboxのものが使われているのですが、ps はbusyboxでなくてprocpsのもの(つまり、フル機能のps)が使われるようになっていました。こうやってシンボリックリンクになっているのはわかりやすい。

# which ps
/bin/ps
# ls -l /bin/ps
lrwxrwxrwx    1 root     root            14 Apr  3  2018 /bin/ps -> /bin/ps.procps

YouTubeの動画を再生しているときのtop

top - 09:31:36 up 20 min,  1 user,  load average: 1.24, 0.44, 0.16
Tasks: 142 total,   1 running, 141 sleeping,   0 stopped,   0 zombie
%Cpu(s): 24.9 us,  7.5 sy,  0.1 ni, 67.0 id,  0.0 wa,  0.0 hi,  0.5 si,  0.0 st
KiB Mem :   881732 total,   358592 free,   296724 used,   226416 buff/cache
KiB Swap:        0 total,        0 free,        0 used.   524332 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                 
  843 wam       20   0  705592 225452  90280 S 127.7 25.6   1:49.25 WebAppMgr               
  726 wam       20   0  512672  76624  61812 S   8.6  8.7   0:19.48 WebAppMgr               
   69 root       1 -19       0      0      0 S   2.0  0.0   0:01.47 VCHIQ-0                 
  911 root      20   0    4408   2072   1708 R   1.0  0.2   0:00.35 top                     
    3 root      20   0       0      0      0 S   0.3  0.0   0:00.16 ksoftirqd/0             
    7 root      20   0       0      0      0 S   0.3  0.0   0:00.27 rcu_sched               
  304 root      20   0  114732  35976  23680 S   0.3  4.1   0:04.58 surface-manager         
    1 root      20   0   24408   4028   2728 S   0.0  0.5   0:02.56 systemd                 
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd                
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H            
    8 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh                  
    9 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/0             
   10 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/1             
   11 root      20   0       0      0      0 S   0.0  0.0   0:00.01 ksoftirqd/1             
   13 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/1:0H            
   14 root      rt   0       0      0      0 S   0.0  0.0   0:00.00 migration/2             
   15 root      20   0       0      0      0 S   0.0  0.0   0:00.02 ksoftirqd/2  

CPU負荷が結構高いです。H.264のデコードはソフトでやっているのかな。再生した動画を見ていると、たまに横に筋が入るのですが、デコードが間に合っていないのかもしれません。
Raspberry Pi 3 のハードウェアデコーダは使っていないようです。Raspberry Pi 3 で動くようにしてオープンソースとして公開したけど、特にRaspberry Pi 3 に向けて最適化されているというわけではないようです。現時点では。

関連

webOS Open Source Edition をビルドしてみた

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2