|Age||Commit message (Collapse)||Author||Files||Lines|
Note: I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.
This removes all code specific to SH targets
This allows for a superfloppy that has MBR-like data in the BPB.
this solves FS#12294 while allowing arbitrary partition types.
If we aren't going to check for the partition type, we don't need the array of
known FAT partition types.
Original Author: Torne Wuff <firstname.lastname@example.org>
Instead of only mounting partitions with a FAT partition type, try any
partition that isn't type 0 (unallocated) or 5 (extended). This makes it easier
to reformat SDXC cards which have the exFAT partition type, and also brings us
in line with pretty much every other OS at this point. Anything with a
valid-looking FAT superblock will get mounted.
original author: Torne Wuff <email@example.com>
Stop gap till I get a chance to work on the root folder stuff
Makes whatever volume marked by bootdata.boot_volume
the base or root volume, mounts all other volumes after
the specified boot volume.
Has the effect of swapping the SD card to the slot for internal
and Internal storage is mounted as the Sd-card.
Does not honor root redirect -- uses .rockbox folder in the root of boot volume
The Quake plugin is the only code that actually relies on float
formatting. Because Quake only runs on targets with huge memory
anyway, limiting their formatting to just those targets will minimize
the increased memory use in the core.
Wanted to see how gnarly it is to do.
Big number handling could be done with better algorithms
since it can get a bit slow with large integers or tiny
fractions with many lead zeros when only a few digits are
Anyway, it supports %e, %E, %f, %F, %g and %G. No %a or long
double support seems warranted at the moment.
Assumes IEEE 754 double format but it's laid out to be able to
replace a function to handle others if needed.
Tested in a driver program that has a duplicate vuprintf and
the content was pasted in once it looked sound enough to put
up a patch.
when precision is not specified memchr recieved -1 for count
count is unsigned so it looks in a potentially very large area
for a terminator and returns this whole area if \0 is not found
Instead we should use memchr when precision is specified
and if precision is not specified use strlen
Fixes 60+Mb Config.cfg files
is_diacritic is used for pretty much all of the text display sizing
Timing here matters, so important it uses a
priority buffer in order to cut down on searching the database.
This patch is verified functionally equlivalent but
saves 80 bytes and is ~20% faster for the clip+ I tested it on
Several things were done:
Optimizing the copy loop for the priority buffer
Globbing some operations together
but the main one has to do with the database structure its self
Rather than a bit packed struct it combines the lower 8 bytes into
one value [info] and uses flags to access the values instead
patching clip+ OF.
This reverts commit 01c6dcf6c7b9bb1ad2fa0450f99bacc5f3d3e04b.
The hack isn't used in duke, so having it is redundant.
This ports Fabien Sanglard's Chocolate Duke to run on a version of SDL
This is just a quick and dirty way to get %f formatting to work for
some games. It works.
Avoids a call to write() for every output character. It doesn't
need to be very large to have a great effect on speed and realize
most of the potential.
Instead of checking ticks, set a sticky dirty flag that indicates
that the RTC needs to be read. This gives a timely update and more
accurate readout without actually reading the RTC until it changes.
The implementation should atomically read the flag and clear it.
Setting the flag would typically happen in an RTC tick ISR.
New support as well as some buggy support fixed.
Still no floating point support if ever that would be desired.
* Flags: '-', '+', ' ', '#', '0'
* Width and precision: 'n', '.n', '*' and '.*'
* Length modifiers: 'hh', 'h', 'j', 'l', 'll', 't', 'z'
* Radix: 'c', 'd', 'i', 'n', 'o', 'p/P', 's', 'u', 'x/X'
(*) Provision exists to switch lesser-used stuff on or off or when
certain functionality isn't desired (bootloader?). The compulsory
radixes are everything but 'o', 'n', 'p/P' and 'x/X' with length
modifiers being optional. The default setup is 'l', 'z', 'c', 'd',
'p/P', 's', 'u', 'x/X'.
* Move fdprintf() to its own file. It was in a strange place.
* Make callers compatible and fix a couple snprintf() bugs while
Could smush it down in size but I'm gonna get over the binsize
neurosis and just the let optimizer do its thing.
Adds the ability to load firmware from other drives on MULTIVOLUME targets
Mihail Zenkov <firstname.lastname@example.org> had posted a hard coded patch
to allow this on several Sansa players, I made it more universal
Redirect file rockbox_main.<name> should placed in root of
drive you would like to be main, if this file empty or there a single
slash '/' firmware will be loaded from /.rockbox in root of this drive
If instead a /<*DIRECTORY*> is supplied in rockbox_main.<name> then
firmware will be loaded from /<dir>/.rockbox/
The directory can have multiple levels however..
leading slash MUST be included
trailing slash can be omitted
(eg. /test/.rockbox would be simply '/test' in the redirect file)
Redirect file will not work on internal drive (whatever is default boot drive)
Volume with the highest index containing redirect file will be loaded
Firmware file is checked for boot data region, if missing, firmware
image will not be loaded.
On failure or if no redirect file is found load will fallback to
Currently only Sansa Fuze+, Sansa Clip+,
Sansa Clip Zip, Sansa Fuzev2, and Sansa Fuzev1 are implemented.
Players (with HAVE_MULTIVOLUME)
will need #define HAVE_BOOTDATA and #define BOOT_REDIR "rockbox_main.<name>"
added to their config file
boot_data is implemented in crt0.s file (See g#1552)
ARM and IMX233 have aleady been implemented
Once these conditions are met <HAVE_MULTIBOOT> will be defined by config.h
Partitions on the drives are able to have a redirect as
Bootdata is a special location in the Firmware marked by a magic header
The bootloader is able to copy information to the firmware by locating
this struct and passing data to the firmware when it is loaded but
before it is actually executed
Data is verified by a crc of the bootdata
Just need to check prev and next for NULL to know whether to mess
with the head and/or tail pointers.
There's only a need to check every MAX_TINYNAME+1 bytes and that the
last character of the needed size 0xff in order to verify the size
of the block since the minimum indirectly-stored string is
When dircache scanning is happening in the background, the user
can shut down the device before it is complete. Then, reset_cache()
sets size to 0 before it is copied to last_size at the end of
build_volumes(). When saved last_size is zero, scanning happens in
the foreground during next startup.
Avoid shrinking the size if the build is suspended.
Many includes of fat.h are pointless. Some includes are just for
SECTOR_SIZE. Add a file 'firmware/include/fs_defines.h' for that
and to define tuneable values that were scattered amongst various
Remove some local definitions of SECTOR_SIZE since they have to be
in agreement with the rest of the fs code anyway.
(We'll see what's in fact pointless in a moment ;)
* 8 bits is enough to allow 260 character base names when five
bytes is the minimum indirect storage size (0..255->5..260).
* Don't truncate anything that's too long as that can lead to
bad behavior, simply don't include the offending entry in the
* Set the .tinyname flag to 1 by default to indicate that
the entry's name doesn't need freeing. Clear it only when
allocating indirect storage.
* Rename some things to help catch all instances
Moving binding from queued to resolved was messed up if it was the
first queued one and there were other resolved files open at the
time of resolving it.
Dircache info for a directory about to be recursively scanned should
be filled before opening it. Would only affect a directory if it
happened to be opening while it was being initialized.
These flags aren't stored for an open file because they're simply
actions for open() to take, corresponding to O_CREAT and O_EXCL.
Just pass the oflag argument along to the deeper call, with some
Do a few other changes to dircache and file code flags to
accomodate its demands.
Critical reminders about the reasons path_dirname() and
path_basename() do certain things with a given kind of input and
how to interpret them.
If a volume root was open at the beginning of a build, its dircache
reference wouldn't be resolved on an already open volume root
directory because the call to do it was simply omitted. Nothing
horribly bad unless a root were opened at mount time and kept open
volume_onmount_internal() was being given the next volume to mount
instead of the one just mounted. Only dircache was being notified
for now, which always attempts to scan everything that needs to be
rebuilt, currently making the volume parameter value immaterial.
Put things in the right place and also set the disk sector
multiplier before notifying anybody of the new volume.
Some drivers set tm_wday just fine and do not need it coerced to
be correct. Others set tm_yday, so don't overwrite what the driver
sets; just zero it inside if it can't fill the field. Move calls
to set_day_of_week() to the sorts of drivers that presumably
required the hammer (FS#11814) in get_time() where the weekday
isn't locked to the date.
FF_PROBE should leave nothing for caller to clean up whether
testing only the cache or permitting disk access. Less to worry
The file system rework introduced incompatibility between dircache
and the tagcache ramcache and playlist dircache path caching. This
update makes changes to filesystem code to reintegrate all that.
It also fixes a couple bugs that were found when vetting all the
code. The filestream cache was being reset without regard to
the stream even if it was shared in write mode (made work of
.playlist_control). Better handling of unmounting gives files a
better go at force-closing them without risk to disk integrity.
Did some miscellaneous pedantic changes. Improved efficiency of
testing a file's existence (a little) since the path parser will
be shared between file code and parsing for the sake of finding
dircache references, not duplicated as before.
This commit doesn't reenable said items just for the sake of
keeping changes separate and related.
Plan for the next is to enable dircache again for the playlists
(easy peasy) and reenable tagcache ramcache but *without* the
dircache path caching because it's rather substantial to change
in itself. The ramcache will still function without dircache.
Logic left over from before switching from NULL-terminated to
counted strings would prevent a single-byte tiny free block gap
from being properly reclaimed into free string bytes.
Due to rarity, not as disasterous to functionality so much as
ll_insert_next() and ll_remove_next() can be done more elegantly
by adding a level of indirection to reference the 'next' pointer.
Some changes in behavior were made with filesystem code commit
for the sake of compatibility that changed expected behavior.
* Restore substitution of drive spec in fully-qualified DOS paths
with the playlists's volume spec (or root on univolume targets).
Drive-relative paths of the form "c:foo" (no separator after
':') will be treated as purely relative.
* Restore old behavior of preserving leading whitespace in the
source path and trimming only trailing tabs and spaces.
* Multivolume: Volume substition on fully-qualified UNIX/RB paths
has NOT been reintroduced (and perhaps wasn't intended in the
first place). They will not be modified because there is no
ambiguity to resolve. Doing so would prevent a playlist on
external storage from referencing a file on main storage without
qualifying it with "/<0>...".
* Plain relative paths are and always have been interpreted as
relative to the location of the playlist.
Reviewed-by: Michael Giacomelli <email@example.com>
Tested: Chiwen Chang <firstname.lastname@example.org>
Reviewed-by: Nick Peskett <email@example.com>
Tested: Nick Peskett <firstname.lastname@example.org>
It should have been implemented as interpreting chars as unsigned
so that code points >= 0x80 would not get sign-extended and seen as
Fixes FS#12995 - path_trim_whitespace() assumes unsigned char
It's nicer to look at and it obfuscated a bug where it should have
exited the loop instead of the case (you probably wouldn't observe
the effect very often).
Anything of one dot and one character (e.g. ".a") would get treated as
"." because I left out a condition when converting to recursionless
parsing of relative components. Git 'er fixed up.
This patch redoes the filesystem code from the FAT driver up to the
clipboard code in onplay.c.
Not every aspect of this is finished therefore it is still "WIP". I
don't wish to do too much at once (haha!). What is left to do is get
dircache back in the sim and find an implementation for the dircache
indicies in the tagcache and playlist code or do something else that
has the same benefit. Leaving these out for now does not make anything
unusable. All the basics are done.
Phone app code should probably get vetted (and app path handling
just plain rewritten as environment expansions); the SDL app and
Android run well.
Main things addressed:
1) Thread safety: There is none right now in the trunk code. Most of
what currently works is luck when multiple threads are involved or
multiple descriptors to the same file are open.
2) POSIX compliance: Many of the functions behave nothing like their
counterparts on a host system. This leads to inconsistent code or very
different behavior from native to hosted. One huge offender was
rename(). Going point by point would fill a book.
3) Actual running RAM usage: Many targets will use less RAM and less
stack space (some more RAM because I upped the number of cache buffers
for large memory). There's very little memory lying fallow in rarely-used
areas (see 'Key core changes' below). Also, all targets may open the same
number of directory streams whereas before those with less than 8MB RAM
were limited to 8, not 12 implying those targets will save slightly
4) Performance: The test_disk plugin shows markedly improved performance,
particularly in the area of (uncached) directory scanning, due partly to
more optimal directory reading and to a better sector cache algorithm.
Uncached times tend to be better while there is a bit of a slowdown in
dircache due to it being a bit heavier of an implementation. It's not
noticeable by a human as far as I can say.
Key core changes:
1) Files and directories share core code and data structures.
2) The filesystem code knows which descriptors refer to same file.
This ensures that changes from one stream are appropriately reflected
in every open descriptor for that file (fileobj_mgr.c).
3) File and directory cache buffers are borrowed from the main sector
cache. This means that when they are not in use by a file, they are not
wasted, but used for the cache. Most of the time, only a few of them
are needed. It also means that adding more file and directory handles
is less expensive. All one must do in ensure a large enough cache to
4) Relative path components are supported and the namespace is unified.
It does not support full relative paths to an implied current directory;
what is does support is use of "." and "..". Adding the former would
not be very difficult. The namespace is unified in the sense that
volumes may be specified several times along with relative parts, e.g.:
"/<0>/foo/../../<1>/bar" :<=> "/<1>/bar".
5) Stack usage is down due to sharing of data, static allocation and
less duplication of strings on the stack. This requires more
serialization than I would like but since the number of threads is
limited to a low number, the tradoff in favor of the stack seems
6) Separates and heirarchicalizes (sic) the SIM and APP filesystem
code. SIM path and volume handling is just like the target. Some
aspects of the APP file code get more straightforward (e.g. no path
hashing is needed).
Deserves its own section. Dircache is new but pays homage to the old.
The old one was not compatible and so it, since it got redone, does
all the stuff it always should have done such as:
1) It may be update and used at any time during the build process.
No longer has one to wait for it to finish building to do basic file
management (create, remove, rename, etc.).
2) It does not need to be either fully scanned or completely disabled;
it can be incomplete (i.e. overfilled, missing paths), still be
of benefit and be correct.
3) Handles mounting and dismounting of individual volumes which means
a full rebuild is not needed just because you pop a new SD card in the
slot. Now, because it reuses its freed entry data, may rebuild only
4) Much more fundamental to the file code. When it is built, it is
the keeper of the master file list whether enabled or not ("disabled"
is just a state of the cache). Its must always to ready to be started
and bind all streams opened prior to being enabled.
5) Maintains any short filenames in OEM format which means that it does
not need to be rebuilt when changing the default codepage.
1) Update any other code that would otherwise not work such as the
hotswap mounting code in various card drivers.
2) File management: Clipboard needed updating because of the behavioral
changes. Still needs a little more work on some finer points.
3) Remove now-obsolete functionality such as the mutex's "no preempt"
flag (which was only for the prior FAT driver).
4) struct dirinfo uses time_t rather than raw FAT directory entry
time fields. I plan to follow up on genericizing everything there
(i.e. no FAT attributes).
5) unicode.c needed some redoing so that the file code does not try
try to load codepages during a scan, which is actually a problem with
the current code. The default codepage, if any is required, is now
kept in RAM separarately (bufalloced) from codepages specified to
iso_decode() (which must not be bufalloced because the conversion
may be done by playback threads).
Brings with it some additional reusable core code:
1) Revised file functions: Reusable code that does things such as
safe path concatenation and parsing without buffer limitations or
data duplication. Variants that copy or alter the input path may be
based off these.
1) Put dircache functionality back in the sim. Treating it internally
as a different kind of file system seems the best approach at this
2) Restore use of dircache indexes in the playlist and database or
something effectively the same. Since the cache doesn't have to be
complete in order to be used, not getting a hit on the cache doesn't
unambiguously say if the path exists or not.
Reviewed-by: Michael Sevakis <email@example.com>
Tested: Michael Sevakis <firstname.lastname@example.org>
After a local commit, any file that included version.h would have to
be recompiled on account of the changed version string. This changes
version.h in the build directory to rbversion.h and includes the
preprocessor macro from rbversion.h in firmware/common/version.c so
that only that one file needs to be recompiled after a local commit
rather than a whole slew of them.
Reviewed-by: Michael Sevakis <email@example.com>
Tested: Michael Sevakis <firstname.lastname@example.org>