ext4_journal: journal write skeleton code.
[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 & install tools
127 ------------
128 ```bash
129  cd build_generic
130  make
131  sudo make install
132  ```
133
134 lwext4-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  lwext4-generic -i ext_images/ext2 
146  lwext4-generic -i ext_images/ext3 
147  lwext4-generic -i ext_images/ext4 
148  ```
149  
150 Show full option set:
151 ```bash
152  lwext4-generic --help
153    ```
154
155 Run automatic tests
156 =====
157
158 Execute tests for 100MB unpacked images:
159 ```bash
160  make test
161    ```
162 Execute tests for autogenerated 1GB images (only on Linux targets) + fsck:
163 ```bash
164  make test_all
165    ```
166 Using lwext4-mkfs tool
167 =====
168 It is possible to create ext2/3/4 partition by internal library tool.
169
170 Generate empty file (1GB):
171 ```bash
172  dd if=/dev/zero of=ext_image bs=1M count=1024
173    ```
174 Create ext2 partition:
175 ```bash
176  lwext4-mkfs -i ext_image -e 2
177    ```
178 Create ext3 partition:
179 ```bash
180  lwext4-mkfs -i ext_image -e 3
181    ```
182 Create ext4 partition:
183 ```bash
184  lwext4-mkfs -i ext_image -e 4
185    ```
186 Show full option set:
187 ```bash
188  lwext4-mkfs --help
189    ```
190
191 Cross compile standalone library
192 =====
193 Toolchains needed:
194 ------------
195 * arm-none-eabi-gcc for cortex-mX
196 * avr-gcc for avr
197 * bfin-elf-gcc for bfin
198 * msp430-gcc for msp430
199
200
201 Build bf518 library:
202 ------------
203 ```bash
204  make bf518
205  cd build_bf518
206  make lwext4
207  ```
208
209 Build avrxmega7 library:
210 ------------
211 ```bash
212  make avrxmega7
213  cd build_avrxmega7
214  make lwext4
215  ```
216
217 Build cortex-m0 library:
218 ------------
219 ```bash
220  make cortex-m0
221  cd build_cortex-m0
222  make lwext4
223  ```
224
225 Build cortex-m3 library:
226 ------------
227 ```bash
228  make cortex-m3
229  cd build_cortex-m3
230  make lwext4
231  ```
232
233 Build cortex-m4 library:
234 ------------
235 ```bash
236  make cortex-m4
237  cd build_cortex-m4
238  make lwext4
239 ```
240
241