1 [![Build Status](https://travis-ci.org/gkostka/lwext4.svg)](https://travis-ci.org/gkostka/lwext4)
3 ![lwext4](https://cloud.githubusercontent.com/assets/8606098/11697327/68306d88-9eb9-11e5-8807-81a2887f077e.png)
8 The main goal of the lwext4 project is to provide ext2/3/4 filesystem for microcontrollers. It may be an interesting alternative for traditional MCU filesystem libraries (mostly based on FAT32).
10 Lwext4 may be used with SD/MMC card, USB flash drive or other block based memory device. However it is not good for flash memory–based storage devices.
12 Code is also available on github:
13 https://github.com/gkostka/lwext4
15 Feel free to contact me:
16 kostka.grzegorz@gmail.com
21 The most of the source code of lwext4 was taken from HelenOS:
23 Some features are based on FreeBSD and Linux implementations.
25 KaHo Ng (https://github.com/ngkaho1234):
26 * advanced extents implementation
28 * metadata checksum support
30 * many bugfixes & improvements
33 * https://github.com/ngkaho1234/fuse-lwext4
38 * filetypes: regular, directories, softlinks
39 * support for hardlinks
40 * multiple blocksize supported: 1KB, 2KB, 4KB ... 64KB
41 * little/big endian architectures supported
42 * multiple configurations (ext2/ext3/ext4)
43 * only C standard library dependency
44 * various CPU architectures supported (x86/64, cortex-mX, msp430 ...)
45 * small memory footprint
48 Memory footprint (for cortex-m4)
51 * .data: 8KB (minimum 8 x 1KB block cache)
54 Supported ext2/3/4 features
56 Features incompatible:
77 * has_journal: yes (in progress)
98 * blockdev - block devices set, supported blockdev
99 * fs_test - test suite, mkfs and demo application
100 * lwext4 - internals of the lwext4 library
101 * toolchain - specific toolchain cmake files
102 * CMakeLists.txt - CMake config file
103 * ext_images.7z - compressed ext2/3/4 100MB images
104 * fs_test.mk - automatic tests definitions
105 * Makefile - helper makefile to generate cmake and run test suite
106 * readme.mediawiki - readme file
114 Download MSYS-2: https://sourceforge.net/projects/msys2/
116 Install required packages is MSYS2 Shell package manager:
118 pacman -S make gcc cmake p7zip
123 Package installation (Debian):
125 apt-get install make gcc cmake p7zip
128 Compile & install tools
137 lwext4-generic demo application
139 Simple lwext4 library test application:
140 * load ext2/3/4 images
141 * load linux block device with ext2/3/4 part
142 * load windows volume with ext2/3/4 filesystem
143 * directory speed test
144 * file write/read speed test
146 How to use for images/blockdevices:
148 lwext4-generic -i ext_images/ext2
149 lwext4-generic -i ext_images/ext3
150 lwext4-generic -i ext_images/ext4
153 Show full option set:
155 lwext4-generic --help
161 Execute tests for 100MB unpacked images:
165 Execute tests for autogenerated 1GB images (only on Linux targets) + fsck:
169 Using lwext4-mkfs tool
171 It is possible to create ext2/3/4 partition by internal library tool.
173 Generate empty file (1GB):
175 dd if=/dev/zero of=ext_image bs=1M count=1024
177 Create ext2 partition:
179 lwext4-mkfs -i ext_image -e 2
181 Create ext3 partition:
183 lwext4-mkfs -i ext_image -e 3
185 Create ext4 partition:
187 lwext4-mkfs -i ext_image -e 4
189 Show full option set:
194 Cross compile standalone library
198 * arm-none-eabi-gcc for cortex-mX
200 * bfin-elf-gcc for bfin
201 * msp430-gcc for msp430
212 Build avrxmega7 library:
220 Build cortex-m0 library:
228 Build cortex-m3 library:
236 Build cortex-m4 library: