Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
1
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
NTU CSIE 2017.01.16
The...
2
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
■ Android:
http://www.s...
3
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Basic Topics for Kernel...
4
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Basic Topics for Kernel...
5
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Basic Topics for Androi...
6
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
■ Android device contro...
7
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
in 15 minutes
A Brief I...
8
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Android vs. Linux
■ And...
9
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Android Architecture
10
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
The Linux Kernel
• And...
11
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
About the Linux Kernel...
12
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Android Framework
• Mi...
13
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
An Overview: from Apps...
14
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Linux Kernel and the D...
15
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
OS for I/O
• Provide p...
16
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Role of the Device Dri...
17
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
How Linux Treats Devic...
18
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
• Android Application
...
19
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
The Android HAL
20
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
System Integration Flo...
21
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Kernel Module (.ko)
Ke...
22
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Shared Library (.so)
K...
23
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Shared Library (.so)
H...
24
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
HAL Stub
(JNI Native C...
25
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Hardware Service
(Java...
26
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
for the rest time of t...
27
和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。
Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved.
Q&A
Upcoming SlideShare
Loading in …5
×

The key issues for teaching or learning Android and Linux Kernel

The presentation was used in the Seed Teachers Camp for the Open Source System Software, hosted by Dept. CSIE, NTU, Taiwan. It's for guiding the teachers/students in teaching/learning Android and the Linux Kernel. The key issues and some references (on slideshare) are listed in the slides for further studies, and an overview of the Android/Linux was also given in this talk.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

The key issues for teaching or learning Android and Linux Kernel

  1. 1. 1 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. NTU CSIE 2017.01.16 The key issues for teaching or learning Android and Linux Kernel 梁文耀, CTO 和沛移動股份有限公司
  2. 2. 2 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. ■ Android: http://www.slideshare.net/williamwyliang/an-introduction-to-the-android-fra mework-a-core-architecture-view-from-apps-to-the-kernel ■ Linux Kernel: http://www.slideshare.net/williamwyliang/an-introduction-to-the-linux-kernel -and-device-drives-ntu-201603-59718004 ■ Android Device Drivers: http://www.slideshare.net/williamwyliang/android-device-driver-structure-int roduction ■ Design Pricinple for H/W Drivers: http://www.slideshare.net/williamwyliang/operating-systems-and-software-d esign-for-hardware-components References
  3. 3. 3 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Basic Topics for Kernel 1/2 ■ Device file concept ■ File operations ■ System calls ■ Dynamic loadable kernel module ■ Kernel memory management ■ Concurrency control ■ Synchronizations ■ Performance issues
  4. 4. 4 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Basic Topics for Kernel 2/2 ■ Interrupt handling and ISR ■ Process control ■ Waiting queues ■ Blocking accesses ■ Bottom half ■ Atomic context ■ Linux device model and sysfs ■ Other types of device drivers
  5. 5. 5 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Basic Topics for Android 1/2 ■ Android framework integration overview ■ Apps and framework programming ■ Kernel vs. user space device drivers ■ Native shared libraries ■ Android NDK ■ Java native interface ■ Device control flow for Android and Linux ■ Framework and hardware services
  6. 6. 6 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. ■ Android device control model and service-oriented device management ■ Binder IPC and AIDL ■ Android booting flow ■ System services and service management ■ Android HAL and interfaces ■ HAL Stub and HAL Module Basic Topics for Android 1/2
  7. 7. 7 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. in 15 minutes A Brief Introduction for Android and LInux Kernel
  8. 8. 8 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Android vs. Linux ■ Android differs from the typical GNU/Linux in that Android adopts only the Linux kernel, not everything. ■ The first process ‘init’ transfers to Android’s own application environment. ■ The Bionic libc is used instead of glibc or uClibc. ■ As a result, it is called Android/Linux, not GNU/Linux.
  9. 9. 9 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Android Architecture
  10. 10. 10 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. The Linux Kernel • Android relies on Linux version 2.6 and later for core system services such as security, memory management, process management, network stack, and driver model. • The kernel also acts as an abstraction layer between the hardware and the rest of the software stack. Why Linux? • Great memory and process management • Permissions-based security model • Proven driver model • Support for shared libraries • It’s already open source!
  11. 11. 11 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. About the Linux Kernel • An implementation of UNIX • Multitasking • File systems • Distributions • Device Management • System Interface • Threading • IPC
  12. 12. 12 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Android Framework • Mixed Language/Layer Design • Application Framework • Services • Native Shared Library • Dalvik Virtual Machine
  13. 13. 13 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. An Overview: from Apps to H/W • User level (user mode) • Write a user program • Compile & Link • Execution • Kernel (kernel mode) • Load the program • System call • Device driver • Hardware manipulation
  14. 14. 14 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Linux Kernel and the Drivers
  15. 15. 15 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. OS for I/O • Provide protection to shared I/O resources • Provides abstraction for accessing devices • Handles the interrupts generated by I/O devices • Provide equitable access to the shared I/O resources • Schedule accesses in order to enhance system throughput © Computer Organization and Design: The Hardware/Software Interface, David Patterson and John Hennessy
  16. 16. 16 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Role of the Device Drivers • Device drivers are usually treated as black boxes for the application developers. • They resemble as a software layer lying between the applications and the actual devices. • A device driver performs user requests in a standardized manner.
  17. 17. 17 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. How Linux Treats Devices • Unix/Linux see devices as special files •Device files • Enable users to employ familiar commands and functions such as open, read, write, and close •File Operations vs. Device Accesses
  18. 18. 18 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. • Android Application • Android Application Framework • Android Java/C/C++ Interface • Android/Linux Native Layers • Linux System Calls • Linux Device Driver • Hardware and Control Android/Linux Integration
  19. 19. 19 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. The Android HAL
  20. 20. 20 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. System Integration Flow • Implement the device driver • Implement the HAL Module • Implement the Native Stub • Implement the Hardware Service • Implement the Software Management Component • Implement Applications
  21. 21. 21 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Kernel Module (.ko) Kernel Module (C Code) Implement Device Driver File Operations
  22. 22. 22 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Shared Library (.so) Kernel Module (C Code) HAL Module (Native Code) Implement HAL Module System call Kernel Module (.ko) HAL Device Interface File Operations
  23. 23. 23 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Shared Library (.so) HAL Stub (JNI Native Code) Kernel Module (C Code) HAL Module (Native Code) Implement Native Stub hw_get_module System call Kernel Module (.ko) Shared Library (.so) HAL Device Interface File Operations Native Functions
  24. 24. 24 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. HAL Stub (JNI Native Code) Kernel Module (C Code) HAL Module (Native Code) Implement Hardware Service hw_get_module System call Kernel Module (.ko) Shared Library (.so) Android Service (APK+.so) Hardware Service (Java Code) JNI Binder Interfac e HAL Device Interface Native Functions File Operations
  25. 25. 25 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Hardware Service (Java Code) HAL Stub (JNI Native Code) External Library (JAR) Kernel Module (C Code) HAL Module (Native Code) Device Manager (Java Code) Implement Mgmt. Component hw_get_module JNI System call Android Service (APK+.so) Shared Library (.so) Kernel Module (.ko) Binder IPC Binder Interfac e HAL Device Interface Native Functions File Operations
  26. 26. 26 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. for the rest time of the talk, if still available :p Let’s go back and review the contents of the reference pages.
  27. 27. 27 和沛移動股份有限公司機密資料,非經許可不得重製、轉載、或散播。 Copyright © 2016 和沛科技 Hope Bay Mobile, Inc. All rights reserved. Q&A

×