임베디드리눅스의사용자공간과안드로이드 BusyBox 웹서버 GUI Android 연세대학교컴퓨터정보통신공학부윤상균 연세대학교컴퓨터정보통신 1 연세대학교컴퓨터정보통신 2 Kernel Space vs. User Space User Space 응용프로그램을위한 POSIX 환경 주요컴포넌트 Program init, shell Libraries libc Configuration files in /etc Device nodes in /dev User data in /home 연세대학교컴퓨터정보통신 3 연세대학교컴퓨터정보통신 4
Root file system BusyBox kernel boot 동안 mount 됨 다음장치에서 root file system 이 mount 됨 RAM disk (initramfs) storage device flash memory, hard disk network NFS Root file system 통합빌드도구 Buildroot http://buildroot.uclibc.org OpenEmbedded http://www.openembedded.org "The Swiss Army Knife of Embedded Linux" Combines tiny versions of many common UNIX utilities into a single small executable Fewer options than their full-featured GNU cousins Size-optimization and limited resources Provides a fairly complete environment for any small or embedded d system Extremely modular and easy to customize http://www.busybox.net now BusyBox 1.21.0 연세대학교컴퓨터정보통신 5 연세대학교컴퓨터정보통신 6 BusyBox or Full tools? 연세대학교컴퓨터정보통신 7 연세대학교컴퓨터정보통신 8
BusyBox 의실행 BusyBox 의인수에명령어이름을제공 실행시키려는명령어의이름을 busybox와심볼릭링크하여사용 설치할때에자동적으로수행됨 /bin, /sbin, /usr/bin, /usr/sbin 에위치한상당수의명령어들이 /bin/busybox와심볼릭링크되어있음 연세대학교컴퓨터정보통신 9 연세대학교컴퓨터정보통신 10 BusyBox Startup Mechanism BusyBox 는 init 로도사용할수있다. (/sbin/init) System V approach /etc/init.d/rcx.d/* /etc/inittab runlevels 0: halt, 1: single user, 2-5: multi user, 6: reboot many options like wait, respawn, powerwait/powerfail scripts usually require sed, grep, awk present many fork/exec BusyBox approach /etc/inittab (optional) Much simpler, no concept of runlevels, will start console 1 simple /etc/rcs file can run other files if needed 연세대학교컴퓨터정보통신 11 연세대학교컴퓨터정보통신 12
C library 웹서버 There are many C libraries to choose from, and some obvious criteria. GNU glibc Eglibc, uclibc, Newlib, Diet libc, BSD libc Impact is tremendous: quality of C++ support completeness stability size / configurability availability for architecture compiler modifications (uclibc!) do not underestimate community! Security / bugfixes / future 임베디드시스템에는 low overhead 를가진웹서버를주로사용함 Boa lighthttpd Cherokee, qhttpd, nginx, Hiawatha GoAhead cgi 프로그램을사용하여외부에서임베디드시스템의제어를쉽게할수있도록할수있다. GoAhead 웹서버 ( 별첨자료참조 ) 연세대학교컴퓨터정보통신 13 연세대학교컴퓨터정보통신 14 GUI 개발 Java ME GUI (Graphic User Interface) Qt/Embedded Smart and easy GUI Open source, once commercialized -> royalty y ( 별첨자료참조 ) GTK+ Open source, GPL MicroWindow (now Nano-X) Tiny X : down-sized X Window system (now smallx) PicoGUI (now halt) Nano-Qplus (ETRI) 연세대학교컴퓨터정보통신 15 연세대학교컴퓨터정보통신 16
Qplus/Esto Android Android is a software stack for mobile devices that includes an operating system, middleware and key applications Based on Linux OS (kernel 2.6.x or later) Using Java Programming Open Source 연세대학교컴퓨터정보통신 17 연세대학교컴퓨터정보통신 18 Android Features Android Architecture Application framework enabling reuse and replacement of components Dalvik virtual machine optimized for mobile devices Integrated browser based on the open source WebKit engine Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional) SQLite for structured data storage Media support for common audio, video, and still image formats (MPEG4,H.264, MP3, AAC, AMR, JPG, PNG, GIF) GSM Telephony (hardware dependent) Bluetooth, EDGE, 3G, and WiFi (hardware dependent) Camera, GPS, compass, and accelerometer (hardware dependent) Rich development environment 연세대학교컴퓨터정보통신 19 연세대학교컴퓨터정보통신 20
Application Framework Developers have full access to the same framework APIs used by the core applications Underlying all applications is a set of services and systems, including Rich and extensible set of Views that can be used to build an application, including lists, grids, text boxes, buttons, and even an embeddable web browser Content Providers that enable applications to access data from other applications (such as Contacts), or to share their own data Resource Manager, providing access to non-code resources such as localized strings, graphics, and layout files Notification Manager that enables all applications to display custom alerts in the status bar Activity Manager that manages the life cycle of applications and provides a common navigation backstack Libraries Android includes a set of C/C++ libraries Some of the core libraries are System C library - a BSD-derived implementation of the standard C system library (libc), tuned for embedded Linux-based devices Media Libraries - based on PacketVideo's OpenCORE Surface Manager - manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications LibWebCore web browser SGL - the underlying 2D graphics engine 3D libraries - an implementation based on OpenGL ES 1.0 APIs FreeType - bitmap and vector font rendering SQLite - a powerful and lightweight relational database engine 연세대학교컴퓨터정보통신 21 연세대학교컴퓨터정보통신 22 Linux Kernel Android Runtime Linux version 15(cupcake) 1.5 2627 2.6.27 1.6 (donut) 2.6.29 2.0/2.1 (eclair) 2.6.29 2.2 (froyo) 2.6.32 2.3 (Gingerbread) 2.6.33 or 34 3.x (Honeycomb) 4.0 (Ice Cream Sandwich) 4.1/4.2 (Jelly Bean) core system services Security memory management, process management network stack, driver model. Every Android application runs in its own process instance of the Dalvik virtual machine Dalvik VM executes files in the Dalvik Executable (.dex) format 연세대학교컴퓨터정보통신 23 연세대학교컴퓨터정보통신 24
Develop Android Applications Java Programming Background Java SE Eclipse IDE Android SDK Android Development Tool Plugin (Option) 연세대학교컴퓨터정보통신 25