- "using.html" converted to AsciiDoc mode
- the shell documentation was split in a separate file and divided into
two parts: docs for the simple shell and for the advanced shell
(yet to be written)
There is a new command in the shell ('mv' - move/rename files).
Also, the shell code was refactored into its own directory (src/shell).
The 'help' command in the shell was updated and supports 'help <command>'.
There is a new BUILD_ADVANCED_SHELL build time macro that enables the
advanced shell features (currently 'cp' with recursion (and other improvements),
'mv' and 'rm').
- For now only supported for MMCFS
- 'dir' function in shell augmented to show directories and
to traverse a path recursively if requested
- new command 'mkdir' in shell
Newer Newlib versions use different functions to implement integer-only versions
of printf/scanf. Our stubs were modified to take advantage of these changes and
keep the code size low in integer-only versions of eLua.
Fixed bug reported by Tim Van der Hulst:
-------------------------------------------------------------------------------
dofile('/mmc/test.lua') -- OK
require('test') -- Fail!!
-------------
/mmc
test.txt 5 bytes
gprs.lua 2910 bytes
util.lua 385 bytes
test.lua 385 bytes
Total on /mmc: 3685 bytes
-------------
Error: [string "xmodem"]:23: module 'test' not found:
no field package.preload['test']
no file '/mmc/test.lua;/mmc/test.lc;/rom/test.lua;/rom/test.lc'
no file '/mmc/test.lc;/rom/test.lua;/rom/test.lc'
no file '/rom/test.lua;/rom/test.lc'
no file '/rom/test.lc'
-------------------------------------------------------------------------------
The problem was actually in the way read-only strings were created. If a read-only
string creation call specified a size which was different than the actual (C) size
of the string, the string didn't get null-terminated, which in turn led to some
interesting errors (like the one above).
This should really be more than one commit, but I wrote everything in one
shot and I don't feel like arranging the changes logically into different
commits. So, these are the changes:
- added WOFS (Write Once File System). This is a writeable file system that
exists in the MCU's internal Flash memory and allows files to be written,
but only once, in a single shot. More details to follow.
- the platform interface has a new MCU flash access interface.
- added WOFS "reference implementations" for two CPUs: LM3S8962 and
STM32F103RE. They are easily extendable to other CPUs in the same platform
and can be taken as a model for other platforms.
- the ROMFS file layout in memory was slightly changed.
- the simulator (src/platform/sim) got a new function (lseek).
- shell: now each shell command receives its arguments in a C-main-style
(argc, argv) pair. This was originally Marcelo's idea and it finally
made it to the master (although this particular implementation is mine),
after I got fed up with all the argument parsing in the shell functions.
- new shell command: wofmt ("formats" a WOFS, effectively clearing it).
- a couple of small fixes in the shell code
1. the filename for 'recv <filename>' was not set correctly
2. error messages for 'cp' were not always correct
3. check for copy errors and issue a message accordingly
All the functions that implement a FS receive the instance data
of the FS (given at registration time to dm_register) as their
last argument. ROMFS was changed to take advantage of this.
Now it's possible to have more than one instance of a given file
system. For example, one could use more that one ROM file system
in different physical locations (a possible configuration is
internal Flash and external serial memories). This mechanism is
currently implemented only in the device manager (devman.c),
actual instance implementation require per-FS support (to be
implemented later).