fs.nut 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. --
  2. -- Copyright (C) 2004-2005 by egnite Software GmbH. All rights reserved.
  3. --
  4. -- Redistribution and use in source and binary forms, with or without
  5. -- modification, are permitted provided that the following conditions
  6. -- are met:
  7. --
  8. -- 1. Redistributions of source code must retain the above copyright
  9. -- notice, this list of conditions and the following disclaimer.
  10. -- 2. Redistributions in binary form must reproduce the above copyright
  11. -- notice, this list of conditions and the following disclaimer in the
  12. -- documentation and/or other materials provided with the distribution.
  13. -- 3. Neither the name of the copyright holders nor the names of
  14. -- contributors may be used to endorse or promote products derived
  15. -- from this software without specific prior written permission.
  16. --
  17. -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. -- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. -- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. -- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. -- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. -- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. -- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. -- AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. -- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. -- THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. -- SUCH DAMAGE.
  29. --
  30. -- For additional information see http://www.ethernut.de/
  31. --
  32. -- Operating system functions
  33. --
  34. -- $Log$
  35. -- Revision 1.8 2009/01/09 17:54:42 haraldkipp
  36. -- Added raw file system driver.
  37. --
  38. -- Revision 1.7 2006/08/01 07:42:56 haraldkipp
  39. -- New functions extract last component and parent directory from pathnames.
  40. --
  41. -- Revision 1.6 2006/02/23 15:43:08 haraldkipp
  42. -- PHAT file system now supports configurable number of sector buffers.
  43. --
  44. -- Revision 1.5 2006/01/05 16:49:48 haraldkipp
  45. -- PHAT file system driver added.
  46. --
  47. -- Revision 1.4 2005/04/05 17:56:16 haraldkipp
  48. -- UROM file system is not platform dependant.
  49. --
  50. -- Revision 1.3 2005/02/05 20:40:44 haraldkipp
  51. -- Peanut added.
  52. --
  53. -- Revision 1.2 2004/08/18 13:46:09 haraldkipp
  54. -- Fine with avr-gcc
  55. --
  56. -- Revision 1.1 2004/06/07 16:35:53 haraldkipp
  57. -- First release
  58. --
  59. --
  60. nutfs =
  61. {
  62. {
  63. name = "nutfs_pathops",
  64. brief = "Path Operations",
  65. requires = { "NUT_FS_WRITE", "NUT_FS_DIR" },
  66. provides = { "NUT_FS_PATHOPS" },
  67. description = "Standard file system functions:\n"..
  68. "mkdir()\nstat()\nfstat()\nunlink()\nrmdir()\nlseek()\n",
  69. sources = { "pathops.c" },
  70. },
  71. {
  72. name = "nutfs_pathnames",
  73. brief = "Pathname Operations",
  74. description = "Standard pathname functions:\n"..
  75. "basename()\ndirname()\n",
  76. sources = { "basename.c", "dirname.c" },
  77. },
  78. {
  79. name = "nutfs_dirent",
  80. brief = "Directory Read",
  81. requires = { "NUT_FS_DIR" },
  82. provides = { "NUT_FS_DIRSTREAM" },
  83. description = "Standard functions for reading directories:\n"..
  84. "opendir()\nclosedir()\nreaddir()\n",
  85. sources = { "dirent.c" },
  86. },
  87. {
  88. name = "nutfs_fat",
  89. brief = "FAT32",
  90. description = "Read only.",
  91. requires = { "NUT_EVENT", "HW_MCU_AVR", "GCC_LE_4_5" },
  92. provides = { "NUT_FS", "NUT_FS_READ" },
  93. sources = { "fat.c" }
  94. },
  95. {
  96. name = "nutfs_uromfs",
  97. brief = "UROM",
  98. provides = { "NUT_FS", "NUT_FS_READ" },
  99. description = "Read only.",
  100. sources = { "uromfs.c" },
  101. makedefs = { "CRUROM=crurom" }
  102. },
  103. {
  104. name = "nutfs_uflashfs",
  105. brief = "UFLASH",
  106. requires = { "SERIALFLASH_INTERFACE" },
  107. provides = { "NUT_FS", "NUT_FS_READ", "NUT_FS_WRITE", "NUT_FS_DIR" },
  108. sources = { "uflashfs.c" },
  109. options =
  110. {
  111. {
  112. macro = "UFLASH_MAX_BLOCKS",
  113. brief = "Maximum Blocks",
  114. description = "Maximum number of blocks supported.\n\n"..
  115. "UFLASH uses a table in RAM to translate logical to physical "..
  116. "block numbers. This option can be used to limit the number "..
  117. "of blocks in order to reduce RAM usage.",
  118. type = "integer",
  119. default = "8192",
  120. file = "include/cfg/fs.h"
  121. },
  122. {
  123. macro = "UFLASH_BLOCK_UNITS",
  124. brief = "Units per Block",
  125. description = "Number of flash units used for one block.\n\n"..
  126. "A UFLASH file system block must have at least 2 units.\n\n"..
  127. "Serial flash memory is divided in various ways. For the UFLASH "..
  128. "file system a unit is the smallest part, that can be written and "..
  129. "erased. Typically a unit matches a flash memory page.",
  130. type = "integer",
  131. default = "4",
  132. file = "include/cfg/fs.h"
  133. },
  134. {
  135. macro = "UFLASH_ENTRIES",
  136. brief = "Maximum Number of Entries",
  137. description = "Specifies the number of files that can exist on a volume.",
  138. type = "integer",
  139. default = "128",
  140. file = "include/cfg/fs.h"
  141. },
  142. {
  143. macro = "UFLASH_MAX_PATH",
  144. brief = "Maximum Entry Name Size",
  145. description = "If enabled, the given number of bytes are reserved for "..
  146. "the name of each entry. Otherwise variable length names "..
  147. "are used.\n\n",
  148. type = "integer",
  149. flavor = "booldata",
  150. file = "include/cfg/fs.h"
  151. },
  152. {
  153. macro = "UFLASH_USE_TIMESTAMP",
  154. brief = "Timestamps",
  155. description = "If enabled, the last modification date and time is maintained. "..
  156. "For reasonable results, this requires that the system time had been set. ",
  157. flavor = "boolean",
  158. file = "include/cfg/fs.h"
  159. },
  160. {
  161. macro = "UFLASH_USAGE_CACHE",
  162. brief = "Usage Cache Size",
  163. type = "integer",
  164. default = "32",
  165. file = "include/cfg/fs.h"
  166. },
  167. },
  168. },
  169. {
  170. name = "nutfs_phatfs",
  171. brief = "PHAT",
  172. requires = { "DEV_BLOCK" },
  173. provides = { "NUT_FS", "NUT_FS_READ", "NUT_FS_WRITE", "NUT_FS_DIR" },
  174. description = "FAT compatible file system.",
  175. sources =
  176. {
  177. "phatfs.c",
  178. "phatvol.c",
  179. "phatdir.c",
  180. "phatio.c",
  181. "phat12.c",
  182. "phat16.c",
  183. "phat32.c",
  184. "phatutil.c",
  185. "phatdbg.c"
  186. },
  187. options =
  188. {
  189. {
  190. macro = "PHAT_SECTOR_BUFFERS",
  191. brief = "Sector Buffers",
  192. description = "Number of sector buffers.\n\n"..
  193. "These buffers will be allocated from heap memory. Thus, you "..
  194. "need to make sure that enough heap memory is available.\n"..
  195. "If this option is disabled, the file system will use "..
  196. "a single sector buffer, which is typically provided by the "..
  197. "block device itself.",
  198. type = "integer",
  199. flavor = "booldata",
  200. file = "include/cfg/fs.h"
  201. },
  202. },
  203. },
  204. {
  205. name = "nutfs_pnutfs",
  206. brief = "PNUT",
  207. -- requires = { "HW_MCU_AVR", "NUT_SEGBUF" },
  208. provides = { "NUT_FS", "NUT_FS_READ", "NUT_FS_WRITE", "NUT_FS_DIR" },
  209. description = "RAM file system for banked memory (Ethernut 2).",
  210. sources = { "pnutfs.c" },
  211. },
  212. {
  213. name = "nutfs_rawfs",
  214. brief = "Raw",
  215. requires = { "DEV_BLOCKIO" },
  216. provides = { "NUT_FS", "NUT_FS_READ", "NUT_FS_WRITE" },
  217. description = "This file system provides a single file entry only, "..
  218. "which is mapped to the entire volume. This implies, "..
  219. "that there is no file name and that the size of the "..
  220. "file is fixed to the size of the device's volume.\n\n"..
  221. "This early release had been tested with the AT45D DataFlash.",
  222. sources = { "rawfs.c" }
  223. }
  224. }