Jump to content

Advent Vega kernel source code now available!


Guest PaulOBrien

Recommended Posts

Guest craskman

After messing up with my Vega, I couldn't boot anymore.

I was trying to find a way to re-flash only the boot image, so I wouldn't have to flash everything again.

I couldn't find any thread specifically describing this but I decided to play around with nvflash.

So, with the following command I manage to put paul's r2 boot.img back.

nvflash.exe --bl bootloader.bin --download 7 boot-paul.img --go

bootloader.img --> original which comes with advent 1.08 file.

number 7 is the ID of the boot partition.

Now I have my vega as it was. (kinda easy, it will be easier to mess around with the kernel again:) )

CrK

Link to comment
Share on other sites

Guest simonta
After messing up with my Vega, I couldn't boot anymore.

I was trying to find a way to re-flash only the boot image, so I wouldn't have to flash everything again.

I couldn't find any thread specifically describing this but I decided to play around with nvflash.

So, with the following command I manage to put paul's r2 boot.img back.

nvflash.exe --bl bootloader.bin --download 7 boot-paul.img --go

bootloader.img --> original which comes with advent 1.08 file.

number 7 is the ID of the boot partition.

Now I have my vega as it was. (kinda easy, it will be easier to mess around with the kernel again:) )

CrK

A slightly easier way is to use flash_image and ADB (no reference to partitions and no need for recovery).

If you don't have flash_image already in /data/local (or some other place you want to store it):

adb push flash_image /data/local

adb shell chmod 4755 /data/local/flash_image

adb push boot.img /data/local

adb shell flash_image boot /data/local/boot.img

If you already have flash_image in place (recommended)

adb push boot.img /data/local

adb shell flash_img boot /data/local/boot.img

Link to comment
Share on other sites

Paul,.. I was digging around and found the reason.

I found a modified elf.h for cross compiling on macosx targeting linux. This might help others.

http://ben-collins.blogspot.com/2010/07/cr...l-from-mac.html

Now it is running/compiling (no error so far but still in the middle of it).

Still, would be interesting to know your (or other) tricks you have made, most likely I am still missing some.

Thanks again,

CrK

Which toolchain are you using? I'm using 4.4.3 from the Gingerbread AOSP, specifically:

make -j8 ARCH=arm CROSS_COMPILE=~/ROMraid/gingerbread/prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-

P

Link to comment
Share on other sites

Guest Buzing Bee

Paul im compiling the wifi module separately but you seem to have a way around that .... how are u getting the original module to load ?

many thanks in advanced

Link to comment
Share on other sites

Guest martinbrook

azareus22,

thanks for the pointer to the usb code.

If I boot with USB1Property set to _host instead of device in the harmony tree my keyboard is recognised by the kernel,

Jan 30 04:48:32 localhost klogd: [ 6.243414] usb 1-1: New USB device found, idVendor=413c, idProduct=2106

Jan 30 04:48:32 localhost klogd: [ 6.248271] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0

Jan 30 04:48:32 localhost klogd: [ 6.253131] usb 1-1: Product: Dell QuietKey Keyboard

Jan 30 04:48:32 localhost klogd: [ 6.258027] usb 1-1: Manufacturer: Dell

Jan 30 04:48:32 localhost klogd: [ 6.263092] usb 1-1: configuration #1 chosen from 1 choice

but later in the boot process I get

Jan 30 04:48:32 localhost klogd: [ 8.583754] usb 1-1: USB disconnect, address 2

and my keyboard does not work.

the disconnect line does not appear in a log from the usbhost kernel from the mobii which does recognise the keyboard.

I work with svn and git and I know how to do reverts, but it is not normal to have to reverse the changes to have the original source code, this has a name... fork ;) .

In https://github.com/paulobrien/android_kerne...dm_query.c#L718 Usb2Property is asigned with NvOdmUsbModeType_Host.

In https://github.com/paulobrien/android_kerne...dm_query.h#L967 it defines NvOdmUsbModeType_Host and NvOdmUsbModeType_Device

Changing Usb2Property or Usb3Property is probable that we can change host to slave. I think that Usb2Property is the USB controller for touchscreen eGalax and camera.

Link to comment
Share on other sites

Guest craskman

@Simonta: Yes you right, I always use the ADB method BUT this time I couldn't boot my vega to use ADB, so in order to fix the boot I found that using nvflash to re-frash the boot.img only,.. it works. If there is anyway of doing it with ADB (wihout booting or just in bega's recovery mode) please share, would be great.

@Paul: I have used the tool chain "arm-eabi-4.4.0" and "arm-eabi-4.4.3" from cyanogen (nexus) git. I will be trying with AOSP version as per your suggestion. Can you share your .config,.. I think the secret relies on there:)

I will be posting my progress, there are a couple of things I would like to try:

- patch the kernel with BFS and deadline IO sched

- try to merge with tegra 2.6.35 or 36 (loads of improvements around CPU shed CFS)

In meantime if there are brave chaps doing these, please let me know.

CrK

Link to comment
Share on other sites

Guest azareus22
azareus22,

thanks for the pointer to the usb code.

If I boot with USB1Property set to _host instead of device in the harmony tree my keyboard is recognised by the kernel,

Jan 30 04:48:32 localhost klogd: [ 6.243414] usb 1-1: New USB device found, idVendor=413c, idProduct=2106

Jan 30 04:48:32 localhost klogd: [ 6.248271] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0

Jan 30 04:48:32 localhost klogd: [ 6.253131] usb 1-1: Product: Dell QuietKey Keyboard

Jan 30 04:48:32 localhost klogd: [ 6.258027] usb 1-1: Manufacturer: Dell

Jan 30 04:48:32 localhost klogd: [ 6.263092] usb 1-1: configuration #1 chosen from 1 choice

but later in the boot process I get

Jan 30 04:48:32 localhost klogd: [ 8.583754] usb 1-1: USB disconnect, address 2

and my keyboard does not work.

the disconnect line does not appear in a log from the usbhost kernel from the mobii which does recognise the keyboard.

Hi martinbrook

In the webcam driver https://github.com/paulobrien/android_kerne.../shuttle.c#L672 you must add comments to the USB0 gpio hack. It works to me.

Link to comment
Share on other sites

Guest craskman

Paul,

I was looking into the compilers (on MacOSx).

I am updating the cross compiler with this git (http://android.git.kernel.org/?p=platform/prebuilt.git;a=summary)

Also, I forgot to say that I was using the darwin10-gcc4.2 as host compiler.

There are some bits on the kernel compilation that requires the host CC, thats why I had to port the elf.h into the headers of darwin10-gcc42.

Reading a bit ahead, seems that I should use gcc44 host compiler from macports, do you confirm?

Which host cc are you using?

Thanks,

CrK

Edited by craskman
Link to comment
Share on other sites

@Simonta: Yes you right, I always use the ADB method BUT this time I couldn't boot my vega to use ADB, so in order to fix the boot I found that using nvflash to re-frash the boot.img only,.. it works. If there is anyway of doing it with ADB (wihout booting or just in bega's recovery mode) please share, would be great.

@Paul: I have used the tool chain "arm-eabi-4.4.0" and "arm-eabi-4.4.3" from cyanogen (nexus) git. I will be trying with AOSP version as per your suggestion. Can you share your .config,.. I think the secret relies on there:)

I will be posting my progress, there are a couple of things I would like to try:

- patch the kernel with BFS and deadline IO sched

- try to merge with tegra 2.6.35 or 36 (loads of improvements around CPU shed CFS)

In meantime if there are brave chaps doing these, please let me know.

CrK

Hmmm, I built with the default config and it builds OK... you can get my config from /proc/config.gz on a running device too! ;)

P

Link to comment
Share on other sites

Paul,

I was looking into the compilers (on MacOSx).

I am updating the cross compiler with this git (http://android.git.kernel.org/?p=platform/prebuilt.git;a=summary)

Also, I forgot to say that I was using the darwin10-gcc4.2 as host compiler.

There are some bits on the kernel compilation that requires the host CC, thats why I had to port the elf.h into the headers of darwin10-gcc42.

Reading a bit ahead, seems that I should use gcc44 host compiler from macports, do you confirm?

Which host cc are you using?

Thanks,

CrK

My host compiler is i686-apple-darwin10-gcc-4.2.1...

I don't have gcc installed as part of my macports build (and 'which' indeed confirms the above is being used).

P

Link to comment
Share on other sites

Guest craskman

Paul,

Yes I can get the config.gz (lazzy me).

I really thought you weren't using the darwin-gcc, so we have pretty much the same setup. Do you remember if you had to 'manually' add the "elf.h" from somewhere to the header folder of darwin-gcc? (it is required but doesn't exist by default)

Nonetheless, tonight I will try my setup with your .config. This "smells" like a small tiny 'little' thing somewhere ;)

Thanks,

CrK

Link to comment
Share on other sites

Paul,

Yes I can get the config.gz (lazzy me).

I really thought you weren't using the darwin-gcc, so we have pretty much the same setup. Do you remember if you had to 'manually' add the "elf.h" from somewhere to the header folder of darwin-gcc? (it is required but doesn't exist by default)

Nonetheless, tonight I will try my setup with your .config. This "smells" like a small tiny 'little' thing somewhere ;)

Thanks,

CrK

Hmmm, I don't remember doing that, but i've had this machine built a while so it's possible! ;)

P

Link to comment
Share on other sites

Guest craskman

Finally got it working... ;)

The compilers are fine (apart of the elf.h needs to be ported manually to darwin-gcc)

Turns out that was indeed a small tiny little thing...

I was using mkbootimg like this:

mkbootimg --kernel zImage --ramdisk ramdisk-vega.gz -o boot-vega.img --cmdline '--base 0x10000000 --pagesize 2048'

And its wrong, should be:

mkbootimg --kernel zImage --ramdisk ramdisk-vega.gz -o boot-vega.img --base 0x10000000 --pagesize 2048

And voila, everything works now. Lets the fun begin:)

Thanks guys,

CrK

Link to comment
Share on other sites

Guest dannight

Not 100% sure on this one but I swear I read that the Vega supports up to 4 fingers, and I read somewhere on here that the fact that we can only detect 2 currently was a kernel limitation.

Is this correct? I'd love it if t'were but a simple fix. If I'm wrong I'll shut up ;)

Link to comment
Share on other sites

Guest craskman

Hi Paul (again)

So, last week I setup a baseline for the kernel. Everything works fine (compilers, crosscompilers, etc), it's based on your osx branch and your config file.

Yesterday I was trying to follow the same steps but with with a different source, the tegra kernel from android git (http://android.git.kernel.org/?p=kernel/tegra.git;a=summary) which is 2.6.36 kernel.

I had to fix few things to compile on osx (scripts includes like you did) and also the yaffs2 wasnt compiling due a known issue. I just port the yaffs2 section directly form their git. So, in the end I manage to compile successfully a 2.6.36 kernel (I use you config file as start point, then I had to check few other/new options). The prob,.. again,.. it doesn't boot (not even the 'booting...' string) and I cant get the typical boot messages as we do in linux, so I could see where it is failing.

So my questions are:

1) did you try to compile the 2.6.36 kernel already?

2) how can we show the boot messages rather than the boot image screen?

Thanks again,

CrK

PS: btw, I tried to patch your kernel with BFS, again no probs with that but didn't boot either. I got stucked with the string "booting...". really need to find ways to debug/see the boot messages to check where it fails. Cant find good info about that.

Link to comment
Share on other sites

  • 4 weeks later...
Guest dconde
Hi Paul (again)

So, last week I setup a baseline for the kernel. Everything works fine (compilers, crosscompilers, etc), it's based on your osx branch and your config file.

Yesterday I was trying to follow the same steps but with with a different source, the tegra kernel from android git (http://android.git.kernel.org/?p=kernel/tegra.git;a=summary) which is 2.6.36 kernel.

I had to fix few things to compile on osx (scripts includes like you did) and also the yaffs2 wasnt compiling due a known issue. I just port the yaffs2 section directly form their git. So, in the end I manage to compile successfully a 2.6.36 kernel (I use you config file as start point, then I had to check few other/new options). The prob,.. again,.. it doesn't boot (not even the 'booting...' string) and I cant get the typical boot messages as we do in linux, so I could see where it is failing.

So my questions are:

1) did you try to compile the 2.6.36 kernel already?

2) how can we show the boot messages rather than the boot image screen?

Thanks again,

CrK

PS: btw, I tried to patch your kernel with BFS, again no probs with that but didn't boot either. I got stucked with the string "booting...". really need to find ways to debug/see the boot messages to check where it fails. Cant find good info about that.

Hi Crk,

I've been trying the same and I'm seeing the same as you, did you get any further on this?

Link to comment
Share on other sites

Guest craskman

Hi conde,

Not really, lack of time for this to be honest.

I am willing to give another go on [git://android.git.kernel.org/kernel/tegra.git] honey kernel.

Also, about changing boot options/cmdline, no luck. I think those options are 'hardcoded' in the bootloader.img and as far as i know, we dont have sources for that. I tried to set boot commands in the kernel and through mkbootimg, but no luck. Actually, if you set any cmdline in the mkbootimg then your kernel wont boot at all. In the kernel, seems those cmds will be ignored. So, probably we need another bootloader (or sources).

Finally, I notice that nvflash is quite sensible (or probably my vega). If I flash boot.img a couple of times, I will get stuck in the nvflash recovery and the boot partition gets corrupted (also using the traditional adb flash). So, the best way I found to avoid corruptions in the boot partition is to follow the procedure described by advent and replace their boot.img with mine, and make sure that nvflash recovery perform its 'natural' reboot in the end (if not, most likely the boot part is not good). This way, it is guaranteed that my boot partition is not corrupted. And if doesn't work is because of the kernel itself (or its options).

I will post here if I manage to boot the 'honey' kernel. btw, for those with issues on getting in recovery mode,.. just turn off completely the vega, then remove the power cable, then wait 5 seconds and connect again. Then, do the sequence and it will work. Never fail with me and I already mess my vega a lot.

CrK

Link to comment
Share on other sites

Guest craskman

Hi,

Good news and bad news.

Bad news is that I still can't boot the honey kernel, and the good news is that finally I manage to get the boot messages output.

As I suspected, the kernel commands are coded in the bootloader and anything else will be ignored.

Once we don't have the bootloader source code, I decided to have a go with oldschool cracking technics:) So basically I open the bootloader.bin in a hexeditor and tried to find for the 'console' stuff. Easily I found it, then edit.

By default the kernel cmdline is (console bit)

console=none console=ttyS0,115200

So, I knew the last one was the important one, so I've changed to:

console=ttyS0,115200 console=tty0

note: we need to preserve the same number of characters, lucky both combinations have exactly the same number of characters.

And thats it, finally I can see the boot messages.

Another bad news is that the honey kernel gets stuck before the initial boot messages :( can't see a bloody thing.

The boot messages start a bit before the 'loading...' string.

Hope this helps someone,.. I've spent hours searching for this info and until today I haven't found.

Any tips about the .config options for the honey kernel (for android) I really appreciate.

btw, in the boot messages I can see loads of bad blocks (tegra-nand), I think that explains why every 'now and then' I have to flash the whole thing to test kernels. I didnt give too much use (only flashing kernels), I wonder if your vegas have bad blocks as well. It seems that is not just the display that is rubbish, the nand flash seems to be cheap as well.

CrK

Link to comment
Share on other sites

Guest dconde
Hi,

Good news and bad news.

Bad news is that I still can't boot the honey kernel, and the good news is that finally I manage to get the boot messages output.

As I suspected, the kernel commands are coded in the bootloader and anything else will be ignored.

Once we don't have the bootloader source code, I decided to have a go with oldschool cracking technics:) So basically I open the bootloader.bin in a hexeditor and tried to find for the 'console' stuff. Easily I found it, then edit.

By default the kernel cmdline is (console bit)

console=none console=ttyS0,115200

So, I knew the last one was the important one, so I've changed to:

console=ttyS0,115200 console=tty0

note: we need to preserve the same number of characters, lucky both combinations have exactly the same number of characters.

And thats it, finally I can see the boot messages.

Another bad news is that the honey kernel gets stuck before the initial boot messages :( can't see a bloody thing.

The boot messages start a bit before the 'loading...' string.

Hope this helps someone,.. I've spent hours searching for this info and until today I haven't found.

Any tips about the .config options for the honey kernel (for android) I really appreciate.

btw, in the boot messages I can see loads of bad blocks (tegra-nand), I think that explains why every 'now and then' I have to flash the whole thing to test kernels. I didnt give too much use (only flashing kernels), I wonder if your vegas have bad blocks as well. It seems that is not just the display that is rubbish, the nand flash seems to be cheap as well.

CrK

Crk,

I didn't have an issue in passing parameters to the kernel at boot time. Using fastboot with the -c parameter worked fine for me. I left instructions on how to access fast boot at http://android.modaco.com/index.php?s=&amp...t&p=1620277

Link to comment
Share on other sites

Guest craskman

Dconde,

Thanks for the info, actually I read that post but didnt realise that were you. I thought the mkbootimg was similar process as fastboot but more stable. But if you tried it, i will give it a go.

Have you tried to compile the honey kernel (2.6.36) on vega?

I tried loads of stuff, by this time I would expect at least to see the initial boot process. Seems that there is something missing on this kernel sources to work with vega (or harmony boards). I was browsing the sources (vega and honey) and I saw some missing bits on honey kernel. The ODM kit files are not there, still not sure if they are necessary. I though that perhaps the honey kernel wouldn't need those. Then there are few drivers missing as well, but that is secondary for now.

Does anyone already got a successful boot with the honey kernel (just boot not android itself)? (from android branch, not linux)

I wonder what is really lacking on this honey kernel, seems to be a very little thing:)

CrK

Link to comment
Share on other sites

Guest craskman

Dconde,

Just tried fastboot,.. indeed makes everything quicker to test. Also, I am not getting corruptions, probably coz we dont actually flash the partition 7 all the time with fastboot.

I've compiled few more kernels, and with fastboot we can just run/boot the zImage without ramdisk. So, the zImage from honey kernel will show up for sure,... unfortunately that still not happening. Cant really find what is wrong with this kernel on vega hardware.

I will continue posting on the thread you mention (makes more sense) [Kernel 2.6.36 build for Vega] http://android.modaco.com/index.php?showto...t&p=1620277

Cya around and post any progress

CrK

Link to comment
Share on other sites

Guest the_corvus

Please, can you upload your bootloader, because i have made this change and get nothing at boot...

Corvus

Dconde,

Just tried fastboot,.. indeed makes everything quicker to test. Also, I am not getting corruptions, probably coz we dont actually flash the partition 7 all the time with fastboot.

I've compiled few more kernels, and with fastboot we can just run/boot the zImage without ramdisk. So, the zImage from honey kernel will show up for sure,... unfortunately that still not happening. Cant really find what is wrong with this kernel on vega hardware.

I will continue posting on the thread you mention (makes more sense) [Kernel 2.6.36 build for Vega] http://android.modaco.com/index.php?showto...t&p=1620277

Cya around and post any progress

CrK

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.