How to port android to Asus p535

Source: Internet
Author: User
From: http://sites.google.com/site/siteofhx/Home/android/android-porting-steps

1. First of all, we all know that android is a software platform based on Linux. Most of the work of porting Android is actually porting from Linux to p535. Therefore, we need to first port Linux.

2. p535 was originally a Windows Mobile System (WM), so we need to solve the problem of how to boot from WM to Linux. It is impossible to Burn Boot. I only have one p535, but I don't want to change more than 3000 oceans into bricks. Fortunately, there is a good tool named Haret, which runs in WM and can directly read the Linux zimage file for Kernel loading. Therefore, to learn how to do this, you must first...
Learn Haret, Home: http://www.handhelds.org/moin/moin.cgi/HaRET

3. Compile a Linux Kernel File zimage that can run on p535. The zimage generated by Linux source code compilation downloaded from www.kernel.org cannot be directly run because of lack of driver support for the p535 hardware device. It is better to have a set of Linux source code that can directly support p535 devices? No. If so, it would be too boring. However, we can find a good starting point. Please visit:
Http://www.handhelds.org/moin/moin.cgi/GettingHandheldKernels
Handhelds is an organization. Their job is to transplant Linux to various PDAs, including HP, HTC, Dell, and Asus. They are all old models, not p535. The organization seems to have been busy for a year or two. The final version of their familiar project v0.84 was released on February 26, August 20. So it is impossible to expect them to update and support p535. I also tried to send emails and want to join their team. Nobody cares about me :(.

It seems that we can only be self-reliant. Although they are not updated, their websites are still standing. From the above link, we can download the latest Linux source code version 2.6.21 they maintain. This version is our starting point.

4. The downloaded source code is called handheld linux2.6.21. The difference between the source code and the official linux2.6.21 is that it adds driver support for many PDA devices. Although p535 is not included, we can refer to other similar devices to provide driver support for our devices. Other devices I used at the time were Asus a730, Asus 696, and HTC magician. Because many of the p535's hardware components have the same chip model as these devices.

How can we know what chips p535 uses? It takes a bit of effort to crack the machine! And it is very thorough. How can I experience the fun of working at the bottom layer ?! If you are not brave enough, refer to the photos taken after I split the machine.
Http://sites.google.com/site/siteofhx/Home/android/p535-hardware
I have already been physically disowned for dozens of times. Previously I had a big surgery to change the touch screen and upgrade the memory. It was really tough to survive.

5. I know the hardware chip model, but I don't know how to connect the pins, And I can't ask for circuit diagrams from ASUS. What should I do? Brothers who have carefully studied and practiced the previous steps may already have answers. Haret is a new tool, so if I want to practice magic, I must first ....

Through the Haret tool, we can know the gpio corresponding to each component in the p535. The most important thing is to understand the keyboard, LCD, and touch screen, the successful transplantation of these three hardware drivers is our primary goal, so that we can experience the pleasure of the android touch operation!

6. OK. After these preparations are completed, you can start to work hard, write code, compile, debug, copy, and paste. If it is a few days faster, if it is a few weeks slower, finally, a zimage file that can run on its own machine is produced.

By the way, use this cross compiler:
Http://www.codesourcery.com/gnu_toolchains/arm/portal/package3696/public/arm-none-linux-gnueabi/arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

7. zimage can only access the command line interface of black paint at most, and cannot verify whether the keyboard, LCD, and touch screen work normally. To solve this problem, you can go here:
Http://familiar.handhelds.org/releases/v0.8.4/install/files/ipaq-pxa270/
Download a rootfs system, prepare an idle SD card, remove the downloaded file to the card, and then use Haret to guide you to run the Linux kernel. Then, run the initialization script in rootfs, go to the GUI of Gpe or Opie, and then you can verify that your keyboard, LCD, and touch screen drivers are working properly.

If it is not normal, let's continue working hard.

8. After the last step, Linux porting has been under your feet. You must have a sense of attention and accomplishment. Don't worry. Let's continue to climb up.

The Linux version used by Android SDK 1.0 is 2.6.25, and the version we just transplanted is 2.6.21. Do you know what is the difference between them? We recommend a great tool here, meld diff viewer, with which the subsequent work will become easier.
Download an official 2.6.25 copy from kernel.org, and compare it with the handheld 2.6.21 you just completed. It's a big surprise! Are there many changes? Don't be afraid. Let's do it step by step.

Our previous porting was based on the handheld version. It seems that we have climbed onto the shoulders of others. It doesn't matter. At least we learned to crawl. Now let's go back to the ground and climb on our own.
Download another official 2.6.21 copy from kernel.org, and compare it with the previous handheld 2.6.21 using meld to merge the drivers missing from the official version, look at what your p535 lacks to merge, so that you know exactly which drivers need to be added from the officially downloaded Linux to run on your machine.

After the merge, compile and debug your official version 2.6.21 so that it can run smoothly and enter the GPE and Opie graphic interfaces.

9. Compare the successfully transplanted official 2.6.21 with the previously downloaded official 2.6.25. Is the difference worse? Similarly, the driver files missing from 2.6.25 are combined from 2.6.21, compiled and debugged, and 2.6.25 is also run.

10. OK. Now we have to deal with Android.
First download the Linux version of Android, address in this: http://code.google.com/p/android/downloads/list
Download Android SDK 1.0: http://code.google.com/android/download.html
Follow this tutorial to extract Android rootfs: http://discuz-android.blogspot.com/2008/01/extract-google-android-file-system.html from the SDK

Now it's worse than Android's Linux zimage.

11. Compare Android linux2.6.25 with the previous official linux2.6.25, to find out the similarities and differences between them, and combine the things missing from official 2.6.25 from Android linux2.6.25. Be sure not to make a wrong direction. Among them, any content involving qemu, goldfish and yaffs2 is useless and should not be merged. You will find that android has made minor changes to Linux.
For more information about this step, see this link: http://elinux.org/Android_on_OMAP

Then compile and get a zimage. debug it so that it can smoothly guide the initialization script into Android rootfs.

12. The graphic interface for guiding to Android is not as smooth as that for GPE and Opie. Because android has special requirements on LCD drivers, the frame buffer driver must support double buffering and Pan functions. You need to refer to this post: http://androidzaurus.seesaa.net/article/105551643.html or http://www.androidrd.com/thread-9-1-1.html to complete the modifications to the 2.6.25 built-in frame buffer driver.

After the LCD driver is complete, you can see the glittering Android robot and enter the exciting Android interface.

13. But wait. The touch screen is not working yet! If there is a beautiful interface, where can we not touch the pleasure? So be sure to hold on and complete this last step.
The key to porting the touchscreen driver is that when the 2.6.25 wm97xx touch driver clicks the screen in the pen, the btn_touch event is not sent to the upper layer. This works normally in Gpe, but Android ignores you, no response at all. Therefore, modify your driver and ask it to send a love message to Android!

In addition, the X coordinate sent by the touch driver is correct, and the Y coordinate is reversed. You need to modify the drive to correct the posture. Reference: http://androidzaurus.seesaa.net/article/90045743.html

Enjoy!

If you have any questions, please leave a message in BBS.
For more information about the migration files, see revelant porting files.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.