While doing a Google search to locate the open Linux page of AMLogic, I noticed another link reading “Amlogic AML8726-MX Linux kernel code released“. Interesting. So AMLogic appears to have released the kernel source code for their latest dual core Cortex A9 processor at the beginning of August and the tarball is available from their open source site: kernel-common-2012-08-03-git-a63244fb9c.tar.gz.
A github user (fards) also imported the code to github, but he’s not affiliated with AMLogic, so don’t expect commits from AMLogic there. Let’s retrieve it:
1 |
git clone git://github.com/fards/AMlogic_Meson6_030812release.git |
AML8726-MX is codenamed MESON6 in the source code, and the code is in arch/arm/mach-meson6/, but let’s see if we can find a config file in arch/arm/configs. Yes! There are 4:
- meson6_android_defconfig – Android config file (Single core)
- meson6_defconfig – Linux config file (Single core) all Android config disabled.
- meson6smp_android_defconfig – Android config file with smp (symmetric multiprocessing) support
- meson6smp_defconfig – Config file with smp (symmetric multiprocessing) support, Android stuffs enabled, but no touchscreen support…
The descriptions are my guesses based on the file names and a quick look and the configs.
Since ARM8726-MX is a dual core processor, and it’s no fun using the single core version, let’s try meson6smp_defconfig:
1 2 3 4 |
make ARM=arm meson6smp_defconfig *** Default configuration is based on 'meson6smp_defconfig' arch/arm/plat-meson/Kconfig:117: warning: Skip customer/boards/Kconfig arch/arm/plat-meson/Kconfig:124: warning: Skip customer/drivers/Kconfig |
The warnings mean we won’t have access to some board config and drivers specific to AMLogic’s customer board, but we should still be able to build the kernel with one of AMLogic reference platforms.
There are 2 Meson6 boards available in menuconfig:
- Meson6 socket board
- Meson6 reference board
I have no idea what those are, so let’s carry on with the default setting (Meson6 socket board).
I first tried to build with Linaro toolchain, but this failed with :
arch/arm/mach-meson6/hotplug.c:18:20: error: inlining failed in call to always_inline âmeson_set_cpu_ctrl_regâ: function body not available
which appears to be a bug in gcc-4.7. So I’ve used the toolchain provided on openlinux.amlogic.com (Code Sourcery G++) instead:
make ARCH=arm CROSS_COMPILE=~/amlogic/arm-2010q1/bin/arm-none-linux-gnueabi- -j 12 uImage
...
UIMAGE arch/arm/boot/uImage
Image Name: Linux-3.0.8-g42697c8
Created: Sat Aug 18 18:14:00 2012
Image Type: ARM Linux Kernel Image (lzma compressed)
Data Size: 2943441 Bytes = 2874.45 kB = 2.81 MB
Load Address: 80008000
Entry Point: 80008000
Image arch/arm/boot/uImage is ready
Great, the kernel builds fine. Let’s complete this by building and installing the modules:
make ARCH=arm CROSS_COMPILE=
~/amlogic/arm-2010q1/bin/arm-none-linux-gnueabi-
-j12 INSTALL_MOD_PATH=build_modules modules
make ARCH=arm CROSS_COMPILE=~/amlogic/arm-2010q1/bin/arm-none-linux-gnueabi-
-j12 INSTALL_MOD_PATH=build_modules modules_install
Those last steps will build the Mali drivers (ump.ko and mali.ko), and “install” all modules in build_modules directory.
For AMLogic AM8726-MX set-top boxes such as Geniatech ATV1200 (See video), this code might be enough, but fads mentioned in a comment that lcd/ips code is missing and it might be more difficult to use this code on tablets such as Ainol Novo 7 Aurora II. He also started a developers thread in slatedroid.com, join the discussion if you are a developer interested in this project.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
so that means soon or later we can expect a Linux distro for ainol elf2 which is a DualCore Amlogic8726-MX tablet saw somewhere selling at $99.
LCD issue means display will work without touch or it wont show anything? I mean if display doesn’t give touch response, it’ll still remain usable with keyboard mouse.
@max
That means blank screen, but it should be possible to copy the binary LCD modules from your tablet.
I’m also not sure the the touch support is there for your device. There are no touch modules, but touch screen support is enabled inside the kernel. If you really want to know you can follow the slatedroid link above.
oky, Also an entirely different tangent but still somewhat relevant.
Technically which SOC based tablet should give you a better performance especially for ‘web browsing and for longer battery life’.
DualCore RK3066 based or DualCore Amlogic8726-MX6 based, given both got rest of the parameters same i.e 1gb ram /1024×600 /3700mAh etc.
Where are the AML8726-MX based boxes? I want one for XBMC
@LuckyKnight
They are starting to appear on the Chinese OEM sites, but it’s better to wait for Pivos to release such a box for a number of reasons
1) Your supporting Pivos and XBMC team by buying their box.
2) Pivos will be building a linux/XBMC firmware for the box like they do for their 8726-M1 box.
3) Actual technical support.
4) You know what you will be getting, buying a box right now from the OEM’s may be a risk even if it has the same chipset unforeseen issues may pop up and you could get a bum deal from the OEM’s on the hardware being poor quality.
can you please compile the module uinput.ko for the AML8726-MX Linux 3.0.8.
many devices have this kernel and with this module we can use also DroidMote
hi
What do you think is the best box now to play with xbmc?
the odroid-x or a amlogic board?
mfg
@io
Sorry, I don’t have time right now. You could try it yourself
@I-Kev
amlogic. Other processor have support via external players (e.g. diceplayer), so the videos aren’t played within XBMC interface
Hey guys,
as noted the source that amlogic released is missing configs and drivers.
its also designed to be built with a very old q2010 toolchain.
its actually fairly close to the code for the ainol fire, there’s quite a lot of changes to the ainol elf-ii code.
I was busy messing with the elf-ii code (it runs on gcc4.6 at least now and some of the earlier linaro 4.7 toolchains)
that’s available here;
https://github.com/fards/ainol_elfii_common
and the fire code (needs updating when ainol finally decide to release patches for a bad touchscreen f/w bug)
is here:
https://github.com/fards/Ainol_fire_kernel
hope this helps
should also point out that the elf-ii code ootb uses an older Mali code sdk 10? the fire and main amlogic code uses sdk14, so I patched that one in to the elf.
I’m keen on getting the arm r3po/r3p1 mali code working.
my gits are messy, as I use them as a transfer for experiments between different build machines btw.. you have been warned 😀
@fards
do you have access to mali source codes?
can you build old 2.6 kernel + mali drivers with hardfp plz 🙂
Updated source code release: http://openlinux.amlogic.com:8000/download/GPL_code_release/2013-04-24/
https://github.com/nspierbundel/amlogic-common/tree/3.0.50-armhf
for those who want to contribute developping on the 3.0.x kernels for amlogic m6
Daniel
I have tried to compile the module joydev to have joystick support in my geniatech atv1200.
I followed the instructions in the article, and I have generated the compiled module: joydev.ko.
But when I’ve put in the geniatech atv1200, to execute the instruction to load the module (as root):
insmod/system/lib/modules/joydev.ko
I always get the same error:
exec format error
well, I check with the modinfo command the module has the same version of the kernel that my atv1200, but still fails also.
any suggestions?
or maybe just the device does not support this module?
Besides, I run the command dmesg, but no joydev message to tell me what the problem is.
@rafa
Check this post: http://www.cnx-software.com/2012/09/11/building-kernel-modules-for-allwinner-a10-devices-android/
@cnxsoft
Thanks for responding so quickly.
I had seen that article too.
I’ll check back and try again, because I was using a different compiler.
after all the tests, I have not been able to create a module that is loaded correctly in the Mygica / Geniatech atv1200.
this is what I did:
kernel source code from http://www.cnx-software.com/2012/08/18/amlogic-releases-aml8726-mx-linux-3-0-8-source-code/ :
git clone git://github.com/fards/AMlogic_Meson6_030812release.git
possible configurations for atv1200 (I’ve tested with the latest):
meson6_android_defconfig – Android config file (Single core)
meson6_defconfig – Linux config file (Single core) Android all config disabled.
meson6smp_android_defconfig – Android config File with smp (symmetric multiprocessing) support
meson6smp_defconfig – Config File with smp (symmetric multiprocessing) support, enabled Android stuffs, but no touchscreen support …
To create the module I am following this tutorial:
http://www.cnx-software.com/2012/09/11/building-kernel-modules-for-allwinner-a10-devices-android/
although there are other items that can also come in handy:
http://youtry.de/projects/general/android/KernelModules
http://www.rajatswarup.com/blog/2012/02/19/android-kernel-compilation-howto/
http://stevechui.blogspot.com.es/2011/10/compiling-kernel-modules-tunko-for.html
any suggestions?
@rafa
Do you still have the same error?
yes, same error 🙁
When I run the modinfo instruction only see this small difference:
.ko
3.0.8-g2847a5e SMP preempt mod_unload ARMv7
.ko
3.0.8-g2847a5e SMP preempt mod_unload modversions ARMv7
@rafa
Rafa just read this:
http://www.skynet.ie/~mark/home/kernel/symbols.html
It seems you just have to disable modversions for your kernel and it should work. There shouldn’t be any difference at all between the 2.
I have managed to compile the module, now with the right modinfo:
3.0.8-g2847a5e SMP preempt mod_unload modversions ARMv7
but when I tried to load the móludo gave me the following error:
“disagrees about version of symbol module_layout”
then I read that could make a small modification of the file in hexadecimal:
http://stackoverflow.com/questions/2720177/module-layout-version-incompatibility
but after changing it, and try it, now I get the following error:
[31526.067817@1] hid_sony: disagrees about version of symbol hid_unregister_driver
[31526.069610@1] hid_sony: Unknown symbol hid_unregister_driver (err -22)
[31526.076325@1] hid_sony: disagrees about version of symbol __hid_register_driver
[31526.076337@1] hid_sony: Unknown symbol __hid_register_driver (err -22)
[31526.076356@1] hid_sony: disagrees about version of symbol hid_connect
[31526.076362@1] hid_sony: Unknown symbol hid_connect (err -22)
[31526.076369@1] hid_sony: disagrees about version of symbol kmem_cache_alloc
[31526.076375@1] hid_sony: Unknown symbol kmem_cache_alloc (err -22)
[31526.076384@1] hid_sony: disagrees about version of symbol _dev_info
[31526.076389@1] hid_sony: Unknown symbol _dev_info (err -22)
[31526.076396@1] hid_sony: disagrees about version of symbol hid_disconnect
[31526.076401@1] hid_sony: Unknown symbol hid_disconnect (err -22)
[31526.076416@1] hid_sony: disagrees about version of symbol usb_control_msg
[31526.076421@1] hid_sony: Unknown symbol usb_control_msg (err -22)
[31526.076429@1] hid_sony: disagrees about version of symbol dev_err
[31526.076435@1] hid_sony: Unknown symbol dev_err (err -22)
[31526.076444@1] hid_sony: disagrees about version of symbol kmalloc_caches
[31526.076449@1] hid_sony: Unknown symbol kmalloc_caches (err -22)
any suggestions?
thx!
@rafa
Ideally you should try to build the kernel with the same version and kernel config as in the firmware in your device, and build the module against that.
If it’s not possible, maybe the hack on stackoverflow may work.
Hello, I am able to build a zImage but i can’t work out how to compile that to a boot.img for flashing via CWM can you please help me. I tried unmkbootimg and splitboot neither will extract existing boot.img so im not sure what to do now.
@rafa
Here is my module.
Here is hid-sony.ko for “3.0.8-g525c782”
https://www.dropbox.com/s/pgpf4un1nbzrmol/hid-sony.ko
latest kernel version from latest update for geniatech atv1200
@Fma965
Why no edit button? Also uh i know im decompiling it correctly as i can decompile my xperia play kernel i just can’t decompile the boot.img for my crossflashed sumvision cyclone x2 to geniatech atv1200
@Fma965
I’m not sure how to do that. I have not played a lot with AMLogic. XBMC (Android) developers’ community should be able to help since they’ve spent a lot of time and efforts on the platform.
@Fma965
Try this:
https://dl.dropboxusercontent.com/u/347052/boot_unpack_repack.zip
Hopefully you guys can help me out, I’ve been trying for a few days to compile my own module for Geniatech ATV120 (same kernel as ATV1200), and its driving me CRAZY! I’ve gotten as far as compile the modules and first I got Exec Error, but after making the changes to get the exact kernel version I now get “disagrees about version of symbol module_layout” so I wanted to know how the hid-sony.ko made by fma965 since it works perfectly on my atv120, but fma965 has replied that he forgot how he did it and lost all files related to this 🙁
so I did this:
modinfo hid-sony.ko and I got this
filename: hid-sony.ko
license: GPL
alias: hid:b0003v0000054Cp0000024B
alias: hid:b0005v0000054Cp00000268
alias: hid:b0003v0000054Cp0000042F
alias: hid:b0003v0000054Cp00000268
depends:
vermagic: 3.0.8-g525c782 SMP preempt mod_unload modversions ARMv7
I did the same for my module
filename: joydev.ko
license: GPL
description: Joystick device interfaces
author: Vojtech Pavlik
alias: input:b*v*p*e*-e*1,*k*2C0,*r*a*m*l*s*f*w*
alias: input:b*v*p*e*-e*1,*k*130,*r*a*m*l*s*f*w*
alias: input:b*v*p*e*-e*1,*k*120,*r*a*m*l*s*f*w*
alias: input:b*v*p*e*-e*3,*k*r*a*6,*m*l*s*f*w*
alias: input:b*v*p*e*-e*3,*k*r*a*8,*m*l*s*f*w*
alias: input:b*v*p*e*-e*3,*k*r*a*0,*m*l*s*f*w*
depends:
vermagic: 3.0.8-g525c782 SMP preempt mod_unload modversions ARMv7
so everything seem correct, when to load it with insmod on my ATV120 and I got the “disagrees about version of symbol module_layout” error
ok, back to ubuntu. ran this:
modprobe –dump-modversions hid-sony.ko
0x4e362f07 module_layout
I noticed the module layout so I ran the same on my module
modprobe –dump-modversions joydev.ko
0x82bedd05 module_layout
that seems to be my problem, I know nothing about module layouts, but doing some google research I found I need the same Module.symvers but for the life of me I just cannot get the same one, can anyone help me out building modules with this 0x4e362f07 module_layout ?
I am using this source: git://github.com/fards/AMlogic_Meson6_030812release.git
I also tried with the 2013 source, but could not even get it to compile :S
Thanks!