Add logo to README.md
[lwext4.git] / README.md
1 [![Build Status](https://travis-ci.org/gkostka/lwext4.svg)](https://travis-ci.org/gkostka/lwext4)
2
3 ![lwext4](https://cloud.githubusercontent.com/assets/8606098/11697327/68306d88-9eb9-11e5-8807-81a2887f077e.png)
4
5 About
6 =====
7
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).
9
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.
11
12 Code is also available on github:
13 https://github.com/gkostka/lwext4
14
15 Feel free to contact me:
16 kostka.grzegorz@gmail.com
17
18 Credits
19 =====
20
21 The most of the source code of lwext4 was taken from HelenOS:
22 * http://helenos.org/
23 Some features are based on FreeBSD and Linux implementations.
24
25 KaHo Ng (https://github.com/ngkaho1234):
26 * advanced extents implementation
27 * xattr support
28 * metadata checksum support
29 * journal recovery
30 * many bugfixes & improvements
31
32 fuse-lwext4 project:
33 * https://github.com/ngkaho1234/fuse-lwext4
34
35 Features
36 =====
37
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
46
47
48 Memory footprint (for cortex-m4)
49 ------------
50 * .text:  20KB - 40KB 
51 * .data:  8KB         (minimum 8 x 1KB  block cache)
52 * .stack: 2KB
53
54 Supported ext2/3/4 features
55 =====
56 Features incompatible:
57 ------------
58 *  compression: no
59 *  filetype: yes
60 *  recover: no
61 *  journal_dev: no
62 *  meta_bg: yes
63 *  extents: yes
64 *  64bit: yes
65 *  mmp: no
66 *  flex_bg: yes
67 *  ea_inode: no
68 *  dirdata: no
69 *  bg_meta_csum: no
70 *  largedir: no
71 *  inline_data: no
72
73 Features compatible:
74 ------------
75 *  dir_prealloc: no
76 *  imagic_inodes: no
77 *  has_journal: yes (in progress)
78 *  ext_attr: yes
79 *  resize_inode: no
80 *  dir_index: yes
81
82 Features read-only:
83 ------------
84 *  sparse_super: yes
85 *  large_file: yes
86 *  btree_dir: yes
87 *  huge_file: yes
88 *  gdt_csum: yes
89 *  dir_nlink: yes
90 *  extra_isize: yes
91 *  quota: no
92 *  bigalloc: no
93 *  metadata_csum: yes
94
95
96 Project tree
97 =====
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
107   
108 Compile
109 =====
110 Windows
111 ------------
112 * CMake:  http://www.cmake.org/cmake/resources/software.html
113 * MinGw:  http://www.mingw.org/
114 * GnuWin: http://gnuwin32.sourceforge.net/ 
115
116 Linux
117 ------------
118 * CMake, make, gcc
119
120 Generate makefiles
121 ------------
122 ```bash
123  make
124  ```
125
126 Compile
127 ------------
128 ```bash
129  cd build_generic
130  make
131  ```
132
133
134 Generic demo application
135 =====
136 Simple lwext4 library presentation:
137 * load ext2/3/4 images
138 * load linux block device with ext2/3/4 part
139 * load windows volume with ext2/3/4 filesystem 
140 * directory speed test
141 * file write/read speed test
142
143 How to use for images/blockdevices:
144 ```bash
145  cd build_generic
146  lwext4_generic -i ext_images/ext2 
147  lwext4_generic -i ext_images/ext3 
148  lwext4_generic -i ext_images/ext4 
149  ```
150
151
152 Build and run automatic tests
153 =====
154 Build automatic test tools:
155 ```bash
156  make
157  cd build_generic
158  make
159   ```
160 Uncompress ext/2/3/4 images:
161 ```bash
162  make unpack_images
163    ```
164 Run server for one of the image file:
165 ```bash
166  make server_ext2
167  make server_ext3
168  make server_ext4
169   ```
170 Execute tests:
171 ```bash
172  make test
173    ```
174
175 Cross compile standalone library
176 =====
177 Toolchains needed:
178 ------------
179 * arm-none-eabi-gcc for cortex-mX
180 * avr-gcc for avr
181 * bfin-elf-gcc for bfin
182 * msp430-gcc for msp430
183
184
185 Build bf518 library:
186 ------------
187 ```bash
188  make bf518
189  cd build_bf518
190  make lwext4
191  ```
192
193 Build avrxmega7 library:
194 ------------
195 ```bash
196  make avrxmega7
197  cd build_avrxmega7
198  make lwext4
199  ```
200
201 Build cortex-m0 library:
202 ------------
203 ```bash
204  make cortex-m0
205  cd build_cortex-m0
206  make lwext4
207  ```
208
209 Build cortex-m3 library:
210 ------------
211 ```bash
212  make cortex-m3
213  cd build_cortex-m3
214  make lwext4
215  ```
216
217 Build cortex-m4 library:
218 ------------
219 ```bash
220  make cortex-m4
221  cd build_cortex-m4
222  make lwext4
223 ```
224
225