Android Porting On Real Target/ko
1. Introduction ¶±¸±ÛÀº ¾Èµå·ÎÀ̵尡 ¿î¿µÃ¼Á¦, ¹Ìµé¿þ¾î ±×¸®°í Áß¿ä ÇÁ·Î±×·¥À» Æ÷ÇÔÇÏ´Â ÀÓº£µðµå µð¹ÙÀ̽º¸¦ À§ÇÑ ¼ÒÇÁÆ®¿þ¾î ½ºÅÃÀ̶ó°í ¼³¸íÇÕ´Ï´Ù. ÀÌ ¹®¼´Â ±¸±Û ¾Èµå·ÎÀÌµå ¾ÆÅ°ÅØó¿¡ ´ëÇØ ¼³¸íÇÏ°í ½ÇÁ¦ Çϵå¿þ¾î¿¡ Æ÷ÆÃÇÏ´Â ÀýÂ÷¸¦ ¼³¸íÇÕ´Ï´Ù. ¼³¸íÀº ¾Èµå·ÎÀÌµå ¿¡¹Ä·¹ÀÌÅÍÀÇ m3 SDK ¹öÀü¿¡ ±âÃÊÇؼ ¼³¸íÇÕ´Ï´Ù.
¿©·¯ºÐÀÌ Ä¿³Î ÆÐÄ¡, ÆÐÄ¡ÀÇ °ÅºÎ ÇØ°á, ·¥µð½ºÅ© À̹ÌÁö ¸¸µé±â, ¸®´ª½º Ä¿³Î ÀÚü¿¡ ´ëÇÑ ÃæºÐÇÑ Áö½ÄÀ» °¡Áö°í ÀÖ´Ù¸é ÀÌ ¾ÆƼŬÀº ½¬¿ï °ÍÀÔ´Ï´Ù.
2. Copyright and Acknowledgements ¶ÀÌ ¹®¼ÀÇ ¼ÒÀ¯±ÇÀº Kwangwoo Lee <Kwangwoo.lee@gmailREMOVETHIS.com> ¿¡°Ô ÀÖ½À´Ï´Ù. ÀÌ ¹®¼¿¡ ´ëÇÑ º¹»ç, ¹èÆ÷, ¼öÁ¤¿¡ ´ëÇÑ ±Ç¸®´Â GNU Free Documentation License ¸¦ µû¸¨´Ï´Ù.
¹ø¿ªÀº ¾çÁ¤¼®(dasomoli@gmailREMOVETHIS.com) ÀÌ ÇÏ¿´½À´Ï´Ù¸¸, ÀÌ»óÇÑ °÷ÀÌ ÀÖ´Ù¸é °¡Â÷¾øÀÌ ¼öÁ¤ÇØ ÁÖ¼¼¿ä.
¿ø¹® : http://wiki.kldp.org/wiki.php/AndroidPortingOnRealTarget
3.1. ¾Èµå·ÎÀ̵å Ä¿³Î ¶¾Èµå·ÎÀ̵å Ä¿³ÎÀÇ °¡Àå Å« Â÷ÀÌÁ¡Àº ARM EABI(Embedded Application Binary Interface)¿Í OpenBinder IPC(Inter Process Communication)¸¦ »ç¿ëÇÑ´Ù´Â °ÍÀÔ´Ï´Ù. ¿©·¯ºÐÀÌ ARM EABI¸¦ Áö¿øÇÏ´Â Ä¿³ÎÀ» ÄÄÆÄÀÏÇÏ·Á¸é, ARM EABI¸¦ Áö¿øÇϱâ À§ÇÑ ÅøüÀÎ(toolchains)À» »õ·Î ºôµåÇÏ¿©¾ß ÇÕ´Ï´Ù.
¾Èµå·ÎÀ̵å SDK´Â Qemu¸¦ »ç¿ëÇÏ¿© goldfish ¾ÆÅ°ÅØó¸¦ ¿¡¹Ä·¹À̼ÇÇÕ´Ï´Ù. alsa´Â ¾Èµå·ÎÀ̵åÀÇ ¿Àµð¿À¸¦ À§Çؼ »ç¿ëµË´Ï´Ù. goldfish ¾ÆÅ°ÅØó µð·ºÅ丮ÀÇ audio.c ÆÄÀÏÀ» º¸°í, µå¶óÀ̹ö´Â ¾Èµå·ÎÀÌµå ½Ã½ºÅÛ »óÀÇ ¿Àµð¿À¸¦ À§ÇÑ /dev/eac¸¦ »ç¿ëÇÕ´Ï´Ù. ¶ÇÇÑ RTC(Real Time Clock) ÀåÄ¡´Â /dev/rtc0¸¦ ÅëÇØ »ç¿ëµË´Ï´Ù.
´ÙÀ½ ÆÄÆ®µéÀº ÁÖµÈ Â÷ÀÌÁ¡À» ¼³¸íÇÕ´Ï´Ù:
3.1.1. ARM EABI ¶EABI´Â ARM»ç(ARM Ltd.)¿¡ ÀÇÇÑ »õ·Î¿î "ÀÓº£µðµå" ABIÀÔ´Ï´Ù. ±× Â÷ÀÌ´Â µ¥ºñ¾È À§Å°¿¡ Á¤¸®µÇ¾î ÀÖ½À´Ï´Ù.
long ftruncate64(unsigned int fd, loff_t length); ÀÇ ¿¹: ±âÁ¸ ABI: - put fd into r0 (fd¸¦ r0·Î ³ÖÀ½) - put length into r1-r2 (±æÀ̸¦ r1-r2·Î ³ÖÀ½) - Ä¿³Î È£ÃâÀ» À§Çؼ "swi #(0x900000 + 194)" »ç¿ë. »õ·Î¿î ARM EABI: - put fd into r0 (fd¸¦ r0·Î ³ÖÀ½) - put length into r2-r3 (skipping over r1) (±æÀ̸¦ r2-r3·Î ³ÖÀ½. r1Àº ¹«½Ã) - put 194 into r7 (194¸¦ r7·Î ³ÖÀ½) - use "swi 0" to call the kernel (Ä¿³ÎÀ» È£ÃâÇϱâ À§Çؼ "swi 0" »ç¿ë) ¾Èµå·ÎÀ̵å´Â EABI Ä¿³Î ±â´ÉÀ» »ç¿ëÇÕ´Ï´Ù. CONFIG_AEABI ¿Í CONFIG_OABI_COMPATÀÇ Ä¿³Î ¿É¼ÇÀ» È°¼ºÈ Çϼ¼¿ä. ¿©·¯ºÐÀº ´ÙÀ½°ú °°Àº ½ÇÇà ¹ÙÀ̳ʸ®ÀÇ Â÷À̸¦ º¼ ¼ö ÀÖ½À´Ï´Ù:
$ arm-softfloat-linux-gnu-objdump -x t7-demo | grep private private flags = 202: [APCS-32] [FPA float format] [software FP] [has entry point] $ file t7-demo t7-demo: ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.4.3, dynamically linked (uses shared libs), for GNU/Linux 2.4.3, stripped
$ arm-softfloat-linux-gnueabi-objdump -x t7-demo | grep private private flags = 4000002: [Version4 EABI] [has entry point] $ file t7-demo t7-demo: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), for GNU/Linux 2.6.14, stripped ARM ¾ÆÅ°ÅØó¸¦ À§ÇÑ ABI°¡ ¹«¾ùÀΰ¡¿ä? ARM EABI¿Í °°Àº °Ç°¡¿ä?
ARM ¾ÆÅ°ÅØóÀÇ ABI´Â ARM¿Í (CodeSourcery¸¦ Æ÷ÇÔÇÏ´Â) ±× ÆÄÆ®³Êµé¿¡ ÀÇÇØ °³¹ßµÈ ¾î¶»°Ô ÄÄÆÄÀÏ·¯¿Í ¾î¼Àºí·¯¿Í ¸µÄ¿¿Í ´Ù¸¥ ºñ½ÁÇÑ ÅøµéÀÌ Object ÆÄÀÏ°ú ½ÇÇà ÆÄÀÏÀ» »ý¼ºÇؾ߸¸ ÇÏ´ÂÁö¸¦ ¼³¸íÇϴ ǥÁØÀÔ´Ï´Ù. ARM ¾ÆÅ°ÅØóÀÇ ABI¸¦ Á¤È®È÷ ±¸ÇöÇÑ ÅøµéÀº »óÈ£ ¿î¿ë(interoperate)µÉ ¼ö ÀÖ½À´Ï´Ù:¿¹¸¦ µé¸é, ´Ù¸¥ ÅøüÀο¡¼ ºôµåµÈ Object ÆÄÀÏ°ú ¶Ç ´Ù¸¥ ÅøüÀο¡¼ ºôµåµÈ ObjectÆÄÀÏÀÌ ¾ç ÂÊÀÇ ÄÄÆÄÀÏ·¯°¡ ARM ¾ÆÅ°ÅØóÀÇ ABI¸¦ »ç¿ëÇÑ´Ù¸é ÇÔ²² ÇÕÃÄÁú ¼ö ÀÖ½À´Ï´Ù. "ARM EABI"´Â ARM ¾ÆÅ°ÅØó ABIÀÇ ¶Ç´Ù¸¥ À̸§ÀÔ´Ï´Ù.
3.1.2. OpenBinder ¶OpenBinder´Â °´Ã¼ÁöÇâ(object-oriented) ¿î¿µÃ¼Á¦ ȯ°æÀ» Á¦°øÇÕ´Ï´Ù. ÀüÅëÀûÀÎ Ä¿³Î¿¡ È£½ºÆÃ(to be hosted)µÇ¾îÁöµµ·Ï ¼³°èµÇ¾ú½À´Ï´Ù. ÀÌ ÇÁ·ÎÁ§Æ®´Â BeOS ´ÙÀ½¹ø »ý¼ºÀÇ ÀϺηΠBe. Inc¿¡¼ ½ÃÀ۵Ǿú°í, Cobalt ½Ã½ºÅÛÀÇ ÄÚ¾î ºÎºÐÀ¸·Î PalmSource¿¡ ±¸ÇöÀÌ ¿Ï·áµÇ¾ú½À´Ï´Ù.
±× °ÍÀº ½Ã½ºÅÛÀÌ Application¿¡ ÁöÇ⺸´Ù´Â ÄÄÆ÷³ÍÆ® ¾ÆÅ°ÅØó¿¡ ÁöÇâÀûÀÌ°í, ÇÁ·Î¼¼½º °£ÀÇ IPC, ½º·¹µåÇ®, ¸Þ¸ð¸® °ü¸®¿Í Ŭ¸° ¾÷(clean up) ±â´ÉÀ» ¹ÙÀδõ ObejctÀÇ ÂüÁ¶ÀÇ ³¡¿¡¼ Á¦°øÇÕ´Ï´Ù.
¹Ù´Ò¶ó(vanilla) Ä¿³ÎÀº OpenBinder IPC ¸ÞÄ«´ÏÁòÀ» °¡Áö°í ÀÖÁö ¾ÊÀ¸¹Ç·Î, ¿©·¯ºÐÀº Ä¿³Î¿¡ ÆÐÄ¡ÇÏ¿©¾ß ÇÕ´Ï´Ù. OpenBinder´Â ½Ã½ºÅÛÀÇ ½º·¹µå °ü¸®¸¦ /dev/binder¸¦ ÅëÇؼ Á¦°øÇÕ´Ï´Ù. ±× °ÍÀÌ ¾Èµå·ÎÀ̵尡 ½º·¹µå ¶óÀ̺귯¸®¸¦ Á¦°øÇÏÁö ¾Ê´Â ÀÌÀ¯ÀÔ´Ï´Ù.
3.1.3. ÇÁ·¹ÀÓ ¹öÆÛ ¶±âº»ÀûÀÎ ÇÁ·¹ÀÓ ¹öÆÛ µå¶óÀ̹ö´Â ÀÌ¹Ì ±¸ÇöµÇ¾îÁ® ÀÖ¾î¾ß¸¸ ÇÕ´Ï´Ù. ±× ÈÄ¿¡ ¿©·¯ºÐÀº ¿©·¯ºÐÀÇ ¾ÆÅ°ÅØó µå¶óÀ̹ö¿Í goldfish µå¶óÀ̹ö °£ÀÇ Â÷À̸¦ ±¸ÇöÇØ¾ß ÇÒ °ÍÀÔ´Ï´Ù.
goldfish ¾ÆÅ°ÅØóÀÇ ÇÁ·¹ÀÓ ¹öÆÛ µå¶óÀ̹ö´Â struct fp_opsÀÇ fb_pan_display ÇÔ¼ö¸¦ Áö¿øÇÕ´Ï´Ù. ±× °ÍÀº ½ÇÁ¦ ÇÁ·¹ÀÓ Å©±âº¸´Ù µÎ ¹èÀÇ ¸Þ¸ð¸®°¡ ÇÒ´çµÇ¾î¾ß ÇÔÀ» ÀǹÌÇÕ´Ï´Ù.
struct fb_info *fbinfo; ... fbinfo->fix.ypanstep = 1; fbinfo->var.yres_virtual = gm->lcd.yres * 2; fbinfo->fix.smem_len = (gm->lcd.xres * gm->lcd.yres * gm->lcd.bpp / 8) * 2;
struct mvfb_info *fbi; ... fbi->map_size = PAGE_ALIGN(fbi->fb->fix.smem_len + PAGE_SIZE); fbi->map_cpu = dma_alloc_writecombine(fbi->dev, fbi->map_size, &fbi->map_dma, GFP_KERNEL);
static int mvfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *fb) { ... } static struct fb_ops mvfb_ops = { .owner = THIS_MODULE, .fb_check_var = mvfb_check_var, .fb_set_par = mvfb_set_par, .fb_setcolreg = mvfb_setcolreg, .fb_blank = mvfb_blank, .fb_pan_display = mvfb_pan_display, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, .fb_mmap = mvfb_mmap, }; ±× µð¹ÙÀ̽º ÆÄÀÏÀº /dev/graphics/fb0¿¡ À§Ä¡ÇØ ÀÖ½À´Ï´Ù.
3.1.4. ÀÔ·Â ÀåÄ¡ ¶¾Èµå·ÎÀ̵å´Â »ç¿ëÀÚ ÀÔ·ÂÀ» À§ÇÑ À̺¥Æ® µð¹ÙÀ̽º¸¦ »ç¿ëÇÕ´Ï´Ù. °Å±â¿¡´Â Å°Æеå¿Í ÄõƼ2(qwerty2) Å°º¸µå¿Í ¸¶¿ì½º¿Í °°Àº ¼¼°¡Áö µð¹ÙÀ̽º°¡ ÀÖ½À´Ï´Ù. ÄõƼ2(qwerty2) Å°º¸µå¿Í ¸¶¿ì½º´Â º¸Åë µð¹ÙÀ̽ºÀÔ´Ï´Ù. ±×·¡¼ ¸¶¿ì½º µð¹ÙÀ̽º¸¦ ´ëüÇÏ´Â Å°Æеå¿Í ÅÍÄ¡½ºÅ©¸°À» ¼³¸íÇÏ°Ú½À´Ï´Ù.
¾Èµå·ÎÀÌµå ½©¿¡¼ /proc/bus/input/{devices,handlers}¸¦ cat Çϸé, ¾Èµå·ÎÀ̵忡¼ »ç¿ëµÇ´Â µð¹ÙÀ̽ºµéÀ» º¼ ¼ö ÀÖ½À´Ï´Ù.
$ adb shell # cat /proc/bus/input/devices I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="goldfish-events-keyboard" P: Phys= S: Sysfs=/class/inut/input0 U: Uniq= H: Handlers=kbd mouse0 event0 ... # # cat /proc/bus/input/handlers N: Number=0 Name=kbd N: Number=1 Name=mousedev Minor=32 N: Number=2 Name=evdev Minor=64 #
±× Ãâ·Â Çü½ÄÀº input_event ±¸Á¶Ã¼ ÀÔ´Ï´Ù. ±×·¡¼ °¢ eventÀÇ Ãâ·ÂÀº ½Ã°£À» À§ÇÑ 8 ¹ÙÀÌÆ®, ŸÀÔÀ» À§ÇÑ 2 ¹ÙÀÌÆ®, Äڵ带 À§ÇÑ 2 ¹ÙÀÌÆ®, °ªÀ» À§ÇÑ 4¹ÙÀÌÆ®·Î ÃÑ 16 ¹ÙÀÌÆ®ÀÔ´Ï´Ù. ¸®´ª½º Ä¿³Î ¼Ò½º ÄÚµåÀÇ Documentation/input µð·ºÅ丮ÀÇ ÀÔ·Â À̺¥Æ® µð¹ÙÀ̽º(input event device)¿¡ °üÇÑ input.txt¸¦ Àаí, input-programming.txt¸¦ ÀÐÀ¸¼¼¿ä.
struct input_event { struct timeval time; unsigned short type; unsigned short code; unsigned int value; }; Tiger7 °³¹ß º¸µå´Â ±× °íÀ¯ÀÇ scancode Å×À̺íÀ» °¡Áý´Ï´Ù. ´ÙÀ½Àº °³¹ßº¸µåÀÇ Å° ·¹À̾ƿô°ú scancode Å×À̺í°ú ¾Èµå·ÎÀ̵å Å° Äڵ带 º¸ÀÔ´Ï´Ù:
/* * Key Layout Scancode Table * * 1 2 3 0x1 0x10 0x100 * 4 5 6 0x2 0x20 0x200 * 7 8 9 0x4 0x40 0x400 * * 0 # 0x8 0x80 0x800 */ static unsigned short android_keycode[] = { /* * 0x66 0x67 0x9e Home Up Back * 0x69 0xe8 0x6a Left Ok Right * 0xe7 0x6c 0x6b Send Down Hangup * 0xe5 Menu just_distinction_for_private */ KEY_HOME, KEY_UP, KEY_BACK, KEY_LEFT, KEY_REPLY, KEY_RIGHT, KEY_SEND, KEY_DOWN, KEY_END, KEY_KBDILLUMDOWN, KEY_RESERVED, KEY_PLAY }; ¿¡¹Ä·¹ÀÌÅÍ¿¡´Â Àü¿ø(power) ¹öÆ°ÀÌ ÀÖ½À´Ï´Ù. ±×·¯³ª Ãâ·Â °ªÀ» ¾ò±â À§Çؼ ¹«½ÃÇß½À´Ï´Ù.
Å°ÆеåÀÇ ÀÎÅÍ·´Æ®°¡ °¨Áö(caught)µÇ¸é À§ Å×À̺íÀÇ ¾Èµå·ÎÀ̵åÀÇ Å° ÄÚµå·Î scancode¸¦ º¯È¯ÇÏ°í »ç¿ëÀÚ °ø°£(user space) ÇÁ·Î±×·¥À¸·Î À̺¥Æ®¸¦ º¸³À´Ï´Ù.
... keycode = translate_keycode(scancode); ... input_event(keydev->input, EV_KEY, keycode, KEY_PRESSED); or input_event(keydev->input, EV_KEY, keycode, KEY_RELEASED); ... °íÁ¤¹Ðµµ ŸÀÌ¸Ó - hrtimer´Â Å°Æеå debounce¸¦ ÁÙÀ̱â À§Çؼ »ç¿ëµÇ¾ú½À´Ï´Ù.
# cat /proc/bus/input/devices I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="MVT7 KEYPAD" P: Phys= S: Sysfs=/class/input/input0 U: Uniq= H: Handlers=kbd event0 evbug B: EV=f ... I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="TSC2007 Touchscreen" P: Phys=0-0090/input0 S: Sysfs=/class/input/input1 U: Uniq= H: Handlers=event1 evbug B: EV=b B: KEY=400 0 0 0 0 0 0 0 0 0 0 B: ABS=1000003 # cat /proc/bus/input/handlers N: Number=0 Name=kbd N: Number=1 Name=evdev Minor=64 N: Number=2 Name=evbug °á°ú¿¡¼ º¸´Â °Í°ú °°ÀÌ, ÇÁ·Î±×·¥ °èÃþ(application layer)¿¡¼ Å°Æеå´Â /dev/input/event0¸¦ »ç¿ëÇÏ°í, ÅÍÄ¡½ºÅ©¸° ÀÎÅÍÆäÀ̽º´Â /dev/input/event1¸¦ »ç¿ëÇÕ´Ï´Ù.
3.1.5. Low Memory Killer ¶¸®´ª½º Ä¿³ÎÀº ÇÁ·Î¼¼½ºÀÇ ¿äûÀ» À§ÇÑ ÇÒ´çÀ» À§Çؼ ³²Àº ¸Þ¸ð¸®°¡ ¾ø´Â »óȲÀ» À§ÇÑ OOM(Out of Memory) ų·¯¸¦ °¡Áö°í ÀÖ½À´Ï´Ù. ±× °ÍÀº ¸ðµç ÇÁ·Î¼¼½º¸¦ ½ÃÇèÇÏ°í ¾î¶² Á¦¾àÀ¸·Î Á¡¼ö¸¦ ¸Å±é´Ï´Ù. ÃÖ°í Á¡¼öÀÇ initÀ» Á¦¿ÜÇÑ ÇÁ·Î¼¼½º´Â Á׿©Áý´Ï´Ù.
¾Èµå·ÎÀ̵åÀÇ Low Memory Killer´Â OOM ų·¯¿Í ¾à°£ ´Ù¸¨´Ï´Ù. ±× °ÍÀº ±×·ìÀÇ Á߿伺¿¡ µû¶ó ÇÁ·Î¼¼½º¸¦ ºÐ·ùÇÏ°í °¡Àå ³·Àº ±×·ìÀÇ ÇÁ·Î¼¼½º¸¦ Á×ÀÔ´Ï´Ù. ±× °ÍÀº ½Ã½ºÅÛÀ» ÃÖÁ¾ »ç¿ëÀÚ(end user) °üÁ¡¿¡¼ ¾ÈÁ¤ÀûÀÌ°Ô ¸¸µì´Ï´Ù. ¿¹¸¦ µé¸é, UI ÇÁ·Î¼¼½º - foreground process -´Â ÃÖÁ¾ »ç¿ëÀÚ¿¡°Ô °¡Àå Áß¿äÇÑ ÇÁ·Î¼¼½ºÀÔ´Ï´Ù. ±×·¡¼ ÇÁ·Î¼¼½º¸¦ ÁöÅ°´Â °ÍÀº ´Ù¸¥ background ÇÁ·Î¼¼½ºÀÇ »îÀ» ÁöÅ°´Â °Íº¸´Ù ´õ ¾ÈÁ¤ÀûÀ¸·Î º¸ÀÌ´Â °ÍÀ» »ì¸³´Ï´Ù.
Ä¿³Î ÆÐÄ¡ ÈÄ¿¡ CONFIG_LOW_MEMORY_KILLER ¸¦ È°¼ºÈÇϼ¼¿ä.
3.1.6. ¾Èµå·ÎÀÌµå ·Î°Å(Android Logger) ¶¿©·¯ºÐÀÌ ÀÌ ±â´ÉÀ» È°¼ºÈÇϸé /dev/log/main¸¦ ÅëÇØ ¾Èµå·ÎÀ̵忡 °üÇÑ À¯¿ëÇÑ Á¤º¸¸¦ º¼ ¼ö ÀÖ½À´Ï´Ù. main, events, radio °°Àº /dev/log »óÀÇ ¼¼°¡Áö µð¹ÙÀ̽º ÆÄÀÏÀÌ ÀÖ½À´Ï´Ù. /dev/log/radio ÆÄÀÏÀº ¾Èµå·ÎÀÌµå ½Ã½ºÅÛ »óÀÇ ¸ðµ©°ú ril µ¥¸ó - rild - ¿¡ °ü·ÃµÈ °ÍÀ» º¸¿©ÁÝ´Ï´Ù.
ÀÌ ·Î°Å¸¦ È°¼ºÈÇÒ¶§, ½Ã½ºÅÛ ¼º´ÉÀº ½Ã½ºÅÛ »ó¿¡¼ ¾à°£ ´À·ÁÁý´Ï´Ù. ÀÌ ±â´ÉÀ» »ç¿ëÇϱâ À§Çؼ CONFIG_ANDROID_LOGGER¸¦ È°¼ºÈÇϼ¼¿ä.
3.1.7. ¾Èµå·ÎÀ̵å ÆÄ¿ö(Android power) ¶¾Èµå·ÎÀ̵å ÆÄ¿ö´Â µð¹ÙÀ̽º »óÀÇ ¹èÅ͸® °ü¸®°ú Àü¿ø °ü¸®¿¡ °ü·ÃµÈ ÆÄÀÏ ½Ã½ºÅÛ »óÀÇ inotify ±â´É°ú °°Àº ¼ºê½Ã½ºÅÛÀ» À§ÇÑ °ÍÀÔ´Ï´Ù. ±× °ÍÀº ¾Èµå·ÎÀÌµå ½Ã½ºÅÛÀÇ init ¹ÙÀ̳ʸ®¸¦ ÅëÇØ ¾Èµå·ÎÀ̵带 ½ÃÀÛÇϱâ À§Çؼ ÇÊ¿äÇÕ´Ï´Ù. ±×·¯³ª runtime ¹ÙÀ̳ʸ®´Â ¾Èµå·ÎÀ̵åÀÇ ¼öµ¿ ½ÃÀÛ »ó¿¡¼ ¾Èµå·ÎÀ̵å ÆÄ¿ö¿¡ µû¸£´Â ¾î¶² ÆÄÀÏ - /sys/android_power/acruire_partial_wake_lock - À» ã°í ½ÃÀÛ¿¡ ½ÇÆÐÇÕ´Ï´Ù. »ç¿ëÇϱâ À§Çؼ´Â CONFIG_ANDROID_POWER ¿É¼ÇÀ» È°¼ºÈ½ÃÅ°¼¼¿ä.
3.1.8. Panic Timeout ¶°³¹ß º¸µå »óÀÇ ¾Èµå·ÎÀÌµå ½ÃÀÛÀ» À§Çؼ ÇÊ¿ä¾ø½À´Ï´Ù. CONFIG_PANIC_TIMEOUT ¸¦ ¿øÇÏ´Â °ªÀ¸·Î ¼³Á¤Çϼ¼¿ä.
3.2. ¾Èµå·ÎÀÌµå ·çÆ® ÆÄÀÏ ½Ã½ºÅÛ ¶¾Èµå·ÎÀÌµå ¿¡¹Ä·¹ÀÌÅÍ´Â tools/lib/imagesµð·ºÅ丮 »ó¿¡ 3°³ÀÇ ±âº» À̹ÌÁö¸¦ °¡Áý´Ï´Ù.
system.img ¿Í userdata.img ´Â VMS Alpha ½ÇÇàÆÄÀÏÀÔ´Ï´Ù. system.img¿Í userdata.img ´Â ·çÆ® ÆÄÀÏ ½Ã½ºÅÛ »óÀÇ /system °ú /data µð·ºÅ丮ÀÇ ³»¿ëÀ» °¡Áý´Ï´Ù. ±×µéÀº NAND µð¹ÙÀ̽º »ó¿¡ yaffs2 ÆÄÀÏ ½Ã½ºÅÛÀ¸·Î ¸ÊÇεǾî ÀÖ½À´Ï´Ù. /dev/block/mtdblock0 ´Â /system ÀÌ°í, /dev/block/mtdblock1 Àº /data ÀÔ´Ï´Ù.
/system µð·ºÅ丮´Â ¶óÀ̺귯¸®¿Í ±âº» ½Ã½ºÅÛ ÆÐÅ°Áö(*.apk)¸¦ °¡Áö°í ÀÖ½À´Ï´Ù. /data µð·ºÅ丮´Â ŸÀÓÁ¸, ij½¬, ApiDemos.apk ÆÐÅ°Áö¸¦ °¡Áö°í ÀÖ½À´Ï´Ù.
ÁÖ ¼ºñ½º´Â zygote(/system/bin/app_process), runtime(/system/bin/runtime), ±×¸®°í dbus(/system/bin/dbus-daemon) ÀÔ´Ï´Ù. ¿©·¯ºÐÀº ¾Èµå·ÎÀÌµå ·¥µð½ºÅ© »óÀÇ /etc/init.rc ÆÄÀÏÀ» º¼ ¼ö ÀÖ½À´Ï´Ù.
... zygote { exec /system/bin/app_process args { 0 -Xzygote 1 /system/bin 2 --zygote } autostart 1 } runtime { exec /system/bin/runtime autostart 1 } ... dbus { exec /system/bin/dbus-daemon args.0 --system args.1 --nofork autostart 1 } ... 3.3. ¾Èµå·ÎÀ̵å ÆÐÅ°ÁöÀÇ ¶óÀ̼¾½º ¶tools/lib/images/NOTICE ´Â ÆÐÅ°Áö ¸®½ºÆ®¿Í °¢ ¶óÀ̺귯¸®ÀÇ ¶óÀ̼¾½º¸¦ Æ÷ÇÔÇÏ°í ÀÖ½À´Ï´Ù. ¶óÀ̼¾½º Ç¥´Â 2008 Korea Android Summit¿¡¼ ÀÓ±Ù½Ä ¾¾ÀÇ ¹ßÇ¥·ÎºÎÅÍ °Ô½ÃµÇ¾ú½À´Ï´Ù.
4. ARM EABI¸¦ Áö¿øÇÏ´Â ÅøüÀÎ ¶ÅøüÀÎÀº ½Ã½ºÅÛ °³¹ß¿¡ »ç¿ëµÇ¾îÁö´Â ÅøµéÀ» ¸»ÇÕ´Ï´Ù. C/C++ ÄÄÆÄÀÏ·¯, ¸µÄ¿, ¶óÀ̺귯¸®, binutils¿Í ±âŸ ´Ù¸¥ °ÍµéÀ» Æ÷ÇÔÇÕ´Ï´Ù. ¾Èµå·ÎÀ̵å Ä¿³Î°ú ½Ã½ºÅÛÀº EABI Áö¿øÀ» ÇÊ¿ä·Î ÇÕ´Ï´Ù. ±×·¡¼ ±âÁ¸ ÅøüÀÎÀº ¾Èµå·ÎÀÌµå ½Ã½ºÅÛÀ» ¸¸µå´Âµ¥ ȣȯµÇÁö ¾Ê½À´Ï´Ù.
4.1. ÅøüÀÎ ºôµåÇϱ⠶´õ ½±°Ô »îÀ» »ì±â À§Çؼ, Dan Kegel¿¡ ÀÇÇÑ crosstool-0.43 ½ºÅ©¸³Æ®(http://www.kegel.com/crosstool/ )¸¦ »ç¿ëÇß½À´Ï´Ù. ºÒÇàÈ÷µµ ±× °ÍÀº eabi ÅøüÀÎÀ» ºôµåÇϱâ À§ÇÑ Áö¿øÀ» ÇÏÁö ¾Ê½À´Ï´Ù. ±×·¡¼ Khem RajÀÇ a glibc 2.5+ nptl build for arm softfloat eabi patch (http://sources.redhat.com/ml/crossgcc/2006-12/msg00076.html )¸¦ Àû¿ëÇß½À´Ï´Ù.
$./arm-softfloat-eabi.sh ³×Æ®¿öÅ©°¡ ¿¬°áµÇ¾î ÀÖ´Ù¸é, ½ºÅ©¸³Æ®°¡ gcc 4.1.1 °ú glibc 2.5À» »ç¿ëÇؼ ÅøüÀÎÀ» ´Ù¿î·ÎµåÇÏ°í ºôµåÇØ ÁÙ °Ì´Ï´Ù.
4.2. ´Ù¸¥ ÅøüÀÎ ¶Codesourcery ÅøüÀÎÀ» »ç¿ëÇÏÁö ¾Ê¾Ò½À´Ï´Ù¸¸, ±×µéÀº ±× °ÍÀÌ ¾Èµå·ÎÀÌµå ½Ã½ºÅÛ ºôµå¸¦ À§Çؼ Àß µ¿ÀÛÇÒ °ÍÀ̶ó°í ¸»ÇÏ°í ÀÖ½À´Ï´Ù.
5. Ä¿³Î ¶½ÇÁ¦ Çϵå¿þ¾î »ó¿¡ ¾Èµå·ÎÀ̵带 Æ÷ÆÃÇÏ´Â °ÍÀº Benno (http://benno.id.au )¿¡ ÀÇÇؼ ½ÃÀ۵Ǿú½À´Ï´Ù. ¿©·¯ºÐÀº ±×ÀÇ ºí·Î±×¿¡¼ À¯¿ëÇÑ Á¤º¸¸¦ º¼ ¼ö ÀÖ½À´Ï´Ù. ±×ÀÇ ºí·Î±×´Â pre-compiled static binaries¸¦ ¸µÅ©ÇÕ´Ï´Ù. ±×°ÍÀº ¾Èµå·ÎÀÌµå ½Ã½ºÅÛ µð¹ö±ë¿¡ ¸Å¿ì À¯¿ëÇÕ´Ï´Ù. ¿©·¯ºÐ ¿ª½Ã, static build busybox¿Í strace ¹ÙÀ̳ʸ®¸¦ ºôµåÇÒ ¼ö ÀÖÁö¸¸, °®´Ù ¾²´Â °Ô ´õ ÁÁÀ» °Ì´Ï´Ù.
¿©·¯ºÐÀº ¾Èµå·ÎÀ̵å Ä¿³Î°ú ¹Ù´Ò¶ó Ä¿³Î 2.6.23 ¹öÀü »çÀÌÀÇ Â÷À̸¦ Æ÷ÇÔÇÑ ÆÐÄ¡ ÆÄÀÏÀ» ¾òÀ» ¼ö ÀÖ½À´Ï´Ù. ±× °ÍÀº ±×°Íµé »çÀÌÀÇ ¸ðµç Â÷À̸¦ °¡Áý´Ï´Ù. ±×·¡¼ ¿©·¯ºÐÀº ±×°ÍµéÀÇ ÀϺθ¦ ÃßÃâÇÒ ÇÊ¿ä°¡ ÀÖ°í, ¿©·¯ºÐÀÇ ½Ã½ºÅÛ ¾ÆÅ°ÅØó¸¦ À§ÇÑ ¿©·¯ºÐ °íÀ¯ÀÇ ÆÐÄ¡¸¦ ¸¸µé ¼ö ÀÖ½À´Ï´Ù.
¿¹¸¦ µé¸é, ¾Èµå·ÎÀ̵å Ä¿³ÎÀº ±× °íÀ¯ÀÇ yaffs ÆÄÀÏ ½Ã½ºÅÛ ÆÐÄ¡¸¦ °¡Áý´Ï´Ù. ¿©·¯ºÐÀÇ ¾ÆÅ°ÅØó»ó¿¡¼ ¿©·¯ºÐ °íÀ¯ÀÇ yaffs ³ª jffs2 °°Àº ¾î¶² ´Ù¸¥ ÆÄÀÏ ½Ã½ºÅÛÀ» °¡Áø´Ù¸é, yaffs ÆÐÄ¡ÀÇ ÀϺθ¦ Á¦°ÅÇØ¾ß ÇÕ´Ï´Ù. ¾Èµå·ÎÀ̵å Ä¿³ÎÀÌ ¿¡¹Ä·¹ÀÌÆ®ÇÏ´Â qemu »óÀÇ ARM ¾ÆÅ°ÅØóÀÇ goldfish ¾ÆÅ°ÅØó´Â ¿©·¯ºÐÀÇ ¾ÆÅ°ÅØóÀÇ ÀϺΰ¡ µÉ ÇÊ¿ä°¡ ¾ø½À´Ï´Ù. Á¦°Å µÉ ¼ö ÀÖ½À´Ï´Ù.
¾Èµå·ÎÀ̵å Ä¿³ÎÀº ARMv5 ¸í·ÉÀ» ¿¡¹Ä·¹ÀÌÆ®ÇÕ´Ï´Ù. ±×·¡¼ ARM926EJ-S (ARMv5TEJ)´Â ÀÛ¾÷Çϱ⠸ſì ÁÁÀ» °Ì´Ï´Ù.
5.1. Ä¿³Î ÆÐÄ¡ ¶Benno ´Â openmokoÀÇ NEO1973 µð¹ÙÀ̽º·Î ÀÛ¾÷Çß½À´Ï´Ù. ±×·¡¼ ±×´Â ±× °ÍÀ» À§ÇÑ ÆÐÄ¡ ÆÄÀÏÀ» ¸¸µé¾ú½À´Ï´Ù. http://benno.id.au/blog/2007/11/21/android-neo1973 ¿¡¼ ¿øº» ÆÐÄ¡ ÆÄÀÏÀ» ¾ò°í, android.diff¸¦ »ç¿ëÇß½À´Ï´Ù. ±× °ÍÀº goldfish, qemu, yaffs ±×¸®°í ¾Èµå·ÎÀ̵忡 ƯÁ¤ÀûÀÎ ºÎºÐ¿¡ °üÇÑ ÀüºÎ¸¦ °¡Áö°í ÀÖ½À´Ï´Ù.
¿©·¯ºÐÀº Á÷Á¢ ÆÐÄ¡ ÆÄÀÏÀ» ÆíÁýÇÏ°í Á¦°ÅÇÒ ¼ö ÀÖ½À´Ï´Ù. goldfish¿Í qemu¿¡ ƯÁ¤ÀûÀÎ ºÎºÐÀ» Á¦¿ÜÇÑ binder, ¾Èµå·ÎÀ̵å ÆÄ¿ö, ¾Èµå·ÎÀÌµå ·Î°Å, low memory ų·¯¸¦ Æ÷ÇÔÇÏ´Â ÆÐÄ¡¸¦ ¸¸µç ÈÄ¿¡ ¹Ù´Ò¶ó ¸®´ª½º Ä¿³Î 2.6.23À» ¾ò°í, ±× °É·Î ÆÐÄ¡Çϼ¼¿ä.
¿©·¯ºÐÀÌ 2.6.24.1 ¹öÀü ¸®´ª½º Ä¿³ÎÀ» »ç¿ëÇÑ´Ù¸é ¾Èµå·ÎÀ̵å ÆÄ¿ö¿¡ °ü·ÃµÈ ºÎºÐÀÌ µ¿ÀÛÀ» À§Çؼ ºñÈ°¼ºÈ µÇ°Å³ª ÀûÀýÈ÷ °íÃÄÁ®¾ß ÇÕ´Ï´Ù.
5.2. .config ¶
... CONFIG_PANIC_TIMEOUT=0 CONFIG_AEABI=y CONFIG_OABI_COMPAT=y CONFIG_BINDER=y CONFIG_LOW_MEMORY_KILLER=y ...
... # CONFIG_ANDROID_GADGET is not set # CONFIG_ANDROID_RAM_CONSOLE is not set # CONFIG_ANDROID_POWER is not set # CONFIG_ANDROID_LOGGER is not set ... 6. ·çÆ® ÆÄÀÏ ½Ã½ºÅÛ ¶·çÆ® ÆÄÀÏ ½Ã½ºÅÛÀº ·¥ »óÀÇ ±âº» ·¥µð½ºÅ© À̹ÌÁö, NAND dev0 (/dev/block/mtdblock0) ±×¸®°í, NAND dev1 (/dev/block/mtdblock1)ÀÇ ÀÚ·á À̹ÌÁö, ¼¼°¡Áö ºÎºÐÀ¸·Î Á¦À۵Ǿî ÀÖ½À´Ï´Ù. MTD µð¹ÙÀ̽º´Â yaffs2 ÆÄÀÏ ½Ã½ºÅÛÀ» °¡Áö°í °¢°¢Àº ¾Èµå·ÎÀÌµå ¿¡¹Ä·¹ÀÌÅÍ »ó¿¡¼ 64MiB ¿ë·®À» °¡Áý´Ï´Ù.
ÃßÃâµÈ system °ú data µð·ºÅ丮´Â ½ÇÁ¦ Á¸ÀçÇÏ´Â NAND µð¹ÙÀ̽º »ó¿¡ º¹»çµÇ¾ú°í, ±×µéÀº ½ÇÁ¦ Çϵå¿þ¾î¿¡¼ µ¿ÀÛ½ÃÅ°±â À§Çؼ --bind ¿É¼ÇÀ¸·Î ¸¶¿îÆ®µÇ¾îÁ³½À´Ï´Ù.
6.1. ¿¡¹Ä·¹ÀÌÅÍ¿¡¼ ·¥µð½ºÅ© À̹ÌÁö ¾ò±â ¶1. tools/lib/images/ramdisk.img¿¡¼ ramdisk À̹ÌÁö¸¦ unpack
$ gzip -cd ramdisk.img > ramdisk $ cpio -iv -F ramdisk cpio ´Â ÇöÀç ÀÛ¾÷ÁßÀÎ µð·ºÅ丮»ó¿¡ ÆÄÀÏ°ú µð·ºÅ丮¸¦ Ǭ´Ù.
2. ·¥µð½ºÅ©ÀÇ ³»¿ë ¸ñ·Ï
data dev etc etc/default.prop etc/firmware etc/firmware/brf6150.bin etc/firmware/brf6300.bin etc/hcid.conf etc/hosts etc/init.gprs-pppd etc/init.rc etc/init.ril etc/init.testmenu etc/ppp etc/ppp/chap-secrets etc/ppp/ip-down etc/ppp/ip-up etc/qemu-init.sh etc/system.conf etc/system.d etc/system.d/bluez-hcid.conf etc/usbd.conf init proc sbin sbin/recovery sys system tmp var var/run 6.2. ¿¡¹Ä·¹ÀÌÅÍ¿¡¼ data¿Í system µð·ºÅ丮 ¾ò±â ¶data¿Í system µð·ºÅ丮¸¦ ¾ò±â À§Çؼ ¿©·¯ºÐÀº busybox ¹ÙÀ̳ʸ®¸¦ static ÄÄÆÄÀÏÇÏ¿©¾ß ÇÕ´Ï´Ù. ÄÄÆÄÀÏµÈ ¹ÙÀ̳ʸ®´Â http://benno.id.au/blog/2007/11/14/android-busybox ¿¡¼ ¾ò°Å³ª, ¿©·¯ºÐ °íÀ¯ÀÇ ¹ÙÀ̳ʸ®¸¦ ¸¸µé ¼ö ÀÖ½À´Ï´Ù.
1. ¾Èµå·ÎÀÌµå ¿¡¹Ä·¹ÀÌÅ͸¦ ½ÇÇà½ÃÅ°¼¼¿ä.
2. ¿¡¹Ä·¹ÀÌÅÍ ¾È¿¡ static ÄÄÆÄÀÏµÈ busybox¸¦ ³ÖÀ¸¼¼¿ä.
# adb push busybox . 3. ¾Èµå·ÎÀÌµå ½©À» ½ÇÇà½ÃÅ°¼¼¿ä.
# adb shell 4. busybox·Î tarballÀ» ¸¸µå¼¼¿ä.
# chmod +x /busybox # busybox tar -c /data.tar /data # busybox tar -c /system.tar /system # exit 5. ¿¡¹Ä·¹ÀÌÅÍ¿¡¼ tarballÀ» ÃßÃâÇϼ¼¿ä.
# adb pull /data.tar . # adb pull /system.tar . ÃßÃâ ¸í·ÉÀº Á¾Á¾ ½ÇÆÐÇÕ´Ï´Ù. ¼º°øÀûÀ¸·Î µÉ ¶§±îÁö °è¼Ó ½ÇÇàÇϼ¼¿ä.
6.3. Á¸ÀçÇÏ´Â ·¥µð½ºÅ© À̹ÌÁö·Î ¾Èµå·ÎÀÌµå ½Ã½ºÅÛÀ» ÅëÇÕÇϱ⠶¿©·¯ºÐÀÇ ¾ÆÅ°ÅØóÀÇ ·¥µð½ºÅ©´Â ¿©·¯ºÐÀÇ ÀÛ¾÷À» Á¶±Ý ´õ ½±°Ô ¸¸µì´Ï´Ù. system°ú data µð·ºÅ丮¸¦ Á¦¿ÜÇÑ ¾Èµå·ÎÀÌµå ·¥µð½ºÅ©ÀÇ ³»¿ëÀ» ¿©·¯ºÐ °íÀ¯ÀÇ ·¥µð½ºÅ©·Î º¹»çÇϼ¼¿ä. ±×¸®°í ±×³É system°ú data µð·ºÅ丮ÀÇ ¸¶¿îÆ® ÁöÁ¡À» ¸¸µå¼¼¿ä. ¸¶¿îÆ® ÁöÁ¡Àº ³ªÁß¿¡ bind ¿É¼ÇÀ¸·Î »ç¿ëµÉ ¼ö ÀÖ½À´Ï´Ù. ¾Èµå·ÎÀÌµå ·¥µð½ºÅ© À̹ÌÁöÀÇ init ¹ÙÀ̳ʸ®´Â ½Ã½ºÅÛÀ» ½ÃÀÛÇϱâ À§ÇÑ Áß¿ä ¹ÙÀ̳ʸ®ÀÌ°í, ±×°ÍÀº /etc/init.rc ÆÄÀÏ »ó¿¡¼ ¼³Á¤ ÆÄÀÏÀ» ÀнÀ´Ï´Ù.
/etc/init.rc¸¦ ÆíÁýÇÏ°í qemu ºÎºÐÀ» ÁÖ¼®À¸·Î ¸¸µå¼¼¿ä.
... startup { ... # qemu-init { # exec /etc/qemu-init.sh # } } ... run.sh ½ºÅ©¸³Æ®¸¦ ¸¸µå¼¼¿ä. /dev/block/mtdblock5´Â ½ÇÁ¦ NAND µð¹ÙÀ̽ºÀÇ mtd ÆÄƼ¼ÇÀÌ°í, ±× °ÍÀº /mnt »ó¿¡ ¸¶¿îÆ®µÇ¾î Áý´Ï´Ù. data¿Í system µð·ºÅ丮´Â ÀÌ¹Ì mtdblock5 »ó¿¡ º¹»çµÇ¾îÁ® ÀÖ½À´Ï´Ù. ±×·¡¼ ±× ½ºÅ©¸³Æ®´Â ¾Æ·¡¿Í °°ÀÌ / »óÀÇ °¢ µð·ºÅ丮ÀÇ ¹ÙÀÎµå ¸¶¿îÆÃ(bind mounting)À» º¸ÀÔ´Ï´Ù. ¿©·¯ºÐÀÇ º¸µå ¼³Á¤¿¡ µû¶ó ½ºÅ©¸³Æ®¸¦ °íÄ¡¼¼¿ä.
#!/bin/sh mount -t yaffs /dev/block/mtdblock5 /mnt mount --bind /mnt/data /data mount --bind /mnt/system /system # data folder is owned by system user on emulator. Fix 777 to other. chmod 777 /data #chmod 777 /system export PATH=/system/sbin:/system/bin:/sbin/usr/local/bin export LD_LIBRARY_PATH=/system/lib export ANDROID_BOOTLOGO=1 export ANDROID_ROOT=/system export ANDROID_ASSETS=/system/app export EXTERNAL_STORAGE=/sdcard export ANDROID_DATA=/data export DRM_CONTENT=/data/drm/content /init & ÅÍÄ¡½ºÅ©¸°À» À§ÇÑ ÇÊ¿ä¿¡ µû¸¥ ¼³Á¤ - TSLib.
... export TSLIB_CONSOLEDEVICE=none export TSLIB_FBDEVICE=/dev/fb0 export TSLIB_TSDEVICE=/dev/input/event1 export TSLIB_CALIBFILE=/etc/pointercal export TSLIB_CONFFILE=/etc/ts.conf export TSLIB_PLUGINDIR=/lib/ts export LD_PRELOAD=/lib/libts.so:/lib/ts/pthres.so ... 6.4. System °ú data µð·ºÅ丮 ¶system °ú data µð·ºÅ丮ÀÇ ³»¿ëÀº ÀÌ¹Ì mtdblock5¿¡ ÀÌ¹Ì º¹»çµÇ¾îÁ® ÀÖ½À´Ï´Ù. ¿©·¯ºÐÀº ¿©·¯ºÐ °íÀ¯ÀÇ ¹æ¹ýÀ¸·Î º¹»çÇÏ¼Å¾ß ÇÕ´Ï´Ù. ±×°ÍÀ» »ç¿ëÇϱâ À§Çؼ Àú´Â ·çÆ® µð·ºÅ丮»ó¿¡ ¹ÙÀÎµå ¸¶¿îÆÃ(bind mounting)À» ¼±ÅÃÇß½À´Ï´Ù. ¹ÙÀÎµå ¸¶¿îÆÃÀº ÀÌ¹Ì Á¸ÀçÇÏ´Â µð·ºÅ丮¸¦ »õ·Î¿î ¸¶¿îÆ® Æ÷ÀÎÆ®·Î ¸¶¿îÆ®ÇÏ´Â ±â¼úÀÔ´Ï´Ù.
6.5. ½ÇÇà°ú µð¹ö±× ¶ÀÌÁ¦ Ä¿³Î°ú ·¥µð½ºÅ©¿Í ÀÚ·á µð·ºÅ丮 - data¿Í system -ÀÌ ÁغñµÇ¾ú½À´Ï´Ù. »¡°£ »çÀÏ·± ´«À» º¼ ½Ã°£ÀÔ´Ï´Ù. ¿©·¯ºÐÀÇ ÅëÇÕµÈ ½Ã½ºÅÛÀ» ºÎÆÃÇÏ°í ³ª¼ run.sh¸¦ ·çÆ® µð·ºÅ丮¿¡¼ ½ÇÇàÇϼ¼¿ä.
# cd / # . /android/run.sh yaffs: dev is 32505861 name is "mtdblock5" yaffs: passed flags "" yaffs: Attempting MTD mount on 31.5, "mtdblock5" yaffs: auto selecting yaffs2 # init: HOW ARE YOU GENTLEMEN init: reading config file init: device init init: mtd partition -1, init: mtd partition 0, "l1boot" init: mtd partition 1, "u-boot" init: mtd partition 2, "params" init: mtd partition 3, "kernel" init: mtd partition 4, "ramdisk" init: mtd partition 5, "rootfs" sh: can't access tty; job control turned off # binder_open(c394bcc8 c3c731a0) (pid 1577) got c3e48000 binder_open(c394bcc8 c3cd8dc0) (pid 1616) got c319f000 binder_open(c394bcc8 c3cd8ac0) (pid 1673) got c3d10000 binder_open(c394bcc8 c3cd8940) (pid 1680) got c0e19000 binder_open(c394bcc8 c3cd88c0) (pid 1691) got c2fa0000 binder_open(c394bcc8 c3d174a0) (pid 1592) got c25b8000 binder_release(c394bcc8 c3cd88c0) (pid 1691) pd c2fa0000 #
#!/bin/sh # set environment variables above example ... /system/bin/app_process -Xzygote /system/bin --zygote & /system/bin/dbus-daemon --system & /system/bin/runtime ´ÙÀ½ ¿¹Á¦´Â ¼öµ¿ ½ÃÀÛ ÀýÂ÷¸¦ º¸¿©ÁÝ´Ï´Ù. /system/bin/runtime ¹ÙÀ̳ʸ® »ó¿¡¼ strace¸¦ »ç¿ëÇϼ¼¿ä.
./strace -ff -F -tt -s 200 -o /tmp/strace runtime 6.6. ½ºÅ©¸°¼¦ ¶recvfrom(4, "add@/devices/virtual/misc/networ"..., 1024, 0, NULL, NULL) = 144 mknod("/dev/network_latency", S_IFCHR|0600, makedev(10, 58)) = 0 chown32("/dev/network_latency", 0, 0) = 0 recvfrom(4, 0xbee2b72a, 1024, 0, 0, 0) = -1 EAGAIN (invain) getdents64(8, /* 5 entries */, 4200) = 136 getdents64(8, /* 0 entries */, 4200) = 0 close(8) = 0 SYS_305(0x7, 0x27f3b, 0x24000, 0, 0x28e98) = 8 SYS_305(0x8, 0x1b6ec, 0x20001, 0, 0x28e98) = 9 write(9, "add\n", 4) = 4 close(9) = 0 recvfrom(4, "add@/devices/virtual/misc/networ"..., 1024, 0, NULL, NULL) = 150 mknod("/dev/network_throughput", S_IFCHR|0600, makedev(10, 57)) = 0 chown32("/dev/network_throughput", 0, 0) = 0 recvfrom(4, 0xbee2b72a, 1024, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) getdents64(8, /* 5 entries */, 4200) = 136 getdents64(8, /* 0 entries */, 4200) = 0 close(8) = 0 getdents64(7, /* 0 entries */, 4200) = 0 close(7) = 0 SYS_305(0x6, 0x26f13, 0x24000, 0, 0x27e18) = 7 SYS_305(0x7, 0x1b6ec, 0x20001, 0, 0x27e18) = -1 ENOENT (No such file or directory) getdents64(7, /* 3 entries */, 4200) = 80 SYS_305(0x7, 0x27e6b, 0x24000, 0, 0xffffffff) = 8 SYS_305(0x8, 0x1b6ec, 0x20001, 0, 0x28e98) = 9 write(9, "add\n", 4) = 4 close(9) = 0 recvfrom(4, "add@/devices/virtual/sound/timer"..., 1024, 0, NULL, NULL) = 128 mknod("/dev/timer", S_IFCHR|0600, makedev(116, 33)) = 0 chown32("/dev/timer", 0, 0) = 0 recvfrom(4, 0xbee2b72a, 1024, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) getdents64(8, /* 5 entries */, 4200) = 136 getdents64(8, /* 0 entries */, 4200) = 0 close(8) = 0 getdents64(7, /* 0 entries */, 4200) = 0 close(7) = 0 getdents64(6, /* 0 entries */, 4200) = 0 close(6) = 0 getdents64(5, /* 0 entries */, 4200) = 0 close(5) = 0 7. ¾ÖÇø®ÄÉÀÌ¼Ç °³¹ß ¶¾Èµå·ÎÀÌµå ¾ÖÇø®ÄÉÀ̼ÇÀº XML ·¹À̾ƿô°ú ÀÚ¹Ù ¹®¹ýÀ» »ç¿ëÇÕ´Ï´Ù¸¸, ÀÚ¹Ù´Â ¾Æ´Õ´Ï´Ù. ¿Ö³ÄÇÏ¸é ±×µéÀº ±×µé °íÀ¯ÀÇ °¡»ó ¸Ó½Å - dalvik - °ú dex ÆÄÀÏ Çü½ÄÀ» À§ÇÑ ÄÄÆÄÀÏ·¯¸¦ »ç¿ëÇϱ⠶§¹®ÀÔ´Ï´Ù. ±×¸®°í Home.apk, Phone.apk, ApiDemos.apk µî °ú °°ÀÌ apk·Î À̸§ºÙ¿©Áø ÆÐÅ°Áö¸¦ »ç¿ëÇÕ´Ï´Ù.
apk ÆÄÀÏÀº ZIP ¾ÐÃàÆÄÀÏÀÌ°í ³× °¡Áö ºÎºÐÀ» °¡Áý´Ï´Ù.
¾Èµå·ÎÀ̵å SDK´Â *.apk ÆÄÀÏÀ» »ý¼ºÇÒ °ÍÀÔ´Ï´Ù.
7.1. ÀÌŬ¸³½º(Eclipse) ÅëÇÕ°³¹ßȯ°æ(IDE) ¼³Ä¡Çϱ⠶http://code.google.com/android/intro/installing.html ÀÇ ¼³Ä¡ ÀýÂ÷¸¦ µû¸£¼¼¿ä.
1. http://www.eclipse.org/downloads/ ÀÇ (JDT¿Í WST Ç÷¯±×ÀÎÀÌ Æ÷ÇÔµÈ)Eclipse IDE for Java developer
2. http://java.sun.com/javase/downloads/index.jsp ÀÇ JDK (Java SE)
3. Apache Ant¸¦ Æ÷ÇÔÇÏ´Â eclipse pluginÀÎ ADT (Android Development Tools)
7.2. »ùÇà ¾ÖÇø®ÄÉÀ̼ÇÀ» ºôµåÇÏ°í ½ÇÇàÇϱ⠶1. »ùÇà ÇÁ·ÎÁ§Æ®¸¦ ¿°í ºôµå
2. ¿¡¹Ä·¹ÀÌÅÍ »ó¿¡¼ »ùÇà ¾ÖÇø®ÄÉÀÌ¼Ç ½ÇÇà
7.3. ½ºÅ©¸°¼¦ ¶
8. ¿¡ÇÊ·Î±× ¶¾Èµå·ÎÀÌµå ½Ã½ºÅÛÀº µ¥ºñ¾È, ·¹µåÇÞ, ¼ö¼¼³ª ±âŸ µî°ú °°Àº ¸ð¹ÙÀÏ È¯°æÀ» À§ÇÑ »õ·Î¿î Á¾·ùÀÇ ¸®´ª½º ±â¹ÝÀÇ ¹èÆ÷ÆÇÀÌ µÉ °ÍÀ¸·Î º¸ÀÔ´Ï´Ù. ±×µéÀº ¿ÀǼҽº ¼¼»óÀÇ ¸®´ª½º Ä¿³Î°ú ¸¹Àº ´Ù¸¥ ¶óÀ̺귯¸®¸¦ »ç¿ëÇÒ »ÓÀÔ´Ï´Ù. ±×µéÀº ÇöÀç 3D °¡¼Óȸ¦ OpenGL-ES ¶óÀ̺귯¸®¿¡ ±â¹ÝÇÑ ¼ÒÇÁÆ®¿þ¾î¸¦ Á¦°øÇÕ´Ï´Ù. ±×·¯³ª ±×µéÀº ±×¸¦ À§ÇÑ Çϵå¿þ¾î °¡¼ÓÀÇ ±âº» ÇÁ·Î¼¼¼ »ó¿¡¼ °³¹ßÇÏ°í ÀÖ½À´Ï´Ù. ±× Çϵå¿þ¾î °¡¼ÓÀº ÃßÈÄÀÇ ºü¸¥ UI ·»´õ¸µ È¿°ú¸¦ À§ÇØ ÇʼöÀûÀÔ´Ï´Ù.
SDK »óÀÇ ¾Èµå·ÎÀÌµå ½Ã½ºÅÛÀº ½ÇÁ¦ Çϵå¿þ¾î »ó¿¡ Æ÷ÆÃÇÏ´Â °ÍÀº ¿Ïº®ÇÏÁö ¾Ê½À´Ï´Ù. ¿Ö³ÄÇϸé, ¶óÀ̺귯¸®¿Í Ŭ·¡½º¿¡ °ü·ÃµÈ ¾î¶² µð¹ÙÀ̽º - ¿¹¸¦ µé¸é, Ä«¸Þ¶ó -´Â ¾ÆÁ÷ ±¸ÇöµÇÁö ¾Ê¾Ò°í, »ç¿ëÀÚ¿¡°Ô °ø°³µÇÁö ¾Ê¾Ò½À´Ï´Ù. ±× °ÍÀº ¾ÆÁ÷ °³¹ß ´Ü°è¿¡ ÀÖ´Â °ÍÀ¸·Î º¸ÀÔ´Ï´Ù. ±×·¡¼ ±¸±ÛÀÇ Àüü Æ÷Æà ŶÀ» ±â´Ù¸®´Â °ÍÀÌ ´õ ³ªÀ» °Í °°½À´Ï´Ù.
±× Àü¿¡, ¿ì¸®´Â ¾Èµå·ÎÀÌµå ½Ã½ºÅÛÀÇ »ç¾÷ ¸ðµ¨À» »ìÆìºÁ¾ß¸¸ ÇÕ´Ï´Ù. ±× °ÍÀº ¾à°£ ºü¸¥ CPU ¼º´ÉÀ» ÇÊ¿ä·Î Çϱ⠶§¹®¿¡ ¿î¼Û ÆǸŻç´Â ½Ñ ±âº» ÇÁ·Î¼¼¼(RF ºÎºÐ)¿Í ¸ÖƼ¹Ìµð¾î ÄÚÇÁ·Î¼¼¼(co-processor)°¡ ÇÊ¿äÇÒ °Ì´Ï´Ù. ¸ÖƼ¹Ìµð¾î ±â´ÉÀ» Æ÷ÇÔÇÏ´Â ±âº» ÇÁ·Î¼¼¼´Â ¸Å¿ì ºñ½Î±â ¶§¹®ÀÔ´Ï´Ù.
9. ¸µÅ©¿Í ÂüÁ¶ ¶
|
Love is in the offing. Be affectionate to one who adores you. |