1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00

12 Commits

Author SHA1 Message Date
ecdr
4990f27486 eLua - clarify function prototypes - list arguments as void 2013-10-30 00:42:17 -08:00
Bogdan Marinescu
e42b88561a 'mv' command and shell code refactoring
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').
2012-10-07 23:54:28 +03:00
Bogdan Marinescu
2402627a10 Adding rm and rmdir commands to the shell (WIP) 2012-10-03 02:52:39 +03:00
Bogdan Marinescu
389ce9b41a More improvements to the shell (WIP)
- file masks ('*' and '?' are now accepted)
- recursive operations for ls/cp
- new FS-specific functions (src/common_fs.c)
2012-09-19 00:09:39 +03:00
Bogdan Marinescu
9e7f1ab4cd Preliminary directory support
- 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
2012-09-10 19:12:15 +03:00
Bogdan Marinescu
ed54aec47a Added FS registration data as argument to all FS functions
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.
2012-06-19 00:51:56 +03:00
Bogdan Marinescu
a199d47615 Changed FS registration mechanism
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).
2012-06-17 14:04:51 +03:00
Bogdan Marinescu
d54659b572 RAM optimizations: pseudo RO strings, functions in Flash
This patch adds more RAM optimizations to eLua:

- direct file memory mapping: files in ROMFS will be read directly from Flash,
  without allocating any additional buffers. This doesn't help with RAM
  consumption in itself, but enables the set of optimizations below.

- pseudo read-only strings. These are still TStrings, but the actual string
  content can point directly to Flash. Original Lua strings are kept in
  TStrings structures (lobject.h):

  typedef union TString {
    L_Umaxalign dummy;  /* ensures maximum alignment for strings */
    struct {
      CommonHeader;
      lu_byte reserved;
      unsigned int hash;
      size_t len;
    } tsv;
  } TString;

  The actual string content comes right after the union TString above.
  Pseudo RO strings have the same header, but instead of having the string
  content after TString, they have a pointer that points to the actual
  string content (which should exist in a RO memory (Flash) that is directly
  accesbile from the MCU bus (like its internal Flash memory)). lua_newlstr
  detects automatically if it should create a regular string or a pseudo RO
  string by checking if the string pointer comes from the Flash region of the
  MCU. This optimization works for both precompiled (.lc) files that exist in
  ROMFS and for internal Lua strings (C code).

- functions in Flash: for precompiled (.lc) files that exist in ROMFS, the code
  of the functions and a part of the debug information will be read directly
  from Flash.

- ROMFS was changed to support files that are larger than 2**16 bytes and it
  aligns all its files to an offset which is a multiple of 4 in order to prevent
  data alignment issues with precompiled Lua code.

- the Lua bytecode dumper was changed to align all the instructions in a Lua
  function and a part of the debug information to an offset which is a multiple
  of 4. This might slightly increase the size of the precompiled Lua file.

These changes were succesfully checked against the Lua 5.1 test suite.
These changes were tested in eLua on LM3S and AVR32.
2012-05-10 00:39:42 +03:00
Bogdan Marinescu
ccd3a9bdab update code to match std_get_func's new signature 2011-10-08 02:40:48 +03:00
Bogdan Marinescu
e7702bb0e2 Manual merge of remotefs/ into trunk. Tested with the simulator and (partially) on a ET-STM32 board. Other changes:
- FAT changed to support the new opendir/readdir/closedir mechanism, and to use lseek directly instead of ioctl (also fixed a bug in FAT's lseek that always returned 0 instead of file position).
- ET-STM32 console moved to UART2@19200bps (to allow RFS to run on UART0). If UART0 is needee for console, remember to disable RFS.
- freed 700+ bytes of RAM by changing the devman implementation to keep pointers instead of actual DM_DEVICE structures
- other minor code changes and fixes
2010-02-01 18:47:41 +00:00
Bogdan Marinescu
00ee06e90f generic stdio fix: now you should be able to use your terminal emulator with any kind of line endings on send (previously it only accepted CR+LF line endings) 2009-03-10 20:39:51 +00:00
Bogdan Marinescu
3eb530b4eb initial import 2008-07-29 11:08:54 +00:00