SlideShare a Scribd company logo
Embedded Storage
  Management



© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>
               All Rights Reserved.
What to Expect?
W's of Memory Technology Devices
MTD Subsystem
MTD related Drivers
Flash File Systems
Flash Tools




        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   2
                       All Rights Reserved.
Storage Timeline
Traditionally (for most of past 20+ years)
  ROM – For read-only storage
  NVRAM – For read-write storage
Equating with today's technology
  Low-density
  Costlier
Latest trend is flash technology devices
  More commonly referred as MTD
  Comes as NOR, NAND, some exotic varieties
  Best suited for Embedded Systems
             © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   3
                            All Rights Reserved.
What are
Memory Technology Devices?
Embedded Flash Memory
Contains Large Erase Blocks
  32KB to 128KB
Maintains three main Operations
  Read, Write, Erase from Erase Block
Bad Erase Blocks to be dealt by software
Erase Blocks get worn out after some
erase cycles
         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   4
                        All Rights Reserved.
NOR Flash
Reading like RAM
 Random Access
 Execute Code (XIP)
 Could be replacement for ROM (but slower)
Manufacturers
 Intel, AMD, Fujitsu and Toshiba
Capacity
 Typically from a few KBs to 64MB

        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   5
                       All Rights Reserved.
NAND Flash
Reading like Hard Disk
  Multiples of 512 bytes at a time
  No XIP
Higher Density & Cheaper than NOR
Highly prone to errors at the bit level
  Needs software to handle bad blocks
Manufacturers: Samsung and Toshiba
Capacity: Typically from 8MB to 1024MB. Today,
even more
           © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   6
                          All Rights Reserved.
Writing into Flash
Same for both NOR and NAND Flash
Sequence of Steps needed
Almost always involve an erase cycle
As Writing of Data means
  Flipping a bit to "0" or leaving it as a "1"
  Flipping a bit to "1" needs an erase cycle




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   7
                        All Rights Reserved.
MTD Subsystem
                  File I/O                        Raw I/O, MTD Utils
                                                                 User Space
                VFS Layer                                        Kernel Space



Individual File Systems


  mtdblock, FTL, NFTL           mtdchar            JFFS2    YAFFS2


                                MTD Core                                 MTD Layer
NAND Chip
 Drivers
                 NOR Chip Drivers
                                                   Map Drivers
                   (CFI, JEDEC)
                             Probe
                                                                 Hardware Space
                                            I/O
  NAND                   NOR
            © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>                        8
                           All Rights Reserved.
Map Drivers
Drivers to Map
  Flash Memory Range for CPU access
  Mark the Storage Partitions in the Kernel
       As no partition table on flash
       Shows up as /dev/mtd*
Example
  Browse the drivers/mtd/maps/ folder
Data Structures
  struct mtd_partition (Header: <linux/mtd/partitions.h>)
  struct map_info (Header: <linux/mtd/map.h>)
Header: <linux/mtd/mtd.h>
APIs
  int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
  int del_mtd_partitions(struct mtd_info *);
                     © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>            9
                                    All Rights Reserved.
NOR Chip Drivers
NOR Chip Drivers
  CFI specification
  JEDEC specification
CFI Command Sets
  0x01 – Intel & Sharp flash chips
  0x02 – AMD & Fujitsu flash chips
  0x03 – ST flash chips
All three are configurable in kernel

         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   10
                        All Rights Reserved.
NAND Chip Drivers
Drivers for NAND Controller to access NAND
Sources: drivers/mtd/nand/
A NAND Drive should do the following
  Add an entry to nand_flash_ids[] in drivers/mtd/nand/nand_ids.c
  Entries being
    Id Name, Device Id, Page Size, Erase Block Size, Chip Size, Options like
    Bus Width, …
  As, no automatic configuration support
  Specify its out-of-band (OOB) spare area layout through the
  “struct nand_ecclayout” (Header: <mtd/mtd-abi.h>)
    For ECCs, to implement error correction & detection
  Enable Error Management, in case NAND Controller doesn't do it
    Software ECC is implemented in drivers/mtd/nand/nand_ecc.c
               © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>               11
                              All Rights Reserved.
Kernel Configurations for MTD
CONFIG_MTD should be enabled
And whatever required under it, should be
enabled, e.g.
  Required NAND Driver, Or
  Required NOR Protocol
  etc




        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   12
                       All Rights Reserved.
File Systems for Flash
Typical Requirements
  Flash wear-levelling
  Less Writes / Erases
  Protect Data during Erase Cycles
  Bad Block Management (esp for NAND)
  Possibly compression (though preferred on read-only
  file systems only)
File Systems handling these
  JFFS2 (log-structured design & garbage collection)
  YAFFS2 (specifically designed for NAND constraints)

           © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   13
                          All Rights Reserved.
Flash Tools
Useful tools to work with MTD layer
  flash_erase, flash_eraseall
  flash_lock, flash_unlock
  nanddump, nandwrite
  sumtool
  ...
Download from ftp://ftp.infradead.org/pub/mtd-utils
Tool to construct a JFFS2 file system image
  mkfs.jffs2

            © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   14
                           All Rights Reserved.
What all have we learnt?
W's of Memory Technology Devices
  About NOR & NAND
MTD Subsystem
MTD related Drivers
  Map, NOR Chip, NAND Chip
Flash File Systems
Flash Tools

        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   15
                       All Rights Reserved.
Any Queries?




© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   16
               All Rights Reserved.

More Related Content

What's hot

Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
Anil Kumar Pugalia
 
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
SysPlay eLearning Academy for You
 
Linux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingAnil Kumar Pugalia
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded SystemsAnil Kumar Pugalia
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
SysPlay eLearning Academy for You
 
Bootloaders
BootloadersBootloaders
Bootloaders
Anil Kumar Pugalia
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
Anil Kumar Pugalia
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
SysPlay eLearning Academy for You
 
SPI Drivers
SPI DriversSPI Drivers
File System Modules
File System ModulesFile System Modules
File System Modules
Anil Kumar Pugalia
 

What's hot (20)

Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Block Drivers
Block DriversBlock Drivers
Block Drivers
 
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
Linux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
Bootloaders
BootloadersBootloaders
Bootloaders
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
 
PCI Drivers
PCI DriversPCI Drivers
PCI Drivers
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
Linux Network Management
Linux Network ManagementLinux Network Management
Linux Network Management
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
Signals
SignalsSignals
Signals
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
Synchronization
SynchronizationSynchronization
Synchronization
 

Viewers also liked

Interrupts
InterruptsInterrupts
Interrupts
Anil Kumar Pugalia
 
Embedded C
Embedded CEmbedded C
Embedded C
Anil Kumar Pugalia
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
Anil Kumar Pugalia
 
Threads
ThreadsThreads

Viewers also liked (14)

Embedded I/O Management
Embedded I/O ManagementEmbedded I/O Management
Embedded I/O Management
 
Interrupts
InterruptsInterrupts
Interrupts
 
File Systems
File SystemsFile Systems
File Systems
 
Embedded Applications
Embedded ApplicationsEmbedded Applications
Embedded Applications
 
Timers
TimersTimers
Timers
 
Processes
ProcessesProcesses
Processes
 
Embedded C
Embedded CEmbedded C
Embedded C
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
System Calls
System CallsSystem Calls
System Calls
 
Board Bringup
Board BringupBoard Bringup
Board Bringup
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Threads
ThreadsThreads
Threads
 
Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
 

Similar to Embedded Storage Management

建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card
艾鍗科技
 
Presentation sparc m6 m5-32 server technical overview
Presentation   sparc m6 m5-32 server technical overviewPresentation   sparc m6 m5-32 server technical overview
Presentation sparc m6 m5-32 server technical overview
solarisyougood
 
Towards Software Defined Persistent Memory
Towards Software Defined Persistent MemoryTowards Software Defined Persistent Memory
Towards Software Defined Persistent Memory
Swaminathan Sundararaman
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversAnil Kumar Pugalia
 
Cheap vs High End PC
Cheap vs High End PCCheap vs High End PC
Cheap vs High End PC
Manish Tuladhar
 
LCE13: Android Graphics Upstreaming
LCE13: Android Graphics UpstreamingLCE13: Android Graphics Upstreaming
LCE13: Android Graphics Upstreaming
Linaro
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.
 
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Ingria. Technopark St. Petersburg
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Samsung Open Source Group
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
Opersys inc.
 
linux trim
linux trimlinux trim
linux trimbergwolf
 
Memory Management in TIZEN - Samsung SW Platform Team
Memory Management in TIZEN - Samsung SW Platform TeamMemory Management in TIZEN - Samsung SW Platform Team
Memory Management in TIZEN - Samsung SW Platform Team
Ryo Jin
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersProfessorLance
 
my Windows 7 info
my Windows 7 infomy Windows 7 info
my Windows 7 infoisky guard
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersProfessorLance
 
The ideal and reality of NVDIMM RAS
The ideal and reality of NVDIMM RASThe ideal and reality of NVDIMM RAS
The ideal and reality of NVDIMM RAS
Yasunori Goto
 

Similar to Embedded Storage Management (20)

建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card
 
Presentation sparc m6 m5-32 server technical overview
Presentation   sparc m6 m5-32 server technical overviewPresentation   sparc m6 m5-32 server technical overview
Presentation sparc m6 m5-32 server technical overview
 
Towards Software Defined Persistent Memory
Towards Software Defined Persistent MemoryTowards Software Defined Persistent Memory
Towards Software Defined Persistent Memory
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
 
Cheap vs High End PC
Cheap vs High End PCCheap vs High End PC
Cheap vs High End PC
 
LCE13: Android Graphics Upstreaming
LCE13: Android Graphics UpstreamingLCE13: Android Graphics Upstreaming
LCE13: Android Graphics Upstreaming
 
No[1][1]
No[1][1]No[1][1]
No[1][1]
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
 
Dlm ppt
Dlm pptDlm ppt
Dlm ppt
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
linux trim
linux trimlinux trim
linux trim
 
Memory Management in TIZEN - Samsung SW Platform Team
Memory Management in TIZEN - Samsung SW Platform TeamMemory Management in TIZEN - Samsung SW Platform Team
Memory Management in TIZEN - Samsung SW Platform Team
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
 
my Windows 7 info
my Windows 7 infomy Windows 7 info
my Windows 7 info
 
Comp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answersComp 129 final exam 100% correct answers
Comp 129 final exam 100% correct answers
 
The ideal and reality of NVDIMM RAS
The ideal and reality of NVDIMM RASThe ideal and reality of NVDIMM RAS
The ideal and reality of NVDIMM RAS
 

More from Anil Kumar Pugalia

Processes
ProcessesProcesses
Playing with R L C Circuits
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C Circuits
Anil Kumar Pugalia
 
References
ReferencesReferences
References
Anil Kumar Pugalia
 
Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISPAnil Kumar Pugalia
 
Hardware Design for Software Hackers
Hardware Design for Software HackersHardware Design for Software Hackers
Hardware Design for Software Hackers
Anil Kumar Pugalia
 

More from Anil Kumar Pugalia (10)

Processes
ProcessesProcesses
Processes
 
System Calls
System CallsSystem Calls
System Calls
 
Playing with R L C Circuits
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C Circuits
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
References
ReferencesReferences
References
 
Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISP
 
Power of vi
Power of viPower of vi
Power of vi
 
"make" system
"make" system"make" system
"make" system
 
Hardware Design for Software Hackers
Hardware Design for Software HackersHardware Design for Software Hackers
Hardware Design for Software Hackers
 
RPM Building
RPM BuildingRPM Building
RPM Building
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 

Embedded Storage Management

  • 1. Embedded Storage Management © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> All Rights Reserved.
  • 2. What to Expect? W's of Memory Technology Devices MTD Subsystem MTD related Drivers Flash File Systems Flash Tools © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2 All Rights Reserved.
  • 3. Storage Timeline Traditionally (for most of past 20+ years) ROM – For read-only storage NVRAM – For read-write storage Equating with today's technology Low-density Costlier Latest trend is flash technology devices More commonly referred as MTD Comes as NOR, NAND, some exotic varieties Best suited for Embedded Systems © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 3 All Rights Reserved.
  • 4. What are Memory Technology Devices? Embedded Flash Memory Contains Large Erase Blocks 32KB to 128KB Maintains three main Operations Read, Write, Erase from Erase Block Bad Erase Blocks to be dealt by software Erase Blocks get worn out after some erase cycles © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 4 All Rights Reserved.
  • 5. NOR Flash Reading like RAM Random Access Execute Code (XIP) Could be replacement for ROM (but slower) Manufacturers Intel, AMD, Fujitsu and Toshiba Capacity Typically from a few KBs to 64MB © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 5 All Rights Reserved.
  • 6. NAND Flash Reading like Hard Disk Multiples of 512 bytes at a time No XIP Higher Density & Cheaper than NOR Highly prone to errors at the bit level Needs software to handle bad blocks Manufacturers: Samsung and Toshiba Capacity: Typically from 8MB to 1024MB. Today, even more © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 6 All Rights Reserved.
  • 7. Writing into Flash Same for both NOR and NAND Flash Sequence of Steps needed Almost always involve an erase cycle As Writing of Data means Flipping a bit to "0" or leaving it as a "1" Flipping a bit to "1" needs an erase cycle © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 7 All Rights Reserved.
  • 8. MTD Subsystem File I/O Raw I/O, MTD Utils User Space VFS Layer Kernel Space Individual File Systems mtdblock, FTL, NFTL mtdchar JFFS2 YAFFS2 MTD Core MTD Layer NAND Chip Drivers NOR Chip Drivers Map Drivers (CFI, JEDEC) Probe Hardware Space I/O NAND NOR © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 8 All Rights Reserved.
  • 9. Map Drivers Drivers to Map Flash Memory Range for CPU access Mark the Storage Partitions in the Kernel As no partition table on flash Shows up as /dev/mtd* Example Browse the drivers/mtd/maps/ folder Data Structures struct mtd_partition (Header: <linux/mtd/partitions.h>) struct map_info (Header: <linux/mtd/map.h>) Header: <linux/mtd/mtd.h> APIs int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); int del_mtd_partitions(struct mtd_info *); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 9 All Rights Reserved.
  • 10. NOR Chip Drivers NOR Chip Drivers CFI specification JEDEC specification CFI Command Sets 0x01 – Intel & Sharp flash chips 0x02 – AMD & Fujitsu flash chips 0x03 – ST flash chips All three are configurable in kernel © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 10 All Rights Reserved.
  • 11. NAND Chip Drivers Drivers for NAND Controller to access NAND Sources: drivers/mtd/nand/ A NAND Drive should do the following Add an entry to nand_flash_ids[] in drivers/mtd/nand/nand_ids.c Entries being Id Name, Device Id, Page Size, Erase Block Size, Chip Size, Options like Bus Width, … As, no automatic configuration support Specify its out-of-band (OOB) spare area layout through the “struct nand_ecclayout” (Header: <mtd/mtd-abi.h>) For ECCs, to implement error correction & detection Enable Error Management, in case NAND Controller doesn't do it Software ECC is implemented in drivers/mtd/nand/nand_ecc.c © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 11 All Rights Reserved.
  • 12. Kernel Configurations for MTD CONFIG_MTD should be enabled And whatever required under it, should be enabled, e.g. Required NAND Driver, Or Required NOR Protocol etc © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 12 All Rights Reserved.
  • 13. File Systems for Flash Typical Requirements Flash wear-levelling Less Writes / Erases Protect Data during Erase Cycles Bad Block Management (esp for NAND) Possibly compression (though preferred on read-only file systems only) File Systems handling these JFFS2 (log-structured design & garbage collection) YAFFS2 (specifically designed for NAND constraints) © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 13 All Rights Reserved.
  • 14. Flash Tools Useful tools to work with MTD layer flash_erase, flash_eraseall flash_lock, flash_unlock nanddump, nandwrite sumtool ... Download from ftp://ftp.infradead.org/pub/mtd-utils Tool to construct a JFFS2 file system image mkfs.jffs2 © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 14 All Rights Reserved.
  • 15. What all have we learnt? W's of Memory Technology Devices About NOR & NAND MTD Subsystem MTD related Drivers Map, NOR Chip, NAND Chip Flash File Systems Flash Tools © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 15 All Rights Reserved.
  • 16. Any Queries? © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 16 All Rights Reserved.