os.nut 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  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.22 2009/02/13 14:43:53 haraldkipp
  36. -- Heap debug options and split memory flag added.
  37. -- Banked memory options moved to the right module.
  38. -- NUTPANIC added.
  39. --
  40. -- Revision 1.21 2009/02/06 15:52:14 haraldkipp
  41. -- Removed stack size defaults.
  42. --
  43. -- Revision 1.20 2009/01/19 18:55:49 haraldkipp
  44. -- Default fatal error handler added.
  45. --
  46. -- Revision 1.19 2009/01/16 17:03:02 haraldkipp
  47. -- Configurable host name length. The *nix conditional is
  48. -- no longer required as this will be handled in the nvmem
  49. -- routines. NutLoadConfig will now set the virgin host
  50. -- name, if no valid configuration is available. Cookie
  51. -- and virgin host name are configurable too, but disabled
  52. -- in the Configurator until we fixed the string value
  53. -- problem. You may use UserConf.mk instead.
  54. --
  55. -- Revision 1.18 2008/07/08 08:25:04 haraldkipp
  56. -- NutDelay is no more architecture specific.
  57. -- Number of loops per millisecond is configurable or will be automatically
  58. -- determined.
  59. -- A new function NutMicroDelay provides shorter delays.
  60. --
  61. -- Revision 1.17 2008/07/07 11:04:27 haraldkipp
  62. -- Configurable ways of handling critical sections for ARM targets.
  63. --
  64. -- Revision 1.16 2008/04/21 22:29:01 olereinhardt
  65. -- Added configuration options for condition variables
  66. --
  67. -- Revision 1.15 2007/04/12 09:08:57 haraldkipp
  68. -- Segmented buffer routines ported to ARM.
  69. --
  70. -- Revision 1.14 2006/02/08 15:20:22 haraldkipp
  71. -- ATmega2561 Support
  72. --
  73. -- Revision 1.13 2006/01/23 17:31:07 haraldkipp
  74. -- Dependency added to system configuration.
  75. --
  76. -- Revision 1.12 2005/10/24 09:58:21 haraldkipp
  77. -- Generalized description for NUT_CPU_FREQ.
  78. --
  79. -- Revision 1.11 2005/10/04 05:44:29 hwmaier
  80. -- Added support for separating stack and conventional heap as required by AT09CAN128 MCUs
  81. --
  82. -- Revision 1.10 2005/07/26 16:13:24 haraldkipp
  83. -- Target dependent modules moved to arch.
  84. --
  85. -- Revision 1.9 2005/02/16 20:02:07 haraldkipp
  86. -- Typo of NUTDEBUG corrected.
  87. -- Philipp Blum's tracer added.
  88. --
  89. -- Revision 1.8 2004/11/24 14:48:34 haraldkipp
  90. -- crt/crt.nut
  91. --
  92. -- Revision 1.7 2004/11/08 18:58:58 haraldkipp
  93. -- Configurable stack sizes
  94. --
  95. -- Revision 1.6 2004/09/25 15:42:09 drsung
  96. -- Removed configuration for separate interrupt stack,
  97. -- it's now in conf/dev/dev.nut
  98. --
  99. -- Revision 1.5 2004/09/01 14:07:15 haraldkipp
  100. -- Cleaned up memory configuration
  101. --
  102. -- Revision 1.4 2004/08/18 16:05:38 haraldkipp
  103. -- Use consistent directory structure
  104. --
  105. -- Revision 1.3 2004/08/18 13:46:10 haraldkipp
  106. -- Fine with avr-gcc
  107. --
  108. -- Revision 1.2 2004/08/03 15:09:31 haraldkipp
  109. -- Another change of everything
  110. --
  111. -- Revision 1.1 2004/06/07 16:38:43 haraldkipp
  112. -- First release
  113. --
  114. --
  115. nutos =
  116. {
  117. --
  118. -- Version Information
  119. --
  120. {
  121. name = "nutos_version",
  122. brief = function() return "Version " .. GetNutOsVersion(); end,
  123. description = "The version info was read from os/version.c in the current source tree.",
  124. sources = { "version.c" },
  125. options =
  126. {
  127. {
  128. macro = "NUT_VERSION_EXT",
  129. brief = "Extended",
  130. description = "User provided extension to the hard coded version information.",
  131. requires = { "NOT_AVAILABLE" },
  132. file = "include/cfg/os.h"
  133. }
  134. }
  135. },
  136. --
  137. -- Initialization
  138. --
  139. {
  140. name = "nutos_init",
  141. brief = "System Initialization",
  142. description = "This module is automatically called after booting the system. "..
  143. "It will initialize memory and timer hardware and start the "..
  144. "Nut/OS idle thread, which in turn starts the application's "..
  145. "main routine in a separate thread.",
  146. sources = { "nutinit.c" },
  147. targets = { "nutinit.o" },
  148. options =
  149. {
  150. {
  151. macro = "HEARTBEAT_IDLE_PORT",
  152. brief = "Idle Heartbeat Port",
  153. description = "If a valid Port/Pin combination is given, set that Pin high when "..
  154. "ethernut is running and low when idle",
  155. flavor = "booldata",
  156. type = "enumerated",
  157. choices = function() return GetGpioBanks() end,
  158. file = "include/cfg/os.h"
  159. },
  160. {
  161. macro = "HEARTBEAT_IDLE_PIN",
  162. brief = "Idle Heartbeat PIN",
  163. description = "If a valid Port/Pin combination is given, set that Pin high when "..
  164. "ethernut is running and low when idle",
  165. flavor = "booldata",
  166. type = "enumerated",
  167. choices = function() return GetGpioBits() end,
  168. file = "include/cfg/os.h"
  169. },
  170. {
  171. macro = "HEARTBEAT_IDLE_INVERT",
  172. brief = "Idle Heartbeat Polarity",
  173. description = "Define if the LED at the HEARTBEAT Port/Pin combination is light with a Low Level",
  174. flavor = "booldata",
  175. type = "enumerated",
  176. file = "include/cfg/os.h"
  177. }
  178. }
  179. },
  180. --
  181. -- Memory management
  182. --
  183. {
  184. name = "nutos_heap",
  185. brief = "Memory management",
  186. provides = { "NUT_HEAPMEM" },
  187. sources = { "heap.c" },
  188. options =
  189. {
  190. {
  191. macro = "NUTMEM_GUARD",
  192. brief = "Guard Bytes",
  193. description = "If enabled, guard bytes will be added to both ends when "..
  194. "new memory is allocated. When memory is released later, "..
  195. "these guard bytes will be checked in order to detect "..
  196. "memory overflows.",
  197. flavor = "boolean",
  198. file = "include/cfg/memory.h"
  199. },
  200. {
  201. macro = "NUTDEBUG_HEAP",
  202. brief = "Heap Debugging",
  203. description = "If enabled, additional code will be added to the heap "..
  204. "management to track memory allocation. This helps to "..
  205. "detect memory leaks. Furthermore, problems are reported "..
  206. "by calling NUTPANIC with a source code reference.",
  207. flavor = "boolean",
  208. file = "include/cfg/memory.h"
  209. },
  210. {
  211. macro = "NUTMEM_SIZE",
  212. brief = "Memory Size",
  213. description = "Number of bytes available in fast data memory. On "..
  214. "most platforms this value specifies the total number "..
  215. "of bytes available in RAM.\n\n"..
  216. "On Harvard architectures this value specifies the size "..
  217. "of the data memory. It will be occupied by global "..
  218. "variables and static data. Any remaining space will "..
  219. "be added to the Nut/OS heap during system initialization.\n"..
  220. "When running on an AVR MCU, set this to size of the "..
  221. "on-chip SRAM, e.g. 4096 for the ATmega128 and 8192 for the ATmega2561.\n\n"..
  222. "For CortexM3 architecture the size is given by the linker script. "..
  223. "so only enter a value in here if you really know what you do!",
  224. default = "4096",
  225. file = "include/cfg/memory.h"
  226. },
  227. {
  228. macro = "NUTMEM_START",
  229. brief = "Memory Start",
  230. description = "First address of fast data memory.\n\n"..
  231. "For CortexM3 architecture the address is given by the linker script. "..
  232. "so only enter a value in here if you really know what you do!",
  233. file = "include/cfg/memory.h"
  234. },
  235. {
  236. macro = "NUTMEM_RESERVED",
  237. brief = "Reserved Memory Size",
  238. description = "Number of bytes reserved for special purposes.\n"..
  239. "Right now this is used with the AVR platform only. "..
  240. "The specified number of bytes may be used by a "..
  241. "device driver when the external memory interface "..
  242. " is disabled.",
  243. requires = { "HW_MCU_AVR" },
  244. flavor = "booldata",
  245. file = "include/cfg/memory.h",
  246. makedefs = { "NUTMEM_RESERVED" }
  247. },
  248. {
  249. macro = "NUTXMEM_SIZE",
  250. brief = "Extended Memory Size",
  251. description = "Number of bytes available in external data memory.\n\n"..
  252. "The result of enabling this item is platform specific."..
  253. "With AVR systems it will enable the external memory "..
  254. "interface of the CPU, even if the value is set to zero.",
  255. provides = { "NUTXDATAMEM_SIZE" },
  256. flavor = "booldata",
  257. file = "include/cfg/memory.h"
  258. },
  259. {
  260. macro = "NUTXMEM_START",
  261. brief = "Extended Memory Start",
  262. description = "First address of external data memory.",
  263. requires = { "NUTXDATAMEM_SIZE" },
  264. file = "include/cfg/memory.h"
  265. },
  266. {
  267. macro = "NUTMEM_SPLIT_FAST",
  268. brief = "Split Memory",
  269. description = "If enabled and if two memory regions are available on the "..
  270. "target board, then each region is managed separately.",
  271. flavor = "boolean",
  272. file = "include/cfg/memory.h"
  273. },
  274. {
  275. macro = "NUTMEM_STACKHEAP",
  276. brief = "Separate heap for stack",
  277. description = "This option enables use of a separate heap for stack.\n\n"..
  278. "When a thread is created with this option enabled, it's stack is "..
  279. "allocated on a special \"thread stack heap\" which is kept in "..
  280. "internal memory before the data segments instead of using the \"standard "..
  281. "heap\" which is typically located in external memory after the data segments. \n"..
  282. "\n"..
  283. "Using this option is a must for silicon revisions C of the AT90CAN128 MCU \n"..
  284. "as the device misfunctions when code stack is in XRAM. Refer to \n"..
  285. "AT90CAN128 Datasheet Rev. 4250F-CAN-04/05 - Errata Rev C \n"..
  286. "\n"..
  287. "Use this option is conjunction with DATA_SEG for AT90CAN128 MCUs!",
  288. requires = { "HW_MCU_AVR" },
  289. flavor = "booldata",
  290. file = "include/cfg/memory.h"
  291. },
  292. {
  293. macro = "DATA_SEG",
  294. brief = "Start of data segment",
  295. description = "This option relocates the data segment to a different address during the linking phase.\n\n"..
  296. "Leave this option empty to use the architecture's default setting.\n\n"..
  297. "Using this option is a must for silicon revisions C of the AT90CAN128 MCU \n"..
  298. "as the device misfunctions when code stack is in XRAM. Refer to \n"..
  299. "AT90CAN128 Datasheet Rev. 4250F-CAN-04/05 - Errata Rev C \n"..
  300. "\n"..
  301. "Use this option is conjunction with NUTMEM_STACKHEAP for AT90CAN128 MCUs!",
  302. requires = { "HW_MCU_AVR" },
  303. flavor = "booldata",
  304. makedefs = { "DATA_SEG" }
  305. }
  306. }
  307. },
  308. {
  309. name = "nutos_bankmem",
  310. brief = "Segmented Buffer",
  311. description = "The segmented buffer API can either handle a continuos "..
  312. "memory space automatically allocated from heap or it can "..
  313. "use banked memory hardware.",
  314. -- requires = { "HW_MCU_AVR" },
  315. provides = { "NUT_SEGBUF" },
  316. sources = { "bankmem.c" },
  317. options =
  318. {
  319. {
  320. macro = "NUTBANK_COUNT",
  321. brief = "Memory Banks",
  322. description = "Number of memory banks.\n\n"..
  323. "Specially on 8-bit systems the address space is typically "..
  324. "very limited. To overcome this, some hardware implementations "..
  325. "like the Ethernut 2 reference design provide memory banking. "..
  326. "Right now this is supported for the AVR platform only.",
  327. requires = { "HW_MCU_AVR" },
  328. provides = { "NUTBANK_COUNT" },
  329. flavor = "booldata",
  330. file = "include/cfg/memory.h"
  331. },
  332. {
  333. macro = "NUTBANK_START",
  334. brief = "Banked Memory Start",
  335. description = "First address of the banked memory area.",
  336. requires = { "NUTBANK_COUNT" },
  337. file = "include/cfg/memory.h"
  338. },
  339. {
  340. macro = "NUTBANK_SIZE",
  341. brief = "Banked Memory Size",
  342. description = "Size of the banked memory area.",
  343. requires = { "NUTBANK_COUNT" },
  344. file = "include/cfg/memory.h"
  345. },
  346. {
  347. macro = "NUTBANK_SR",
  348. brief = "Bank Select Register",
  349. description = "Address of the bank select register.",
  350. requires = { "NUTBANK_COUNT" },
  351. file = "include/cfg/memory.h"
  352. }
  353. }
  354. },
  355. --
  356. -- Thread management
  357. --
  358. {
  359. name = "nutos_thread",
  360. brief = "Multithreading",
  361. requires = { "NUT_CONTEXT_SWITCH" },
  362. provides = { "NUT_THREAD" },
  363. sources = { "thread.c" },
  364. options =
  365. {
  366. {
  367. macro = "NUT_THREAD_IDLESTACK",
  368. brief = "Idle Thread Stack Size",
  369. description = "Number of bytes to be allocated for the stack of the idle thread.",
  370. flavor = "booldata",
  371. file = "include/cfg/os.h"
  372. },
  373. {
  374. macro = "NUT_THREAD_MAINSTACK",
  375. brief = "Main Thread Stack Size",
  376. description = "Number of bytes to be allocated for the stack of the main thread.",
  377. flavor = "booldata",
  378. file = "include/cfg/os.h"
  379. },
  380. {
  381. macro = "NUT_CRITICAL_NESTING",
  382. brief = "Critical Section Nesting",
  383. description = "The kernel avoids nesting of critical sections, but applications "..
  384. "may want to use this feature. When enabled, a global counter keeps "..
  385. "track of the nesting level. Disadvantages are increased code "..
  386. "size and a significantly increased interrupt latency time.\n\n"..
  387. "This option is currently available for ARM targets only. "..
  388. "On the AVR, nesting of critical sections is available by default.",
  389. flavor = "boolean",
  390. requires = { "HW_MCU_ARM" },
  391. provides = { "NUT_CRITNESTING" },
  392. file = "include/cfg/os.h"
  393. },
  394. {
  395. macro = "NUT_CRITICAL_NESTING_STACK",
  396. brief = "Critical Section Nesting Uses Stack",
  397. description = "Using the stack for critical section nesting results in better "..
  398. "interrupt responsiveness. However, most compilers are not able "..
  399. "to deal with stack modifications. Use this option with great care.\n\n"..
  400. "This option is ignored, if critical section nesting is disabled.",
  401. flavor = "boolean",
  402. requires = { "HW_MCU_ARM", "NUT_CRITNESTING" },
  403. file = "include/cfg/os.h"
  404. },
  405. }
  406. },
  407. --
  408. -- Timer management
  409. --
  410. {
  411. name = "nutos_timer",
  412. brief = "Timer management",
  413. requires = { "NUT_EVENT", "NUT_OSTIMER_DEV" },
  414. provides = { "NUT_TIMER" },
  415. sources = { "timer.c" },
  416. options =
  417. {
  418. {
  419. macro = "NUT_CPU_FREQ",
  420. brief = "Fixed MCU clock",
  421. description = "Frequency of the MCU clock. On some boards the system is able "..
  422. "to automatically determine this value during initialization "..
  423. "by using a reference clock. In this case the option may be disabled.",
  424. flavor = "booldata",
  425. file = "include/cfg/os.h"
  426. },
  427. {
  428. macro = "NUT_DELAYLOOPS",
  429. brief = "Loops per Millisecond",
  430. description = "Number of loops to execute per millisecond in NutMicroDelay.\n\n"..
  431. "This value depends not only on the target hardware, but also on "..
  432. "compiler options. If not specified, the system will try to "..
  433. "determine a rough approximation.",
  434. flavor = "booldata",
  435. file = "include/cfg/os.h"
  436. },
  437. {
  438. macro = "NUT_USE_OLD_TIME_API",
  439. brief = "Use old style time calculation",
  440. description = "The old way of calculating the current time was based on the system "..
  441. "tick counter. Unfortunately this introduced bugs when this counter value "..
  442. "overflowed. On most systems (with 1Khz system tick timer) this happened "..
  443. "after 49,7 days. If the system used an RTC, this bug did not show up in "..
  444. "most cases, as the time was then queried from the RTC.\n\n"..
  445. "Another problem was, that the time could not be corrected with an accuracy "..
  446. "of more than 1 second, as the offset to epoc was calculated as a value of "..
  447. "second resolution.\n\n"..
  448. "The new time API re-invented the way the time is handled and calculated. "..
  449. "Internally the time is now stored as a timeval struct, which allowes a "..
  450. "a resolution up to 1 µs. The time is now always updated by the system "..
  451. "tick timer interrupt and is always hold as software clock. It is _not_ "..
  452. "automatically synced with the RTC any more.\n Syncing with a RTC has to "..
  453. "be done manually by the user! "..
  454. "This way we gain a much higher accuracy, as long, as the software clock is "..
  455. "accurate. In other words, the system time accurracy depends on the system crystal "..
  456. "accuracy and time will not be updated, if the CPU is put to deep sleep mode. "..
  457. "Further more we assume a system tick timer running at a multiple of a full µs."..
  458. "Uneven system tick timer frequencies would result in an increasing error of "..
  459. "the software clock.\n\n"..
  460. "Enable this option, if you would like to stay with the old API. This might "..
  461. "be usefull if you design a low-power system, where the CPU is sleeping most "..
  462. "of the time and shall not be woken up regularly, of if you use an add crystal "..
  463. "frequency and can not provide a system tick timer running at an even multiple "..
  464. "of 1µs",
  465. flavor = "boolean",
  466. file = "include/cfg/os.h"
  467. },
  468. }
  469. },
  470. --
  471. -- Event management
  472. --
  473. {
  474. name = "nutos_event",
  475. brief = "Event handling",
  476. description = "Events provide the core thread synchronization.",
  477. provides = { "NUT_EVENT" },
  478. sources = { "event.c" }
  479. },
  480. {
  481. name = "nutos_devreg",
  482. brief = "Device registration",
  483. description = "Applications need to register devices before using "..
  484. "them. This serves two purposes. First it will create "..
  485. "a link to the device driver code. Second it will "..
  486. "initialize the device hardware.",
  487. provides = { "NUT_DEVREG" },
  488. sources = { "devreg.c" }
  489. },
  490. {
  491. name = "nutos_confos",
  492. brief = "Configuration",
  493. description = "Initial system settings are stored in non volatile memory."..
  494. "The current version uses 3 bytes for validity check, 15 bytes "..
  495. "for the host name and one last byte, which is always zero.\n\n"..
  496. "The length of the host name is configurable.",
  497. provides = { "NUT_OSCONFIG" },
  498. sources = { "confos.c" },
  499. options =
  500. {
  501. {
  502. macro = "CONFOS_EE_OFFSET",
  503. brief = "Location",
  504. description = "This is the non-volatile memory address offset, where Nut/OS "..
  505. "expects its configuration.\n\n"..
  506. "Note, that changing this value will invalidate previously "..
  507. "stored setting after upgrading to this new version. You must "..
  508. "also make sure, that this memory area will not conflict with "..
  509. "others, specifically the network configuration.\n\n"..
  510. "This item is disabled if the system doesn't offer any "..
  511. "non-volatile memory. Check the non-volatile memory"..
  512. "module in the device driver section.",
  513. requires = { "DEV_NVMEM" },
  514. default = "0",
  515. type = "integer",
  516. file = "include/cfg/eeprom.h"
  517. },
  518. {
  519. macro = "CONFOS_EE_MAGIC",
  520. brief = "Magic Cookie",
  521. description = "Together with the length of the configuration structure "..
  522. "this is used to determine that we got a valid configuration "..
  523. "structure in non-volatile memory.\n",
  524. default = "\"OS\"",
  525. file = "include/cfg/eeprom.h"
  526. },
  527. {
  528. macro = "MAX_HOSTNAME_LEN",
  529. brief = "Max. Host Name Length",
  530. description = "The name of the local host can't grow beyond this size. "..
  531. "This is just the basic name without domain information.\n\n"..
  532. "Make sure that the virgin host name will fit. Further, "..
  533. "keep in mind that changing this size will have an impact "..
  534. "at least on the auto discovery feature.",
  535. default = "15",
  536. type = "integer",
  537. file = "include/cfg/eeprom.h"
  538. },
  539. {
  540. macro = "CONFOS_VIRGIN_HOSTNAME",
  541. brief = "Virgin Host Name",
  542. description = "This name will be used for hosts without valid configuration.\n",
  543. default = "\"ethernut\"",
  544. file = "include/cfg/eeprom.h"
  545. }
  546. }
  547. },
  548. --
  549. -- Additional functions, not required by the kernel.
  550. --
  551. {
  552. name = "nutos_semaphore",
  553. brief = "Semaphores",
  554. description = "Semaphores are not required by the kernel, but "..
  555. "may be useful for applications.",
  556. requires = { "NUT_EVENT" },
  557. provides = { "NUT_SEMAPHORE" },
  558. sources = { "semaphore.c" }
  559. },
  560. {
  561. name = "nutos_mutex",
  562. brief = "Mutual exclusion semaphores",
  563. description = "Mutex semaphores are not required by the kernel, but "..
  564. "may be useful for applications.",
  565. requires = { "NUT_EVENT" },
  566. provides = { "NUT_MUTEX" },
  567. sources = { "mutex.c" }
  568. },
  569. {
  570. name = "nutos_msg",
  571. brief = "Message queues",
  572. description = "Message queues are not required by the kernel, but "..
  573. "may be useful for applications.",
  574. requires = { "NUT_EVENT" },
  575. provides = { "NUT_MQUEUE" },
  576. sources = { "msg.c" }
  577. },
  578. {
  579. name = "nutos_condition",
  580. brief = "Condition variables",
  581. description = "Condition variabled are not required by the kernel, but "..
  582. "may be useful for applications.",
  583. requires = { "NUT_EVENT", "NUT_MUTEX"},
  584. provides = { "NUT_CONDITION_VARIABLES" },
  585. sources = { "condition.c" }
  586. },
  587. --
  588. -- Debugging
  589. --
  590. {
  591. name = "nutos_osdebug",
  592. brief = "OS Debug",
  593. requires = { "NUT_EVENT", "CRT_STREAM_WRITE" },
  594. provides = { "NUT_OSDEBUG" },
  595. sources = { "osdebug.c" },
  596. options =
  597. {
  598. {
  599. macro = "NUTDEBUG",
  600. brief = "OS Debug",
  601. description = "Used for kernel debugging.\n"..
  602. "Enabling this functions will add a lot of "..
  603. "extra code and require more RAM. In addition "..
  604. "the application must register an output device "..
  605. "early and redirect stdout to it.",
  606. flavor = "boolean",
  607. file = "include/cfg/os.h"
  608. },
  609. {
  610. macro = "NUTDEBUG_CHECK_STACK",
  611. brief = "Thread Stack Checking",
  612. description = "Used for thread stack checking.\n"..
  613. "Enabling this will fill any threads stack area "..
  614. "with a pattern at the point of creating the thread.\n"..
  615. "By using NutThreadStackAvailable() one can now check "..
  616. "for the maximum ammount of stack ever used by this "..
  617. "thread.\n\n"..
  618. "This functionality can be enabled without OS Debug to "..
  619. "find out maximum stack usage in your final appliation.",
  620. flavor = "boolean",
  621. file = "include/cfg/os.h"
  622. },
  623. {
  624. macro = "NUTDEBUG_RAM",
  625. brief = "Placement of code",
  626. description = "Code is placed in ram",
  627. flavor = "boolean",
  628. file = "include/cfg/os.h"
  629. },
  630. {
  631. macro = "NUTDEBUG_LAZY",
  632. brief = "Initialize Stack when debugging",
  633. description = "When loading new compiled code, stack will be initialized with value read "..
  634. "at 0x00000000 at reset. Either explicit load the value on each load "..
  635. "or use this hack ...\n",
  636. flavor = "boolean",
  637. file = "include/cfg/os.h"
  638. }
  639. }
  640. },
  641. {
  642. name = "nutos_ostracer",
  643. brief = "OS Tracer",
  644. requires = { "HW_MCU_AVR", "TOOL_GCC" },
  645. provides = { "NUT_OSTRACER" },
  646. sources = { "tracer.c" },
  647. options =
  648. {
  649. {
  650. macro = "NUTTRACER",
  651. brief = "OS Tracer",
  652. description = "Used for kernel debugging.\n",
  653. flavor = "boolean",
  654. file = "include/cfg/os.h"
  655. },
  656. {
  657. macro = "NUTTRACER_CRITICAL",
  658. brief = "OS Critical Tracer",
  659. description = "Used for kernel debugging.\n",
  660. flavor = "boolean",
  661. file = "include/cfg/os.h"
  662. }
  663. }
  664. },
  665. {
  666. name = "nutos_fatal",
  667. brief = "Fatal Error Handler",
  668. description = "This default handler may be overridden by "..
  669. "NUTFATAL and NUTPANIC routines provided by the application.",
  670. sources = { "fatal.c", "panic.c" }
  671. }
  672. }