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