yashsingh1/xdaforums huggingface dataset:
[Gen8 Android Development] alex@debi:
I tried to build the kernel (with modified .config), but it ends up with an error:

arch/arm/mach-omap2/built-in.o: In function `archos_twl_gpio_setup':
usb-ehci.c:(.text+0xcd78): undefined reference to `hardware_rev'
usb-ehci.c:(.text+0xcd80): undefined reference to `hardware_rev'
arch/arm/mach-omap2/built-in.o: In function `board_init':
usb-ehci.c:(.init.text+0x4448): undefined reference to `omap2_hsmmc_init'
usb-ehci.c:(.init.text+0x447c): undefined reference to `hardware_rev'
arch/arm/mach-omap2/built-in.o: In function `panel_boe_wsvga_10_init':
usb-ehci.c:(.init.text+0x4714): undefined reference to `hardware_rev'
arch/arm/mach-omap2/built-in.o: In function `archos_usb_ohci_init':
usb-ehci.c:(.init.text+0x4908): undefined reference to `hardware_rev'
arch/arm/mach-omap2/built-in.o: In function `archos_usb_tsp_init':
usb-ehci.c:(.init.text+0x4bb0): undefined reference to `hardware_rev'
arch/arm/mach-omap2/built-in.o: In function `ads7846_dev_init':
usb-ehci.c:(.init.text+0x4d80): undefined reference to `hardware_rev'
arch/arm/mach-omap2/built-in.o:usb-ehci.c:(.init.text+0x5234): more undefined references to `hardware_rev' follow
make: *** [.tmp_vmlinux1] Error 1
alex@debi64:~/1tb/ARM/archos-gen8-kernel-2.6.37$

I haven't yet got time to see what was wrong. Config is here http://pastebin.com/KcDLAuVU

With default linux.config it builds though.
[Gen8 Android Development] grim-a101:
If I remerber well, you have to set CONFIG_MACH_ARCHOS_A43=y in order to build the kernel, even if you only want it to build for A101.
[Gen8 Android Development] CalcProgrammer1:
Sounds like a Makefile issue. I'll look into it, shouldn't be a hard fix.
[Gen8 Android Development] amathophobia:
I have to admit I know as much about kernels as I do about having a period. (I understand the concept but I have no experience.) Yet I am busting my hump trying to get oneiric to boot on the a70. Therefore I have 2 questions. Does kexec completely overwrite the entire kernel in memory thus requiring the 2nd kernel to have the same hardware specific code as the stock archos kernel or could a generic version 3+ arm kernel work? If a generic arm kernel wouldn't work then could the archos specific stuff in the kernel be made into modules that could (I'm guessing) be easy to port to other/newer kernels?
[Gen8 Android Development] CalcProgrammer1:
The kernel is the part of the operating system that always resides in main memory (RAM). It is usually small (~2-4MB for embedded/mobile devices). When the system boots up, the bootloader (which is located at a specific location, usually starting at the first block of the storage device) finds the kernel and copies it into RAM, then passes execution over to the kernel. It also provides some limited information about the machine (in this case, telling the kernel what Archos device it's running on).

Kexec (which is the basis of kexecboot and kboot bootloaders) is a function built into the kernel that allows the running kernel to act as a bootloader and boot another kernel. How this works is the new kernel is copied entirely into RAM, though not to the same location that the running kernel (and thus the location the primary bootloader would have located it). Then, the running kernel cleans up before transferring execution to the new kernel. At this point, the old kernel is still in memory, but the memory is marked as free, so the new kernel will overwrite it when it needs to.

So yes, the new kernel is basically booted from scratch, the old kernel may leave certain devices powered on (such as various system clocks, the backlight LED for the display, WiFi/BT power, etc) but the new kernel must have drivers for these devices in order to resume control of them. The 2.6.37+ kernel I'm using doesn't have A70 support (working on it, but don't have much time at the moment, hopefully once I get out of school I can get it implemented).

Remember how I said the bootloader provides some machine-specific information? So does kexec, and this information is used by the kernel to determine what code to boot the machine with. There is a MACHINE_START call made in each machine-specific file (board-archos-xxx.c in the kernel source). This call only runs (and thus the machine only boots) if the machine passed from the bootloader matches one of the available MACHINE_START calls. My kernel has only A43 and A101, thus A70 doesn't do anything. If I did fix board-archos-a70.c it would then at least boot, but without the LCD driver you wouldn't be able to see anything.

If you want to know more about kernels and the ARM boot process, see the thread over in gen8 general about porting u-boot to the A101. It's pretty interesting. u-boot is a primary bootloader (the very first code loaded from outside the CPU) that is used on TI's Beagle and Panda development boards with similar hardware to the Archos devices.
[Gen8 Android Development] amathophobia:
Thank you very much calc for your in depth answer. One thing that may be of interest to you is that the entire droidx rom community is build around having to use kexec to bypass the locked boot loader and unreplaceable kernel. If you could get a hold of cvpcs (the guy who got kexec to work on locked down motorola devices) he could probably fill you in how exactly they have gotten as far as they have with as little as they have to work with. If I remember correctly they dont even have the kernel source code. I don't know if any of that would help our situation but I thought I'd throw it out there. Once again thank you. I'm going to hit up google and get cracking.
[Gen8 Android Development] wilbr:
I'm interested in picking up the Archos 43 because of the work that you did. I do have a few quick questions.

How smooth/useable is Ubuntu on the 43? (It looks almost perfect in your video!)

Is video playback smooth?

Does HDMI out work?

Does the USB host work?

What is battery life like w/ Ubuntu?

Thanks!
[Gen8 Android Development] Rickythemaniac:
Will there be a version for 70 IT?
[Gen8 Android Development] CalcProgrammer1:
How smooth/useable is Ubuntu on the 43? (It looks almost perfect in your video!)

- It's reasonably smooth for simple tasks, just look at the video.

Is video playback smooth?

- No! The GPU and DSP hardware is not working yet, so accelerated video playback and 2D/3D rendering is all done in software, making it slow. There should be a way to get these working, I just need more time to work on it.

Does HDMI out work?

- No! The HDMI output on the A43 is non-standard. The OMAP 3 processors do not have HDMI support available, so Archos sorta hacked it in using a converter chip and some deeply integrated software work in the kernel. The problem is that the omapdss display driver has been drastically updated, and the Archos patches need a ton of work.

Does the USB host work?

- IDK! Really, I don't know. It should work, the modules are available, it connects to devices at boot, but then never lets you use them. Not sure why, but it's something I need to fix.

What is battery life like w/ Ubuntu?

- It should be decent, but I usually leave it plugged in. The battery monitor isn't working properly so it's hard to tell.
[Gen8 Android Development] wilbr:
Thanks for the answers! I eneded up getting an A43 off ebay for a good price. I tried to download your rootfs file, but got a 404 error from dropbox.

Also, on the openaos site I saw a post where you said that you had a good image of Debian for the A43 on the debian-archos site, but that site is down. Is there anyway that you can post the info or the links here?

Thanks again, and I really am looking forward to checking out your work!
[Gen8 Android Development] CalcProgrammer1:
http://code.google.com/p/hp-touchpad-ubuntu/wiki/Installation

Look at the "Mirrors for last file" category, any of those should work (it's the TouchPad Ubuntu rootfs that I based this install off of). Also, it is possible to update that rootfs to 12.04 after getting it up (just updated it on my TouchPad, if you have networking up on A43 it should work as well, just run update manager, enable all the software sources, then sudo update-manager --devel-release).
[Gen8 Android Development] k1nk33:
@Calc

Hey dude, any chance that you could enable the touch screen for the 101 ? I understand it isn't as simple as just a few clicks but I've just read a review for the new Ubuntu release and its very positive ( seemingly the built in keyboard is the **** too ) and I'd love to have this going on the tablet.

Thanks for all the work so far and here's hoping you can help us out :)
[Gen8 Android Development] CalcProgrammer1:
The problem is that I have no clue how to enable the touchscreen for the 101 as I do not have a 101. I know it's USB and I think that is our bigger problem, that USB overall is not working properly. On my A43 it detects USB devices at boot and immediately shuts them off. If you could post a dmesg log of A101 booting with and without devices plugged into the USB host port it might help. To post a dmesg, just pull the "dmesg" file from /var/log/ after you have booted Ubuntu. Even if Ubuntu is unusable, you can mount the Ubuntu filesystem after rebooting and pull the log, then put it up on Pastebin. This might help me figure out the USB system on A101 and compare against my A43.

BTW the keyboard on 12.04 is awesome looking, works great on my TouchPad. Can't wait to get it up on A43 as well. The GNOME classic fallback is greatly improved as well.
[Gen8 Android Development] grim-a101:
Just to be sure. Are we talking about the micro USB port, or the full size USB port?

In the first case (and I think this is what we are talking about), I can't provide anything as I don't have an adaptator cable :(
[Gen8 Android Development] CalcProgrammer1:
The full size USB port. The micro is common across all gen8's I think, and I have already confirmed it isn't working on A43. I would like a dmesg for the A101 without anything USB connected as well as one with something plugged into the full size (host) port so I can see if the interfaces are being detected.

I'm going to look into the power management device, Archos isn't implementing the battery monitor properly and thus it is always showing the battery very low. I think we can fix this by modifying how the battery information is presented to the OS. The battery monitor on my TouchPad does work properly, and I'm going to attempt to reformat the Archos battery output to match that of the TouchPad (also need to check my laptop to see if it matches).
[Gen8 Android Development] grim-a101:
Thanks for the clarification.

So I've already got a dmesg without anything plugged into the USB port, and here it is:

http://pastebin.com/XSg3Cuiv

I'll pastebin tomorow another one with an USB Drive plugged-in
[Gen8 Android Development] divx118:
CalcProgrammer1: In the dmesg line 187 is the touchscreen device for the 101.
[Gen8 Android Development] grim-a101:
Here it is, the dmesg with an USB drive plugged in:

http://pastebin.com/CTkV11mp

Hope it helps

I don't have seen many differences between those 2, I even wonder if it "see" the USB flash drive (I know for sure that my USB Host is OK, I can use a Keyboard/Mouse combo in Froyo)

EDIT : I've made another one, with another USB flash drive... I don't see any differences :/

http://pastebin.com/CVzwLAkY

EDIT Again: For what I've seen, it seems to me that there is no drivers for this particular device. Looking at drivers/hid/hid-ids.c, all we can find is:

#define USB_VENDOR_ID_UNITEC 0x227d
#define USB_DEVICE_ID_UNITEC_USB_TOUCH_0709 0x0709
#define USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19 0x0a19

So, the 0x0a1a is, if I understand well, not known. May be a good start point (I'll look into the archos kernel to see if we can find a 0x0a1a in there)

EDIT (Last one I hope): In the archos-gpl-gen8, there is what we are missing:

#define USB_VENDOR_ID_UNITEC 0x227d
#define USB_DEVICE_ID_UNITEC_PROTO_TS 0x0103

#define USB_DEVICE_ID_UNITEC_10_TS_V0 0x0a19
#define USB_DEVICE_ID_UNITEC_10_TS_V1 0x0a1a

#define USB_DEVICE_ID_UNITEC_7_TS_V0 0x0709
#define USB_DEVICE_ID_UNITEC_7_TS_V1 0x070a

I think this is a good starting point to resolve this issue, whereas I'm not sure what to do with that :s
[Gen8 Android Development] CalcProgrammer1:
Awesome info! I'm still not sure how the USB system works entirely, will be something to look into definitely.

For comparison, here's the dmesg from my A43 with a USB hub + keyboard and mouse attached at boot. This is also running 12.04

http://pastebin.com/Qzpuh9nh

Edit: Again, but this time with just a USB optical mouse plugged in (one of the old Dell ones)

http://pastebin.com/9iEavK1C

Looks like it doesn't think it can supply enough power to the device and just shuts off. I know the hardware is capable, I've used the hub, mouse, and keyboard on the OpenAOS kernel just fine plenty of times. It looks like the A43 is only registering a 50mA bus power limit while most devices request 100mA even if they aren't actually using it. I think the hardware is capable of at least 100mA.

Edit Again!

Looks like something that is set in archos-usb-musb.c, the value is 50 in the file but the comment says 100. Possibly a scalar has changed in the rest of the kernel code? I'm changed it to 100 and will see what happens, hopefully mouse will work.
[Gen8 Android Development] grim-a101:
I'm actually struggling with getting a Kernel source + .config that boot up on my a101.

I've reinstall a new box with Ubuntu 12.04, I've compiled the toolchain, but I've made so much test on all the kernel sources and .config that I have ... I'm a little lost.

Seems that I've found a .config that is working with Nicktime's git repo, I'll try to make the touchscreen working by adding the device ID in the generic touchscreen driver. I'll tell if that made a difference or not.

---------- Post added at 08:30 PM ---------- Previous post was at 08:04 PM ----------

GOT IT!

Well almost.

The touchscreen is reacting, but as the display is upside-down, the touchscreen is inverted (ie I have to touch the bottom-right side of the screen to click on the upper-left).

What I did (In nicktime's archos-linux-2-6-37-gen8) :

drivers/hid/hid-ids.h

replace:

#define USB_VENDOR_ID_UNITEC 0x227d
#define USB_DEVICE_ID_UNITEC_USB_TOUCH_0709 0x0709
#define USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19 0x0a19

by:

#define USB_VENDOR_ID_UNITEC 0x227d
#define USB_DEVICE_ID_UNITEC_USB_TOUCH_0709 0x0709
#define USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19 0x0a19

#define USB_DEVICE_ID_UNITEC_10_TS_V0 0x0a19
#define USB_DEVICE_ID_UNITEC_10_TS_V1 0x0a1a

In drivers/hid/hid-multitouch.c:

Replace

/* Unitec panels */
{ .driver_data = MT_CLS_DEFAULT,
HID_USB_DEVICE(USB_VENDOR_ID_UNITEC,
USB_DEVICE_ID_UNITEC_USB_TOUCH_0709) },
{ .driver_data = MT_CLS_DEFAULT,
HID_USB_DEVICE(USB_VENDOR_ID_UNITEC,
USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
{ }

by

/* Unitec panels */
{ .driver_data = MT_CLS_DEFAULT,
HID_USB_DEVICE(USB_VENDOR_ID_UNITEC,
USB_DEVICE_ID_UNITEC_USB_TOUCH_0709) },
{ .driver_data = MT_CLS_DEFAULT,
HID_USB_DEVICE(USB_VENDOR_ID_UNITEC,
USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
{ .driver_data = MT_CLS_DEFAULT,
HID_USB_DEVICE(USB_VENDOR_ID_UNITEC,
USB_DEVICE_ID_UNITEC_10_TS_V0) },
{ .driver_data = MT_CLS_DEFAULT,
HID_USB_DEVICE(USB_VENDOR_ID_UNITEC,
USB_DEVICE_ID_UNITEC_10_TS_V1) },

{ }

Those modifications just tell the hid-multitouch driver to handle the 0x0A1A device.

Now, I've got to find where in the .config (or source file) is the screen invertion.
[Gen8 Android Development] CalcProgrammer1:
Awesome! I'm trying to fix the USB issue on the A43 now too, but for some reason I can't even get it to boot properly (using arm-linux-gnueabi-gcc compiler included in Ubuntu, perhaps the update to 12.04 screwed it up?). I don't have much time today to keep working, but as soon as I can get my compiler fixed up and booting, I'll merge your changes.

You may try the screen rotation boot arguments as I described in the second post, though instead of rotating 90 degrees rotate 180. The A43's panel is oriented correctly with the touchscreen, but it's vertical and I want landscape, though doing that screws up the touchscreen as well for me.
[Gen8 Android Development] grim-a101:
Thanks!

omapfb.vrfb=y omapfb.rotate=2 on the CMDLINE did the trick!

The screen is now in the "good" direction, at least the same as the touchscreen.

I'll check later for the USB Host, I've kickly looked at the board-archos-a101it.c file, it seems to be defined a 500mA if read it correctly.

At least, now Ubuntu is usable, so I'll try to plug/unplug some stuff inside the USB Host and look at the syslog to see if there is some info in there
[Gen8 Android Development] grim-a101:
Well, I don't know if this is due to the fact that my rootfs is on a (bad?) SDCard, but the whole system is extremly slow, and can't really do anything once I'm logged id.

Plus, I can't get an onscreen keyboard (the a11y icon is not up there once logged in) and it's so laggy that I can't use the Unity main menu.

I'll maybe make a try on the Internal Memory, if I found how to make an extf3 partition without breaking everything (and not bricking it, my wife would kill me :D)

EDIT : I think I've figure this out (partitioning). Simply plug the device in Recovery / MMC, and resize the FAT32 in order to make place for the new ext3 one. Well, I first need to make some room, as it is only a 8Go A101IT!
[Gen8 Android Development] CalcProgrammer1:
When I used an SD card it was really slow too, not sure why. You can put "mmcX" as the LED trigger in the arch/arm/mach-omap2/archos-leds.c file under the power LED trigger. This will make the power LED into a disk activity LED and you will be able to tell if it's working or just plain locked up.

As long as you make your partition on the user drive you should be fine. I have 3 partitions on mine, the first should be the storage data drive though. Note that this kernel identifies blocks differently than the stock, MMC0 is the SD card in this kernel and if it is removed then MMC0 becomes the internal memory (really annoying) so when you set up your kernel cmdline for the new drive you must take into account whether or not you're going to have the SD card inserted.
[Gen8 Android Development] grim-a101:
That's what I've figured out. I'm actually resizing the FAT32 partition, and make a new ext3 after that.

I'll go for the start without SD Card, so I guess that my new root will be /dev/mmcblk0p2 (p1 is the FAT32 one I suppose).

---------- Post added at 12:07 AM ---------- Previous post was at 12:00 AM ----------

Not sure if this is the right things to do, but I'll go to editing

.default_trigger = "default-on",

into

.default_trigger = "mmc0",

Am I right?
[Gen8 Android Development] grim-a101:
Found myself that I was right :p

My new issue is that I must have miscopied my rootfs from my SDCard to my Internal Memory. The rootfs is well mounted, but it then complains about missing init.

I'm getting a fresh root from your 2 files from the first post, and see if it boots up
[Gen8 Android Development] CalcProgrammer1:
Make sure you set your root= cmdline properly, look at the init messages and you'll see when it mounts the card, if you leave your SD card in it should be /dev/mmcblk2p2 (mmcblk0 is SD, mmcblk1 is system, mmcblk2 is user). If you remove the SD then it is /dev/mmcblk1p2 (where mmcblk0 is system and mmcblk1 is user). The third mmc that it detects is actually the WLAN card which uses the SDIO interface.

Also, what compiler are you using? For some reason my builds aren't working and I don't know whether my compiler changed or my config is broken.
[Gen8 Android Development] grim-a101:
Don't know why, but with the SDCard in, if I use /dev/mmcblk2p2 as root, it complains about not being able to find it.

It now boots without SDCard in and with /dev/mmcblk1p2 as root. I'll try to understand later why it doesn't work with /dev/mmcblk2p2 and SDCard in.

Thanks again for all your explainations ;)

Let's see now if it runs smoother or not now that the rootfs is in internal memory

---------- Post added at 01:43 AM ---------- Previous post was at 01:39 AM ----------

I've build chrulri's toolchain from http://xdaforums.com/showthread.php?t=891056 on a fresh Ubuntu 12.04 (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5))

I use this command line to build my kernel:

INSTALL_MOD_PATH=~/archos/Ubuntu/Kernel/modules_install/ make ARCH=arm CROSS_COMPILE=~/archos/KernelBuild/archos/archos-gpl-gen8/buildroot/build_arm/staging_dir/usr/bin/arm-linux-uclibcgnueabi-

I can't build your git repo, so I use Nicktime's one

By the way, I don't know what's going wrong, but my A101 is stuck at the top left blicking cursor for a while now... something must be wrong with my rootfs :(
[Gen8 Android Development] CalcProgrammer1:
Thanks for the info on the toolchain. It definitely is a compiler issue as I just built the exact same .config, files, everything on 11.04 and 12.04, works fine with 11.04's compiler. I need to fix my root= again since I reset my configuration. In my repo there's a file called linux.config, that is the .config file to configure the kernel.

Do

cp linux.config .config

before compiling, then I'm building with

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j9

EDIT:

Fixed the A43 USB host errors, the USB constant of 50 should have been 100 which made it work properly. Weird thing is that the mouse works for a while and shuts off, seems to be the Ubuntu system shutting it off because the kernel set it up correctly. Might be my USB charging script, need to get switch working so I can dynamically select charging modes for A43's USB charging.
[Gen8 Android Development] grim-a101:
I've allready tried the linux.config file, but, doesn't work very well (can't remember exactly what was the issue, so I prefer not saying anything, but I'll try again for sure, maybe the missing -j9 is the key).

On my side, I'm still stuck with the blinking cursor... don't know exactly why. Maybe a permission issue... trying to figure that out

EDIT: here is the issue, when I launch the compilation (after copying linux.config into .config), it restart asking my for kernel config options

HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (ARCH_OMAP4 && ARCH_OMAP2PLUS) selects ARM_ERRATA_720789 which has unmet direct dependencies (CPU_V7 && SMP)
*
* Restart config...
*
*
* General setup
*
Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [Y/n/?] y
Cross-compiler tool prefix (CROSS_COMPILE) []
Local version - append to kernel release (LOCALVERSION) []
Automatically append version information to the version string (LOCALVERSION_AUTO) [N/y/?] n
Kernel compression mode
1. Gzip (KERNEL_GZIP)
2. LZMA (KERNEL_LZMA)
> 3. LZO (KERNEL_LZO)
choice[1-3?]: 3
Support for paging of anonymous memory (swap) (SWAP) [Y/n/?] y
System V IPC (SYSVIPC) [Y/n/?] y
POSIX Message Queues (POSIX_MQUEUE) [Y/n/?] y
BSD Process Accounting (BSD_PROCESS_ACCT) [Y/n/?] y
BSD Process Accounting version 3 file format (BSD_PROCESS_ACCT_V3) [N/y/?] n
Export task/process statistics through netlink (EXPERIMENTAL) (TASKSTATS) [N/y/?] n
Auditing support (AUDIT) [N/y/?] n
Kernel .config support (IKCONFIG) [N/m/y/?] n
Kernel log buffer size (16 => 64KB, 17 => 128KB) (LOG_BUF_SHIFT) [14] 14
enable deprecated sysfs features to support old userspace tools (SYSFS_DEPRECATED) [N/y/?] n
Kernel->user space relay support (formerly relayfs) (RELAY) [N/y/?] n
Initial RAM filesystem and RAM disk (initramfs/initrd) support (BLK_DEV_INITRD) [N/y/?] n
Optimize for size (CC_OPTIMIZE_FOR_SIZE) [Y/n/?] y
Enable the Anonymous Shared Memory Subsystem (ASHMEM) [N/y/?] (NEW)

As I am not for now an expert on archos kernel config, I go on Nicktime's one where I have found a .config file that doesn't ask me anything :p

EDIT: After a couple of "hitting enter", the compilation start, but I hit a:

CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
AS arch/arm/mach-omap2/omap44xx-smc.o
CC arch/arm/mach-omap2/omap4-common.o
Assembler messages:
Error: unknown architecture `armv7-a+sec'

Error: unrecognized option -march=armv7-a+sec
make[1]: *** [arch/arm/mach-omap2/omap44xx-smc.o] Erreur 1

that I don't know how to deal with...