Embedded Linux and the mainline kernel                           David Woodhouse                                         K...
Where does Linux run?Embedded control device... phone...PDA... Internet tablet... router...media device... netbook... lapt...
“Embedded”...?• Control equipment• Phones• PDAs• “Internet Tablets”• Routers• Televisions• VCR / PVR / DVD / Media• Netboo...
“Embedded”...?• Headless?• Handheld?• Power source?• Physical size?• Limited RAM?• Storage?• Other...                     ...
Embedded needs• Power management• Fast startup• Headless operation• Uncluttered user interfaces• Solid state storage      ...
Embedded needs• Power management• Fast startup• Headless operation• Uncluttered user interfaces• Solid state storage Other...
Power Management• Battery life                           Software and Services Group   7                                  ...
Power Management• Battery life• Cost of power consumption• Heat output                              Software and Services ...
Tickless operation• Power savings                              Software and Services Group   9                            ...
Tickless operation• Power savings• Scalability for virtualisation                                   Software and Services ...
Fast boot• Hard limits for mobile telephones• User experience for consumer electronics                                 Sof...
Fast boot• Hard limits for mobile telephones• User experience for consumer electronics• Server availability               ...
User interfaces• Ease of use for consumer equipment                               Software and Services Group   13        ...
User interfaces• Ease of use for consumer equipment• ...   and for everyone else:   –    OLPC / Sugar   –    Netbooks   – ...
Solid state storage• FLASH storage in “embedded” devices                              Software and Services Group   15    ...
Solid state storage• FLASH storage in “embedded” devices• Solid State Disk                              Software and Servi...
Others...• Execute in place (XIP)   – From FLASH for embedded systems   – Shared file system data under virtualisation• DM...
We are not so  special!       Software and Services Group   18                                     18
Community impressions• “Enterprise” Linux• “Embedded” Linux                         Software and Services Group   19      ...
Community impressions• “Enterprise” Linux• “Embedded” Linux   – Working with old code   – Not working with upstream   – In...
Community impressions• “Enterprise” Linux• “Embedded” Linux   – Working with old code   – Not working with upstream   – In...
“Embedded” success stories• Tickless• Preemptive kernel• Power management• Suspend to RAM• Solid state storage• Squashfs  ...
Working with the community• Find generic points of interest• Publish early and often   – In git trees   – Separate trees f...
Staying close to upstream• Advantages   – Easier for product updates and new products   – Easy to use fixes and new featur...
Tips on contributing code• Avoid hacking around problems• Avoid overengineering• Care about locking• Coding Style• Submit ...
Coding Style• Simple, short functions• Avoid:   – typedefs   – StudlyCaps   – Hungarian Notation• Read Documentation/Codin...
Submitting Patches• Read the patch before you send it      --- a/drivers/net/wireless/libertas/assoc.c      +++ b/drivers/...
Submitting Patches• Read the patch before you send it      --- a/drivers/net/wireless/libertas/assoc.c      +++ b/drivers/...
Submitting Patches• Read the patch before you send it• Use scripts/checkpatch.pl $ scripts/checkpatch.pl 0002-MESH-START-S...
Submitting Patches• Read the patch before you send it• Use scripts/checkpatch.pl• Send patches to yourself first  $ patch ...
Submitting Patches• Read the patch before you send it• Use scripts/checkpatch.pl• Send patches to yourself first• Read Doc...
Submitting Patches• Read the patch before you send it• Use scripts/checkpatch.pl• Send patches to yourself first• Read Doc...
Whats next for “Embedded” Linux?• Solid state storage   – More work on SSDs   – Flash file system development (UBI, logfs,...
Questions?       Software and Services Group   34                                     34
Upcoming SlideShare
Loading in...5
×

Embedded is not special

456

Published on

How embedded Linux isn’t so special, and most of the « embedded requirements » are also requirements in « big iron » too
http://kernel-recipes.org

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
456
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Embedded is not special

  1. 1. Embedded Linux and the mainline kernel David Woodhouse Kernel Recipes September 2012 Software and Services Group
  2. 2. Where does Linux run?Embedded control device... phone...PDA... Internet tablet... router...media device... netbook... laptop...desktop... server... supercomputer... Software and Services Group 2 2
  3. 3. “Embedded”...?• Control equipment• Phones• PDAs• “Internet Tablets”• Routers• Televisions• VCR / PVR / DVD / Media• Netbooks (?) Software and Services Group 3 3
  4. 4. “Embedded”...?• Headless?• Handheld?• Power source?• Physical size?• Limited RAM?• Storage?• Other... Software and Services Group 4 4
  5. 5. Embedded needs• Power management• Fast startup• Headless operation• Uncluttered user interfaces• Solid state storage Software and Services Group 5 5
  6. 6. Embedded needs• Power management• Fast startup• Headless operation• Uncluttered user interfaces• Solid state storage Other users need these features too! Software and Services Group 6 6
  7. 7. Power Management• Battery life Software and Services Group 7 7
  8. 8. Power Management• Battery life• Cost of power consumption• Heat output Software and Services Group 8 8
  9. 9. Tickless operation• Power savings Software and Services Group 9 9
  10. 10. Tickless operation• Power savings• Scalability for virtualisation Software and Services Group 10 10
  11. 11. Fast boot• Hard limits for mobile telephones• User experience for consumer electronics Software and Services Group 11 11
  12. 12. Fast boot• Hard limits for mobile telephones• User experience for consumer electronics• Server availability Software and Services Group 12 12
  13. 13. User interfaces• Ease of use for consumer equipment Software and Services Group 13 13
  14. 14. User interfaces• Ease of use for consumer equipment• ... and for everyone else: – OLPC / Sugar – Netbooks – Simple desktop environments Software and Services Group 14 14
  15. 15. Solid state storage• FLASH storage in “embedded” devices Software and Services Group 15 15
  16. 16. Solid state storage• FLASH storage in “embedded” devices• Solid State Disk Software and Services Group 16 16
  17. 17. Others...• Execute in place (XIP) – From FLASH for embedded systems – Shared file system data under virtualisation• DMA API usage – For cache coherency on embedded systems (ARM, some PPC) – For IOMMU on larger systems Software and Services Group 17 17
  18. 18. We are not so special! Software and Services Group 18 18
  19. 19. Community impressions• “Enterprise” Linux• “Embedded” Linux Software and Services Group 19 19
  20. 20. Community impressions• “Enterprise” Linux• “Embedded” Linux – Working with old code – Not working with upstream – Inclined towards “special” one-off hacks – Irrelevant to the general case Software and Services Group 20 20
  21. 21. Community impressions• “Enterprise” Linux• “Embedded” Linux – Working with old code – Not working with upstream – Inclined towards “special” one-off hacks – Irrelevant to the general case We must prove them wrong! Software and Services Group 21 21
  22. 22. “Embedded” success stories• Tickless• Preemptive kernel• Power management• Suspend to RAM• Solid state storage• Squashfs Software and Services Group 22 22
  23. 23. Working with the community• Find generic points of interest• Publish early and often – In git trees – Separate trees for separate development efforts – Also send patches for review• Solicit and respond to feedback• Work with upstream maintainers• BE PART OF THE COMMUNITY! Software and Services Group 23 23
  24. 24. Staying close to upstream• Advantages – Easier for product updates and new products – Easy to use fixes and new features – External contributions – Code review and testing• Costs – Writing acceptable code can be hard and takes time – Upstream kernel is a fast-moving target – Releasing information may be difficult Software and Services Group 24 24
  25. 25. Tips on contributing code• Avoid hacking around problems• Avoid overengineering• Care about locking• Coding Style• Submit patches carefully Software and Services Group 25 25
  26. 26. Coding Style• Simple, short functions• Avoid: – typedefs – StudlyCaps – Hungarian Notation• Read Documentation/CodingStyle http://www.linux.or.jp/JF/JFdocs/kernel-docs- 2.6/CodingStyle.html Software and Services Group 26 26
  27. 27. Submitting Patches• Read the patch before you send it --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c @@ -13,6 +13,7 @@ static const u8 bssid_any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; static const u8 bssid_off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +extern int libertas_mesh_config(wlan_private * priv, int action,int channel,char *str); static void print_assoc_req(const char * extra, struct assoc_request * assoc_req) { @@ -211,9 +212,17 @@ static int assoc_helper_channel(wlan_private *priv, { wlan_adapter *adapter = priv->adapter; int ret = 0; + int restart_mesh = 0; lbs_deb_enter(LBS_DEB_ASSOC); + if(adapter->mesh_connect_status == LIBERTAS_CONNECTED) + { + libertas_mesh_config(priv,0,adapter->curbssparams.channel,NULL); + restart_mesh = 1; + + } + ret = update_channel(priv); if (ret < 0) { lbs_deb_assoc("ASSOC: channel: error getting channel."); @@ -225,11 +234,13 @@ static int assoc_helper_channel(wlan_private *priv, lbs_deb_assoc("ASSOC: channel: %d -> %dn", adapter->curbssparams.channel, assoc_req->channel); + ret = libertas_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, CMD_OPT_802_11_RF_CHANNEL_SET, Software and Services Group 27 27
  28. 28. Submitting Patches• Read the patch before you send it --- a/drivers/net/wireless/libertas/assoc.c +++ b/drivers/net/wireless/libertas/assoc.c @@ -13,6 +13,7 @@ static const u8 bssid_any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; static const u8 bssid_off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +extern int libertas_mesh_config(wlan_private * priv, int action,int channel,char *str); static void print_assoc_req(const char * extra, struct assoc_request * assoc_req) { @@ -211,9 +212,17 @@ static int assoc_helper_channel(wlan_private *priv, { wlan_adapter *adapter = priv->adapter; int ret = 0; + int restart_mesh = 0; lbs_deb_enter(LBS_DEB_ASSOC); + if(adapter->mesh_connect_status == LIBERTAS_CONNECTED) + { + libertas_mesh_config(priv,0,adapter->curbssparams.channel,NULL); + restart_mesh = 1; + + } + ret = update_channel(priv); if (ret < 0) { lbs_deb_assoc("ASSOC: channel: error getting channel."); @@ -225,11 +234,13 @@ static int assoc_helper_channel(wlan_private *priv, lbs_deb_assoc("ASSOC: channel: %d -> %dn", adapter->curbssparams.channel, assoc_req->channel); + ret = libertas_prepare_and_send_command(priv, CMD_802_11_RF_CHANNEL, CMD_OPT_802_11_RF_CHANNEL_SET, Software and Services Group 28 28
  29. 29. Submitting Patches• Read the patch before you send it• Use scripts/checkpatch.pl $ scripts/checkpatch.pl 0002-MESH-START-STOP_IOCTLS.patch WARNING: line over 80 characters #7: FILE: drivers/net/wireless/libertas/assoc.c:16: +extern int libertas_mesh_config(wlan_private * priv, int action,int channel,char *str); ERROR: "foo * bar" should be "foo *bar" #7: FILE: drivers/net/wireless/libertas/assoc.c:16: +extern int libertas_mesh_config(wlan_private * priv, int action,int channel,char *str); ERROR: need space after that , (ctx:VxV) #7: FILE: drivers/net/wireless/libertas/assoc.c:16: +extern int libertas_mesh_config(wlan_private * priv, int action,int channel,char *str); ^ WARNING: externs should be avoided in .c files #7: FILE: drivers/net/wireless/libertas/assoc.c:16: +extern int libertas_mesh_config(wlan_private * priv, int action,int channel,char *str); ERROR: That open brace { should be on the previous line #19: FILE: drivers/net/wireless/libertas/assoc.c:219: + if(adapter->mesh_connect_status == LIBERTAS_CONNECTED) + { ERROR: need a space before the open parenthesis ( #19: FILE: drivers/net/wireless/libertas/assoc.c:219: + if(adapter->mesh_connect_status == LIBERTAS_CONNECTED) Software and Services Group 29 29
  30. 30. Submitting Patches• Read the patch before you send it• Use scripts/checkpatch.pl• Send patches to yourself first $ patch -p1 < saved-email.txt patching file drivers/net/wireless/libertas/assoc.c Hunk #1 FAILED at 13. Hunk #2 FAILED at 212. Hunk #3 FAILED at 234. patch: **** malformed patch at line 71: adapter->meshid); Software and Services Group 30 30
  31. 31. Submitting Patches• Read the patch before you send it• Use scripts/checkpatch.pl• Send patches to yourself first• Read Documentation/SubmittingPatches   or Documentation/ja_JP/SubmittingPatches Software and Services Group 31 31
  32. 32. Submitting Patches• Read the patch before you send it• Use scripts/checkpatch.pl• Send patches to yourself first• Read Documentation/SubmittingPatches• Include appropriate description commit 4ac9137858e08a19f29feac4e1f4df7c268b0ba5 Author: Jan Blunck <jblunck@suse.de> Date: Thu Feb 14 19:34:32 2008 -0800 Embed a struct path into struct nameidata instead of nd->{dentry,mnt} This is the central patch of a cleanup series. In most cases there is no good reason why someone would want to use a dentry for itself. This series reflects that fact and embeds a struct path into nameidata. Together with the other patches of this series - it enforced the correct order of getting/releasing the reference count on <dentry,vfsmount> pairs - it prepares the VFS for stacking support since it is essential to have a struct path in every place where the stack can be traversed Software and Services Group 32 32
  33. 33. Whats next for “Embedded” Linux?• Solid state storage – More work on SSDs – Flash file system development (UBI, logfs, btrfs)• Better power management• More real time development• What do you need? Software and Services Group 33 33
  34. 34. Questions? Software and Services Group 34 34

×