Android for x86
[
Front page
] [
New
|
List of pages
|
Search
|
Recent changes
]
Start:
[[Android]]
- Contents
#contents
*Android-x86 1.6-r2 Donut [#w300a32c]
>
This section explain how to create a bootable USB drive f...
is developed at [[android-x86.org:http://www.android-x86....
equippwith Intel Atom Z500 series CPU. Since the single b...
storage, the boards use USB drive as storage. The porting...
the source files, and write the built files into a bootab...
booted from the USB drive.~
** Obtaining and Building Source Files. [#o55de2be]
>
Ubuntu 8.04 is used as the building environment.
- Obtain the source files.
The source files are downloaded form android-x86.org. At ...
create a directory will house the downloaded files. The f...
then move down to the newly created directly. The third c...
the source files, and the the fourth command line downloa...
$ mkdir android-x86-1.6r2
$ cd android-x86-1.6r2
$ repo init -u git://git.android-x86.org/platform/manife...
$ repo sync
-Build
First, identify the x86 machine. This targets an embedded...
Z500 family, but the x86 machine is defined as '''eeepc''...
$ make usb_img TARGET_PRODUCT=eeepc
After the build is completed, the directly '''android-x86...
been created, and in this directory, a holder '''android-...
such as, '''initrd.img''', '''install.img''', '''kernel''...
holder, it indicates that the build process has been succ...
$ cd ~/android-x86-1.6r2/out/target/product/eeepc/usb_boot
$ ls android-system
initrd.img install.img kernel ramdisk.img system.img
** Boot from USB derive [#z33dde67]
>
Format a USB device (2GB) in ext3. Then, copy '''android-...
this device can be bootable as '''vfat''' is used. Howeve...
is mounted at '''/media/disk/'''.
$ sudo cp -fr android-system /media/disk/
- Install grub
Caution: Pay attention to the directory below '''/dev''' ...
$ sudo grub-install --root-directory=/media/disk --no-fl...
- Configure grub
Edit '''menu.lst''' of grub
$ sudo vi /media/disk/boot/grub
$ sudo vi menu.lst
The contents of ''' menue.lst''' in the bootable USB driv...
which is located at '''/android-x86-1.6r2/out/target/prod...
targeted single board computer is US15W, the board is boo...
default=0
root (hd0,0)
title Live USB - VESA Mode
kernel /android-system/kernel root=/dev/ram0 and...
initrd /android-system/initrd.img
title Live USB - Debug Mode
kernel /android-system/kernel root=/dev/ram0 and...
initrd /android-system/initrd.img
>
This is the end of creation of bootable USB drive. To boo...
USB drive. After turning power on, check the boot order b...
of grub. Android starts booting. (Once Android is in susp...
*AOSP for x86 (Installing android-2.6.29 kernel)[#s04c09ab]
>
This explains how to build the kernel of Android Open Sou...
To follow the standard building procedure, two errors occ...
process. This identifies the causes of the errors and sho...
** Get kernel [#w122ae7a]
>
To prepare for building the kernel for x86, obtain the 2....
$ mkdir kernel
$ cd kernel
$ git clone git://android.git.kernel.org/kernel/common.g...
$ cd android_kernel
The first two commands create an empty directory which is...
the directory, respectively. The third command makes the ...
the '''kernel''' directly, and the original repository is...
Then, move into this directory.
$ git checkout --track -b android-2.6.29 origin/android-...
The command above creates a new branch for '''android-2.6...
The preparation is completed.
** android-2.6.29 [#y025882f]
>
This section explains how to build the '''android-2.6.29 ...
errors which occur during its building process. To build ...
errors in two files. Overall three parts of the two files...
>At the beginning, the kernel modules are needed to be co...
move down to the '''android_kernel''' directory in which ...
The third command copies the configuration file, '''.con...
$ cd ~/
$ cd kernel/android_kernel
$ cp arch/x86/configs/i386_defconfig .config
$ make menuconfig
The fourth command displays a curses-based terminal confi...
the kernel modules. The modules are need to be selected a...
the configurations of the modules are listed below.
|CENTER:Module|Enable|Disable|
|Enable the Anonymous Shared Memory Subsystem|CENTER:x||
|Wake lock|CENTER:x||
|Android pmem allocator||CENTER:x|
|Android alarm driver|CENTER:x||
|Android Drivers|CENTER:x||
|Android Binder IPC Driver|CENTER:x||
|Android log driver|CENTER:x||
|Android RAM buffer console|CENTER:x||
|Android Low Memory Killer|CENTER:x||
*** kernel/cpuset.c [#w37c4ae7]
>After start building the kernel, the first error is dete...
kernel/cpuset.c: In function ?cpuset_can_attach?:
kernel/cpuset.c:1360: error: ?task? undeclared (first us...
kernel/cpuset.c:1360: error: (Each undeclared identifier...
kernel/cpuset.c:1360: error: for each function it appear...
This error is caused by a simple typo. At the line of 135...
>
static int cpuset_can_attach(struct cgroup_subsys *ss,
struct cgroup *cont, struct...
{
struct cpuset *cs = cgroup_cs(cont);
int ret = 0;
+ // change task->tsk
+ // if ((current != task) && (!capable(CAP_SYS_ADM...
+ if ((current != tsk) && (!capable(CAP_SYS_ADMIN)...
const struct cred *cred = current_cred(),...
if (cred->euid != tcred->uid && cred->eu...
return -EPERM;
}
if (cpumask_empty(cs->cpus_allowed) || nodes_emp...
return -ENOSPC;
if (tsk->flags & PF_THREAD_BOUND) {
>
After '''task''' is changed to '''tsk''', making process ...
*** drivers/rtc/alarm.c [#zfb67774]
>The second error occurs in the '''alarm.c''' file. The e...
under the '''asm''' directly.
>
CC drivers/rtc/alarm.o
drivers/rtc/alarm.c:16:27: error: asm/mach/time.h: No su...
drivers/rtc/alarm.c: In function ?alarm_suspend?:
>
First, examine contents of the '''asm''' directly.
$ ls include/asm
asm-offsets.h
'''time.h''' is not detected. Only '''asm-offsets.h''' is...
the missing directly or file causes this error.
>
To fix this error, '''#include <asm/mach/time.h>''' is ne...
This preprocessor command is treated as a part of a set ...
Three preprocessor commands are added around the line 12 ...
The changes are shown below.~
>
* GNU General Public License for more details.
*
*/
+ #ifdef __i386__
+ #else
#include <asm/mach/time.h>
+ #endif
#include <linux/android_alarm.h>
#include <linux/device.h>
>
To respond to the changes described above, a set of condi...
needed to be added. This set of conditional compilation i...
conditional compilation above and contains the newly adde...
ported from '''arch/arm/kernel/time.c.'''
>
The conditional compilations and ported function are inse...
ends at the line 325. The details are shown below.
>
static void alarm_triggered_func(void *p)
{
struct rtc_device *rtc = alarm_rtc_dev;
if (!(rtc->irq_data & RTC_AF))
return;
ANDROID_ALARM_DPRINTF(ANDROID_ALARM_PRINT_INT, ...
wake_lock_timeout(&alarm_rtc_wake_lock, 1 * HZ);
}
+ #ifdef __i386__
+ // Port this function from arch/arm/kernel/time.c
+ /**
+ * save_time_delta - Save the offset between system tim...
+ * @delta: pointer to timespec to store delta
+ * @rtc: pointer to timespec for current RTC time
+ *
+ * Return a delta between the system time and the RTC t...
+ * that system time can be restored later with restore_...
+ */
+ static void save_time_delta(struct timespec *delta, st...
+ {
+ set_normalized_timespec(delta,
+ xtime.tv_sec - rtc->tv_sec,
+ xtime.tv_nsec - rtc->tv_nsec);
+ }
+ #endif
int alarm_suspend(struct platform_device *pdev, pm_messa...
{
int err = 0;
>
The two errors are fixed. The building process of the '''...
*Reference [#a7cc8926]
-Reference for the error in '''kernel/cpuset.c'''
--http://www.mail-archive.com/android-kernel@googlegroups...
--http://zash-egg.seesaa.net/article/131182492.html (in J...
-Reference for the error in '''drivers/rtc/alarm.c'''
--https://review.source.android.com/#patch,sidebyside,675...
End:
[[Android]]
- Contents
#contents
*Android-x86 1.6-r2 Donut [#w300a32c]
>
This section explain how to create a bootable USB drive f...
is developed at [[android-x86.org:http://www.android-x86....
equippwith Intel Atom Z500 series CPU. Since the single b...
storage, the boards use USB drive as storage. The porting...
the source files, and write the built files into a bootab...
booted from the USB drive.~
** Obtaining and Building Source Files. [#o55de2be]
>
Ubuntu 8.04 is used as the building environment.
- Obtain the source files.
The source files are downloaded form android-x86.org. At ...
create a directory will house the downloaded files. The f...
then move down to the newly created directly. The third c...
the source files, and the the fourth command line downloa...
$ mkdir android-x86-1.6r2
$ cd android-x86-1.6r2
$ repo init -u git://git.android-x86.org/platform/manife...
$ repo sync
-Build
First, identify the x86 machine. This targets an embedded...
Z500 family, but the x86 machine is defined as '''eeepc''...
$ make usb_img TARGET_PRODUCT=eeepc
After the build is completed, the directly '''android-x86...
been created, and in this directory, a holder '''android-...
such as, '''initrd.img''', '''install.img''', '''kernel''...
holder, it indicates that the build process has been succ...
$ cd ~/android-x86-1.6r2/out/target/product/eeepc/usb_boot
$ ls android-system
initrd.img install.img kernel ramdisk.img system.img
** Boot from USB derive [#z33dde67]
>
Format a USB device (2GB) in ext3. Then, copy '''android-...
this device can be bootable as '''vfat''' is used. Howeve...
is mounted at '''/media/disk/'''.
$ sudo cp -fr android-system /media/disk/
- Install grub
Caution: Pay attention to the directory below '''/dev''' ...
$ sudo grub-install --root-directory=/media/disk --no-fl...
- Configure grub
Edit '''menu.lst''' of grub
$ sudo vi /media/disk/boot/grub
$ sudo vi menu.lst
The contents of ''' menue.lst''' in the bootable USB driv...
which is located at '''/android-x86-1.6r2/out/target/prod...
targeted single board computer is US15W, the board is boo...
default=0
root (hd0,0)
title Live USB - VESA Mode
kernel /android-system/kernel root=/dev/ram0 and...
initrd /android-system/initrd.img
title Live USB - Debug Mode
kernel /android-system/kernel root=/dev/ram0 and...
initrd /android-system/initrd.img
>
This is the end of creation of bootable USB drive. To boo...
USB drive. After turning power on, check the boot order b...
of grub. Android starts booting. (Once Android is in susp...
*AOSP for x86 (Installing android-2.6.29 kernel)[#s04c09ab]
>
This explains how to build the kernel of Android Open Sou...
To follow the standard building procedure, two errors occ...
process. This identifies the causes of the errors and sho...
** Get kernel [#w122ae7a]
>
To prepare for building the kernel for x86, obtain the 2....
$ mkdir kernel
$ cd kernel
$ git clone git://android.git.kernel.org/kernel/common.g...
$ cd android_kernel
The first two commands create an empty directory which is...
the directory, respectively. The third command makes the ...
the '''kernel''' directly, and the original repository is...
Then, move into this directory.
$ git checkout --track -b android-2.6.29 origin/android-...
The command above creates a new branch for '''android-2.6...
The preparation is completed.
** android-2.6.29 [#y025882f]
>
This section explains how to build the '''android-2.6.29 ...
errors which occur during its building process. To build ...
errors in two files. Overall three parts of the two files...
>At the beginning, the kernel modules are needed to be co...
move down to the '''android_kernel''' directory in which ...
The third command copies the configuration file, '''.con...
$ cd ~/
$ cd kernel/android_kernel
$ cp arch/x86/configs/i386_defconfig .config
$ make menuconfig
The fourth command displays a curses-based terminal confi...
the kernel modules. The modules are need to be selected a...
the configurations of the modules are listed below.
|CENTER:Module|Enable|Disable|
|Enable the Anonymous Shared Memory Subsystem|CENTER:x||
|Wake lock|CENTER:x||
|Android pmem allocator||CENTER:x|
|Android alarm driver|CENTER:x||
|Android Drivers|CENTER:x||
|Android Binder IPC Driver|CENTER:x||
|Android log driver|CENTER:x||
|Android RAM buffer console|CENTER:x||
|Android Low Memory Killer|CENTER:x||
*** kernel/cpuset.c [#w37c4ae7]
>After start building the kernel, the first error is dete...
kernel/cpuset.c: In function ?cpuset_can_attach?:
kernel/cpuset.c:1360: error: ?task? undeclared (first us...
kernel/cpuset.c:1360: error: (Each undeclared identifier...
kernel/cpuset.c:1360: error: for each function it appear...
This error is caused by a simple typo. At the line of 135...
>
static int cpuset_can_attach(struct cgroup_subsys *ss,
struct cgroup *cont, struct...
{
struct cpuset *cs = cgroup_cs(cont);
int ret = 0;
+ // change task->tsk
+ // if ((current != task) && (!capable(CAP_SYS_ADM...
+ if ((current != tsk) && (!capable(CAP_SYS_ADMIN)...
const struct cred *cred = current_cred(),...
if (cred->euid != tcred->uid && cred->eu...
return -EPERM;
}
if (cpumask_empty(cs->cpus_allowed) || nodes_emp...
return -ENOSPC;
if (tsk->flags & PF_THREAD_BOUND) {
>
After '''task''' is changed to '''tsk''', making process ...
*** drivers/rtc/alarm.c [#zfb67774]
>The second error occurs in the '''alarm.c''' file. The e...
under the '''asm''' directly.
>
CC drivers/rtc/alarm.o
drivers/rtc/alarm.c:16:27: error: asm/mach/time.h: No su...
drivers/rtc/alarm.c: In function ?alarm_suspend?:
>
First, examine contents of the '''asm''' directly.
$ ls include/asm
asm-offsets.h
'''time.h''' is not detected. Only '''asm-offsets.h''' is...
the missing directly or file causes this error.
>
To fix this error, '''#include <asm/mach/time.h>''' is ne...
This preprocessor command is treated as a part of a set ...
Three preprocessor commands are added around the line 12 ...
The changes are shown below.~
>
* GNU General Public License for more details.
*
*/
+ #ifdef __i386__
+ #else
#include <asm/mach/time.h>
+ #endif
#include <linux/android_alarm.h>
#include <linux/device.h>
>
To respond to the changes described above, a set of condi...
needed to be added. This set of conditional compilation i...
conditional compilation above and contains the newly adde...
ported from '''arch/arm/kernel/time.c.'''
>
The conditional compilations and ported function are inse...
ends at the line 325. The details are shown below.
>
static void alarm_triggered_func(void *p)
{
struct rtc_device *rtc = alarm_rtc_dev;
if (!(rtc->irq_data & RTC_AF))
return;
ANDROID_ALARM_DPRINTF(ANDROID_ALARM_PRINT_INT, ...
wake_lock_timeout(&alarm_rtc_wake_lock, 1 * HZ);
}
+ #ifdef __i386__
+ // Port this function from arch/arm/kernel/time.c
+ /**
+ * save_time_delta - Save the offset between system tim...
+ * @delta: pointer to timespec to store delta
+ * @rtc: pointer to timespec for current RTC time
+ *
+ * Return a delta between the system time and the RTC t...
+ * that system time can be restored later with restore_...
+ */
+ static void save_time_delta(struct timespec *delta, st...
+ {
+ set_normalized_timespec(delta,
+ xtime.tv_sec - rtc->tv_sec,
+ xtime.tv_nsec - rtc->tv_nsec);
+ }
+ #endif
int alarm_suspend(struct platform_device *pdev, pm_messa...
{
int err = 0;
>
The two errors are fixed. The building process of the '''...
*Reference [#a7cc8926]
-Reference for the error in '''kernel/cpuset.c'''
--http://www.mail-archive.com/android-kernel@googlegroups...
--http://zash-egg.seesaa.net/article/131182492.html (in J...
-Reference for the error in '''drivers/rtc/alarm.c'''
--https://review.source.android.com/#patch,sidebyside,675...
Page: