This is a fantastic initiative! I have been thinking about this recently, as 
the MDN build instructions, phone information, B2G release notes and Gaia 
contribution info are all getting there, but we still have woefully little on 
the Gonk/other porting targets layer.

I’d love to help write this up and publish it, and in turn get some more input 
into what should be put on 
https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gonk, and other related 
pages.

best,

Chris Mills
   Senior tech writer || Mozilla
developer.mozilla.org || MDN
   [email protected] || @chrisdavidmills



On 12 Mar 2014, at 08:52, Thomas Zimmermann <[email protected]> wrote:

> Hi Gina
> 
> On 11.03.2014 07:27, Gina Yeh wrote:
>> Hi,
>> 
>> We're preparing documents for analyzing porting efforts of Firefox OS,
>> and I'm writing this e-mail up to organize these thoughts and get input
>> from everyone on various parts. Any feedback is welcomed.
> 
> Sounds great.
> 
> 
>> We think that it could be roughly separated into three types:
>> 
>> *1. Devices with Gonk, consisting of a Linux kernel and userspace
>> hardware abstraction layer (HAL)*  [1].
>> 
>> For these devices, all hardware-related backends should be ready and no
>> porting effort should be taken.
> 
> On most systems, some of the system libraries are proprietary, and only
> available in binary form. One thing I noticed is that these libraries
> are sometimes not compatible with the open-source components because
> vendors add their own modifications to the binaries. Finding the correct
> revisions for open-source components that actually build and work at
> runtime with the binary blobs can be hard.
> 
> 
>> Here are the mapping of Gecko and Gonk components.
>> 
>> Gecko                             | Gonk
>> ---------------------------------------------------------------------
>> Display                           | Gralloc HAL and HWC HAL
>> Audio                             | OpenSL ES + AudioFlinger
>> AudioSystem                       | HAL of Audio HW and Audio Policy
>> Manager
>> Wifi                              | dhcp client, dhcp server, tethering,
>> wpa_supplicant, hostapd, DNS server(property_set)
>> Bluetooth                         | bluez+dbus,  bluedroid
>> Sensor                            | Sensor HAL
>> Mounter                           | vold
>> Power                             | Power HAL
>> Camera                            | Camera Service in MediaService Process
>> RTSP                              | (*It links share libraries in Gonk)
>> GPS                               | Geolocation HAL
>> Backlight/LED                     | light HAL
>> RIL                               | rild, netd, dhcpd
>> Platform Decoder Module           | MediaCodec
>> External Media Framework          | OpenMax (libstagefright)
>> ResourceManager                   | WakeLock
>> Low Memory Killer                 | Linux Kernel Configuration
>> Memory Pressure notification      | Linux Kernel Configuration
> 
> The memory-pressure notification is a feature specifically for FFOS
> IIRC. So you won't find it on generic Android devices. OTOH, it's not
> absolutely necessary.
> 
> 
>> Nuwa                              | pthread, libc
>> 
>> *2. Devices with ARM/x86 architectures but no Gonk.*
>> 
>> For these devices, porting efforts of all components listed in the above
>> table should be taken into accounted.
>> 
>> *3. Devices with CPU architectures which is neither ARM nor x86.*
>> 
>> For these devices, porting above all components are necessary, and we
>> need to put the following items on the radar:
>> 
>> - Crash reporting (toolkit/crashreporter/google-breakpad) and stack
>> walking (for assertion reporting/debugging, xpcom/base/nsStackWalk.cpp) [2]
>> - JIT
>> - All of the optimized assembly/architecture specific intrinsics spread
>> throughout the tree including [2]:
>>   - Assembly for various media/graphics libraries (libjpeg, libvpx, etc)
>>   - Architecture specific SIMD intrinsics for various things (SSE2
>> based graphics operations, SSE2 based charset conversions, cairo, skia,
>> thebes, etc)
>> - Hard-Floating/Soft-Floating
> 
> Recently there was a discussion about page sizes in bug 979913. [1] That
> might become relevant as well.
> 
> 
>> 
>> (Thanks Kyle Huey for providing the above information.  )
>> 
>> Besides, we went through m-c code base quickly and found some inline
>> assembly [3], and we're not sure if the functionalities of the following
>> components are still working without these inline assembly. (If they are
>> used for acceleration, the functionality should be fine but with poor
>> performance. Or, the component might be broken due to the lack of the
>> inline assembly.) Please help us point out the modules which might be
>> risky and we can also put them on the radar. Thanks.
> 
> Another thing you should look for are system calls. Bionic doesn't
> support all the system calls that Linux provides, so we have to
> implement some of them by hand. I know that at least
> GonkDiskSpaceWatcher.cpp [2] adds support for Linux' fanotify; and I can
> think of other interfaces that would be helpful to support. Porting
> should make sure that the system calls are implemented by the Linux
> kernel, and maybe even supported by the C library.
> 
> 
> Best regards
> Thomas
> 
> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=979913
> [2]
> http://dxr.mozilla.org/mozilla-central/source/hal/gonk/GonkDiskSpaceWatcher.cpp#38
> 
>> 
>> - build/stlport/
>> - db/sqlite3
>> - gfx/qcms/transform.c: cpuid()
>> - ipc/chromium/src/base
>> - js/src
>>   - TraceLogging.cpp: rdtsc()
>>   - ctypes/libffi
>>   - devtools/vprof/vprof.cpp: readTimestampCounter()
>>   - vtune/ittnotify_config.h: __TBB_machine_fetchadd4()
>> - media
>>   - libopus, libpng, libtheora, libvorbis, libvpx, libyuv, webrtc
>> - memory
>>   - jemalloc, mozjemalloc
>> - modules/freetype2
>> - nsprpub/pr
>> - security
>>   - nss/lib/freebl, nss/lib/sqlite
>>   - sandbox/chromium/base
>> - tools
>>   - jprof/stub/libmalloc.cpp
>>   - profiler/UnwinderThread2.cpp
>> - xpcom
>>   - reflect/xptcall
>> 
>> 
>> 
>> Thank you for your patience and cooperation. If you have any questions
>> or concerns, don't hesitate to let me know.
>> 
>> - Gina
>> 
>> [1]https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gonk
>> [2]http://mxr.mozilla.org/mozilla-central/find?string=\.asm%24|\.s%24|SSE2&tree=mozilla-central&hint=
>> 
>> [3]http://dxr.mozilla.org/mozilla-central/search?q=__asm__&redirect=true
>> 
> 
> _______________________________________________
> dev-b2g mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-b2g

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to