android4.0下的linux3.0的變化

來源:互聯網
上載者:User

Linux Kernel for Android 4.0
--- 初稿 2011-11-25
1. android 4.0 system be released
2011-10-19上午10點,google發布了代號為Ice Cream Sandwich(簡稱ICS,冰淇淋三明治)的android4.0系統。十大特性:

4)、 同步升級Linux核心 更新3.0以上版本

2. linux kernel 3.0
源碼下載:ftp://ftp.kernel.org/pub/linux/kernel/v3.0/
2.1.發布時間:2011-07-21
2.2.版本號碼變化:Linux2.6.39 ----》 linux3.0
無裡程碑式的變化。一種說法是為了紀念Linux 20年,邁向第3個10年。
2.3.主要新特性如下:
更新日誌:http://kernelnewbies.org/Linux_3.0
1)、Btrfs檔案系統自動磁碟重組、效能改進和檢查;
Btrfs(Butter FS),目標在取代Linux目前的ext3檔案系統,改善ext3的限制,特別是單一檔案的大小,總檔案系統大小及加入檔案校正和。已在ubuntu10.10、openSUSE11.3和Fedora 16中得到了應用。
2)、支援sendmmsg()系統調用(syscall);
一個批處理sendmsg()系統調用,UDP發送效能提升20%,介面發送效能提30%.
3)、XEN dom0 支援;
Xen 是一個高效能的虛擬化解決方案,可提升虛擬機器效能。
4)、增加 Cleancache 支援;
封裝的相關核心API,目前核心中主要在ext3、ext4、btrfs、ocsfs2等檔案系統部分相關代碼中有調用。
5)、Berkeley 即時包過濾器;
配合libpcap/tcpdump提升包過濾規則的運行效率。
6)、無線廣域網路(WLAN)喚醒支援;
7)、實現非特殊授權的 ICMP_ECHO (ping 命令);
8)、支援setns()系統調用(syscall);
更好地命名空間管理。
9)、高精度計時器Alarm-timers的支援
可以在通過 RTC 裝置喚醒掛起狀態的系統。The concept for Alarm-timers was inspired by the Android Alarm driver, and the interface to userland uses the POSIX clock and timers interface.
3. Linux Kernel for Android
Android基於linux,但其linux核心跟標準的linux核心有所差異。
1)、android沒有使用linux的X視窗系統;
2)、android沒有採用glibc作為C庫,另開發了一套Bionic Libc來代替glibc;
3)、增加了一些android專用的驅動程式
Android對標準linux核心及驅動的增強改進部分:
3.1. Android Alarm
用於將裝置從睡眠狀態喚醒,同時提供一個在裝置睡眠時仍會啟動並執行基準。
源碼位置:drives/rtc/alarm.c
裝置節點名:/dev/alarm
該部分code,Linux 3.0版本在linux2.6.32版本的基礎上有2次改動更新:
1)、Don't use save_time_delta.
2)、Update hrtimer if alarm at the head of the queue is reprogrammed.
3.2. Ashmem(匿名共用記憶體)
為進程間提供大塊共用記憶體。相比於malloc等傳統的記憶體配置機制,其優勢是通過核心驅動提供了輔助核心的記憶體回收演算法機制。
源碼位置:kernel/mm/ashmem.c
裝置節點名:/dev/ashmem
Linux 3.0版本在linux2.6.32版本的基礎上有5次改動更新:
1)、Implement read in ashmem driver.
2)、Fix ASHMEM_SET_PROT_MASK.
3)、Update arguments of shrinker for 2.6.35.
4)、Support lseek in ashmem driver.
5)、Fix arguments to ashmem_shrink.
3.3. Low Memory Killer(低記憶體管理)
根據需要殺死進程以釋放需要的記憶體。
源碼位置:drivers/staging/android/lowmemorykiller.c
Linux 3.0版本在linux2.6.32版本的基礎上有9次改動更新:
1)、Don't try to kill the same pid over and over.
2)、Substantially reduce overhead during reclaim.
3)、Fix task_struct leak.
4)、Remove bitrotted codepath.
5)、Update arguments of shrinker for 2.6.35.
6)、Don't unregister notifier from atomic context.
7)、Don't wait more than one second for a process to die.
8)、Ignore shmem pages in page-cache.
9)、Fix arguments to lowmem_shrink.
3.4. Logger(日誌裝置)
為方便android應用開發過程中使用log資訊來偵錯工具。
源碼位置:drivers/staging/android/logger.c
裝置節點名:/dev/log/main /dev/log/event /dev/log/radio
Linux 3.0版本在linux2.6.32版本的基礎上無改動更新。
3.5. Android PMEM
向使用者空間提供連續的實體記憶體地區(DSP這類裝置只能工作在連續的實體記憶體上)。
源碼位置:drivers/misc/pmem.c
該部分源碼augustatek有在linux2.6.32版本的基礎上改動更新:
1)、add pmem node create/destroy entries.
2)、change dsp mem map.
3)、add 7700 support.
3.6. switch
用於檢測一些開關量(耳塞插入、USB裝置插入等)。
源碼位置:drivers/switch/switch_class.c
drivers/switch/switch_gpio.c
Linux 3.0版本在linux2.6.32版本的基礎上無改動更新。
3.7. Timed GPIO
將普通的GPIO驅動和核心定時器進行綁定,實現受時鐘控制的GPIO.
源碼位置:drivers/staging/android/timed_gpio.c
drivers/staging/android/timed_output.c
Linux 3.0版本在linux2.6.32版本的基礎上有1次改動更新:
1)、Properly discard invalid timeout values.
3.8. Android Ram Console
為了提供調試功能,將調試日誌資訊寫入Ram Console裝置裡,該裝置是一個基於Ram的buffer.
源碼位置:drivers/staging/android/ram_console.c
Linux 3.0版本在linux2.6.32版本的基礎上無改動更新。
3.9. Android Binder
是OpenBinder的Linux實現,為android系統運行提供進程間的通訊機制。
Binder驅動源碼位置:drivers/staging/android/binder.c
裝置節點名:/dev/binder
Linux 3.0版本在linux2.6.32版本基礎上的改動更新:
1)、Use seq_file for debug interface.
2)、Move debugging information from products to debugfs.
3)、Create dedicated workqueue for binder deffered work.
4)、Fix memory corruption via page aliasing.
3.10. Android電源管理(PM)
電源管理是實現低功耗的一種方式,是從應用程式到核心架構,再到裝置驅動和硬體裝置都要系統考慮的一個系統工程。
源碼位置:kernel/power/
Linux 3.0版本在linux2.6.32版本基礎上的改動更新:
1)、Fix operator precedence bug.
2)、call __get_wall_to_monotonic() instead of using wall_to_monotonic.
3)、use get_xtime_and_monotonic_and_sleep_offset in get_expired_time.
4)、Free memory bitmaps if opening /dev/snapshot fails.
5)、Merge commit ‘v3.0-rc5’.
該部分源碼augustatek有在linux2.6.32版本的基礎上改動更新:
1)、Add sleep in suspend().
2)、Add arm power down support.
3)、remove the sleep to solve “wakeup too long”.
3.11. USB Gadget驅動
源碼位置:drivers/usb/gadget/android.c
drivers/usb/gadget/f_adb.c
drivers/usb/gadget/f_accessory.c (new file)
drivers/usb/gadget/f_mtp.c (new file)
drivers/usb/gadget/f_mass_storage.c
Linux 3.0版本在linux2.6.32版本基礎上的改動更新:
1)、Add userspace notifications for USB state changes.
2)、Remove unused function android_usb_set_connected().
3)、Add usb_composite_force_reset utility to force enumeration.
4)、Fix section mismatch warning.
5)、Disable MTP when RNDIS function is enabled.
6)、Remove WAKEUP flag from bmAttributes.
7)、Fixed Android gadget function discovery & product matching.
8)、android Fix gadget descriptor compliance for IAD's.
9)、Support switching vendor ID when configuration changes.
10)、Fix problem switching vendor IDs.
11)、New gadget driver for android USB accesories.
12)、Misc improvements and cleanup:
- Add URI string.
- Replace type string with a description string.
- Add a control call to retrieve accessory protocol version (currently 1).
- Driver read() and write() calls now fail after USB disconnect until driver file is closed and reopened.
- Misc cleanup work
13)、Clear accessory strings when USB is disconnected.
14)、Clear previous strings on ACCESSORY_GET_PROTOCOL.
15)、Clear disconnected flag when driver file is opened.
16)、Add string for accessory's unique serial number.
17)、Set bNumEndpoints to correct value of 2.
18)、Update android gadget driver.
* Functions and the device descriptor are configured from user space:
echo 0 > /sys/class/android_usb/android0/enable
echo adb,acm > /sys/class/android_usb/android0/functions
echo 2 > /sys/class/android_usb/android0/f_acm/instances
echo 1 > /sys/class/android_usb/android0/enable
* Driver does not require platform data anymore.
* Moved function initialization to android.c instead of each function file.
* Replaced switches by uevents.
19)、Add PTP variant of MTP USB function.
20)、dequeue request on error in adb_read.
該部分源碼augustatek有在linux2.6.32版本的基礎上改動更新:
1)、fix usb pm and adb suspend issues.
2)、prevent system suspend when enabling adb.
3)、add android usb adb functions.
4)、system crash if disconnect usb cable during file transfer.
5)、usb cable plug in and out sometimes can cause kernel panic.
3.12. 檔案系統部分(UBIFS、Yaffs2)
UBIFS:
源碼位置:fs/ubifs/
ubifs源碼一直處於更新狀態,每個linux核心版本對應的ubifs源碼都有變化,從linux2.6.32至linux3.0共有6次merge動作。
The UBI File-System source code git tree has two branches: master and linux-next
Master:contains the most recent stuff which is often incomplete, buggy, or not tested very well.
linux-next:contains more or less stable patches goes to main-line.
該部分源碼augustatek有在linux2.6.32版本的基礎上改動更新:
1)、Use continuous memory and async mode to resolve “ubifs is bad for sync mode”.
Yaffs2:
源碼位置:fs/yaffs2/
Linux 3.0版本在linux2.6.32版本基礎上的改動更新:
1)、Don’t force YAFFS_TRACE_ALWAYS for all trace levels.
該部分源碼augustatek有在linux2.6.32版本的基礎上改動更新:
1)、Update yaffs2 from official site to fix un-expected android system perm issue.
3.13. MTD驅動
Linux3.0版本在linux2.6.32的基礎上有針對UBIFS的相關merge動作,此外還有一些針對不同廠商nand的更新改動。
3.14. 顯示驅動(Framebuffer)
android2.2至android4.0期間,android對framebuffer部分的改動更新有:
1)、Add fb_edid_add_monspecs for parsing extended edid information.
2)、Put the partial update magic value into the fix_screen struct.
3)、Add support for RGBX 8888 image format.
4)、Fix framebuffer console(Don’t allow non panning updates to bypass the wait for the panel to turn on).
5)、Set the correct pack pattern for XRGB/ARGB.
6)、Add ION Memory Manager.
3.15. 視頻驅動(V4L2)
Linux 3.0版本在linux2.6.32版本基礎上的改動更新:
1)、增加了對一些camera sensors的支援;
2)、Add a media-bus API for configuring v4l2 subdev pixel and frame formats.
新增的API有
+ enum_mbus_fmt: enumerate pixel formats, provided by a video data source
+ g_mbus_fmt: get the current pixel format, provided by a video data source
+ try_mbus_fmt: try to set a pixel format on a video data source
+ s_mbus_fmt: set a pixel format on a video data source
3.16. 音頻驅動(ALSA)
Linux3.0使用版本alsa-driver-1.0.24,android4.0中alsa-lib已不被使用,取而代之的是tinyalsa.
Linux2.6.32使用版本alsa-driver-1.0.21
3.17. Event輸入裝置驅動  www.2cto.com
Linux 3.0版本在linux2.6.32版本基礎上的改動更新:
1)、增加了對一些input device的支援;
2)、Implement input filters;
+ filter: separates normal event handlers from "filters".
3)、add support for disabling gpios through sysfs;
Now gpio-keys input driver exports 4 new attributes to userland through sysfs: /sys/devices/platform/gpio-keys/keys [ro] /sys/devices/platform/gpio-keys/switches [ro] /sys/devices/platform/gpio-keys/disabled_keys [rw] /sys/devices/platform/gpio-keys/disables_switches [rw]
3.18. Wifi
3.19. Bluetooth
作者:zhengmeifu

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.