summaryrefslogtreecommitdiff
path: root/bootloader/ipod.c (follow)
Commit message (Collapse)AuthorAge
* Rewrite filesystem code (WIP)Michael Sevakis2014-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 less. 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 borrow from. 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 reasonable. 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). Dircache: 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 that volume. 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. Miscellaneous Compatibility: 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. To do: 1) Put dircache functionality back in the sim. Treating it internally as a different kind of file system seems the best approach at this time. 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. Change-Id: Ia30f3082a136253e3a0eae0784e3091d138915c8 Reviewed-on: http://gerrit.rockbox.org/566 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested: Michael Sevakis <jethead71@rockbox.org>
* Fix up the bootloadersMichael Sevakis2014-08-28
| | | | | | They can't access the raw RBVERSION define any longer. Change-Id: I698062b36306399945c01de54cdccaa1a1a8434e
* Bootloaders need the reacharound to get at the internal goodsMichael Sevakis2014-08-08
| | | | | | They need to include kernel-internal.h in order to perform inits. Change-Id: I5b0f155e4ff49a065c6cb97691ecd4396a199979
* Move load_firmware() to separate fileMarcin Bukat2013-06-27
| | | | | | | | The idea is to share loading code between bootloaders and rolo(). Change-Id: I1656ed91946d7a05cb7c9fa7a16793c3c862a5cd Reviewed-on: http://gerrit.rockbox.org/190 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
* Generate C file / header for svn version stringRafaël Carré2010-05-27
| | | | | | | | | | | | | | | | | | | | | | | | It's now easier to force rebuild of files depending on the svn revision version.c/version.h are generated once with new tools/genversion.sh Changes in the VCS are still not auto detected, so you'll have to remove builddir/version.* if you want to change the string in your binaries APPSVERSION is now called RBVERSION and is defined in the generated header instead of being defined by the Makefiles appsversion is now called rbversion (the plugin api number didn't change since old modules are still binary compatible) Change some bootloaders to use knwon-at-buildtime RBVERSION instead of "%s" + rbversion You'll need to run make clean to regenerate dependencies after the removal of apps/version.h To build binaries with a different version string, hand-edit tools/version.sh or tools/genversion.sh (which calls the former) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26320 a1c6a512-1295-4272-9138-f99709370657
* FS#11199: ipod bootloader: reboot to disk mode on cable insert, following a ↵Torne Wuff2010-04-13
| | | | | | | | | fatal error If the ipod bootloader dies with a fatal error it prompts you to press buttons to reset and enter disk mode. With this change it now also polls for USB/firewire insertion and if the cable is detected, it reboots to disk mode directly for you, avoiding user problems with rebooting correctly by hand. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25643 a1c6a512-1295-4272-9138-f99709370657
* FS#9730 by Torne Wuff - support installing Rockbox in the firmware partition ↵Dave Chapman2009-05-12
| | | | | | in place of the main Apple firmware. This image is only loaded if no rockbox.ipod is found so does not affect current behaviour. The advantage is a small increase in boottime. This patch also adds documentation to bootloader/ipod.c in the form of a comment describing the booting behaviour. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20921 a1c6a512-1295-4272-9138-f99709370657
* Hopefully mop-up remaining red.Michael Sevakis2008-12-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19317 a1c6a512-1295-4272-9138-f99709370657
* Use BOOTDIR and BOOTFILE defines instead of hardcoded path and file. FS#9559Björn Stenberg2008-11-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19190 a1c6a512-1295-4272-9138-f99709370657
* Don't print partition sizes in megabytes, as that is buggy on 5.5G. Use ↵Frank Gevaerts2008-11-21
| | | | | | sectors instead git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19170 a1c6a512-1295-4272-9138-f99709370657
* Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg2008-06-28
| | | | | | | | | later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
* Revert... stupid svn doesn't complain when passing -m twice :(Jens Arnold2008-04-02
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16939 a1c6a512-1295-4272-9138-f99709370657
* Make the measured LCD scanrates from the greylib known to the scanrate test ↵Jens Arnold2008-04-02
| | | | | | plugin. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16938 a1c6a512-1295-4272-9138-f99709370657
* Revert accidental tree commit. /me needs a smaller enter key...Jens Arnold2008-03-25
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16805 a1c6a512-1295-4272-9138-f99709370657
* Cabbiev2 gigabeat background: reduce WPS backdrop filesize by storing it as ↵Jens Arnold2008-03-25
| | | | | | 24 bit BMP instead of unnecessary 32 bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16802 a1c6a512-1295-4272-9138-f99709370657
* Fix iPod Nano & Video bootloaders. Backlight uses sleep(), hence it must be ↵Jens Arnold2007-11-21
| | | | | | initialised after kernel_init(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15743 a1c6a512-1295-4272-9138-f99709370657
* Hardware controlled backlight brightness for iPod Video and Nano, retaining ↵Jens Arnold2007-11-12
| | | | | | the software PWM fade in/ fade out. * Backlight handling cleanup, getting rid of one layer of 'lowlevelness'. * Use atomic GPIO bit manipulation for PP502x backlight handling. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15599 a1c6a512-1295-4272-9138-f99709370657
* 1st/2nd gen bootloader: * Don't be verbose by default anymore. * Don't ↵Jens Arnold2007-09-12
| | | | | | enable the backlight, as it looks bad in a bright environment due to backlight inversion, and it needs a lot of power. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14678 a1c6a512-1295-4272-9138-f99709370657
* G1/G2 bootloader working (always in verbose mode for now). Corrected fatal ↵Jens Arnold2007-07-27
| | | | | | error help text for G1..G3. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14020 a1c6a512-1295-4272-9138-f99709370657
* Remove the hack which read the ipod hardware revision from flash in the ↵Dave Chapman2007-07-25
| | | | | | bootloader and passed it to Rockbox via a fixed address in SDRAM. Rockbox now remaps flash and so can just read the value itself. Also clean up the debug menu a little - only display the hw revision for ipods, and add the lcd_type variable to indicate the type of LCD (0 or 1) for ipod Color/Photo. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13986 a1c6a512-1295-4272-9138-f99709370657
* Clarify the need to hold MENU+SELECT to reboot an ipodDave Chapman2007-05-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13476 a1c6a512-1295-4272-9138-f99709370657
* Ooops (about 3 months too late) - when an error is found by the bootloader, ↵Dave Chapman2007-05-22
| | | | | | call lcd_update() so users can see it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13468 a1c6a512-1295-4272-9138-f99709370657
* Non-functional change - use the firmware __backlight_on() function instead ↵Dave Chapman2007-04-12
| | | | | | of writing directly to the ports to turn the backlight on git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13128 a1c6a512-1295-4272-9138-f99709370657
* Fix the loading of RetailOS from a file (apple_os.ipod in the root or .rockbox/)Dave Chapman2007-03-06
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12644 a1c6a512-1295-4272-9138-f99709370657
* Remove the leading "20" from the version string - it no longer makes sense ↵Dave Chapman2007-03-06
| | | | | | with the SVN revision number git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12642 a1c6a512-1295-4272-9138-f99709370657
* Disable bootloader messages in the ipod bootloader unless the RIGHT button ↵Dave Chapman2007-03-05
| | | | | | is being held. Messages are still displayed if an error occurs. This needs implementing for the other bootloaders. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12631 a1c6a512-1295-4272-9138-f99709370657
* Replace some inl/outl with register #define's instead. Also tidy up pp5020.h ↵Barry Wardell2007-03-03
| | | | | | so that it's in increasing address order. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12574 a1c6a512-1295-4272-9138-f99709370657
* FS#6554. Move bootloader code into a common file. Only PortalPlayer devices ↵Barry Wardell2007-01-28
| | | | | | (iPods, H10, Sansa) are affected for the moment. Someone with access to (and no fear of bricking) an X5, H100, H300 and Gigabeat should try to adapt those bootloaders to also use the code in common.c. The (non-working) patch in the tracker would be a good place to start with this. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12136 a1c6a512-1295-4272-9138-f99709370657
* Verbose error messages in the iPod bootloaderLinus Nielsen Feltzing2007-01-18
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12064 a1c6a512-1295-4272-9138-f99709370657
* Make the build system create a sysfont.h which includes font information for ↵Barry Wardell2007-01-17
| | | | | | | | | the system font. Available #defines are: SYSFONT_NAME, SYSFONT_FACENAME, SYSFONT_WIDTH, SYSFONT_HEIGHT, SYSFONT_SIZE, SYSFONT_ASCENT, SYSFONT_DESCENT, SYSFONT_FIRST_CHAR, SYSFONT_LAST_CHAR, SYSFONT_DEFAULT_CHAR, SYSFONT_PROPORTIONAL, SYSFONT_COPYRIGHT, SYSFONT_BITS_SIZE. Also fix a small bug in the iPod bootloader printf() code and use printf() for PortalPlayer bootloaders too. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12041 a1c6a512-1295-4272-9138-f99709370657
* Added printf() instead of snprintf/lcd_puts/lcd_updateLinus Nielsen Feltzing2007-01-16
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12033 a1c6a512-1295-4272-9138-f99709370657
* Restrict the width of some displayed messages (fixes display on Minis and Nano).Dave Chapman2006-12-17
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11782 a1c6a512-1295-4272-9138-f99709370657
* Changes to ipod bootloader to bring in line with the capabilities of ↵Dave Chapman2006-12-17
| | | | | | ipodpatcher: Detect if the bootloader has been installed without the Apple firmware; load the Apple firmware from an apple_os.ipod file on the FAT32 partition. Also change to use hold switch to decide when to boot into the Apple firmware (turning hold on whilst booting will start the Apple firmware). Plus a cosmetic change to white text on a black background. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11780 a1c6a512-1295-4272-9138-f99709370657
* Remove unused code in (and hence simplify) the ipod bootloader - the image ↵Dave Chapman2006-12-10
| | | | | | header parsing and memmove isn't used in Rockbox, it was just leftover from the original ipodlinux loader. Note that we still need the empty space in the bootloader (400 bytes starting at 0x100 - the 'boot_table' definition in firmware/target/arm/crt0-pp.S) to maintain compatibility with ipod_fw/make_fw (which will write information there that we have always ignored). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11704 a1c6a512-1295-4272-9138-f99709370657
* Initial work for coprocessor support on iPods. FS#5755Daniel Ankers2006-08-03
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10437 a1c6a512-1295-4272-9138-f99709370657
* Fix button driver for ipod mini 1G.Frank Dischner2006-04-19
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9732 a1c6a512-1295-4272-9138-f99709370657
* iPod mini 2G: Working button check in bootloader.Jens Arnold2006-04-02
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9416 a1c6a512-1295-4272-9138-f99709370657
* Patch #3060 from Andrew Scott - iPod mini button driverDave Chapman2006-02-27
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8857 a1c6a512-1295-4272-9138-f99709370657
* iPod 3G: Use correct DRAM_START address when branching to RockboxDave Chapman2006-02-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8767 a1c6a512-1295-4272-9138-f99709370657
* Patch #1435744 from Andrew Scott - initial iPod Mini supportDave Chapman2006-02-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8764 a1c6a512-1295-4272-9138-f99709370657
* iPod 3G support in Bootloader from Seven Le MesleDave Chapman2006-02-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8587 a1c6a512-1295-4272-9138-f99709370657
* Oops - fix red iPod bootloader buildDave Chapman2006-01-31
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8501 a1c6a512-1295-4272-9138-f99709370657
* iPod: Fix the detection of lcd type for the iPod Photo - this should fix ↵Dave Chapman2006-01-31
| | | | | | problems with that LCD. Affected users also need to install a new bootloader - available from the iPod Installation wiki page. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8499 a1c6a512-1295-4272-9138-f99709370657
* Line too wide for nano screen, split it up.Thom Johansen2006-01-18
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8376 a1c6a512-1295-4272-9138-f99709370657
* Remove logos from bootloaderDave Chapman2006-01-18
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8373 a1c6a512-1295-4272-9138-f99709370657
* iPod: Fix the bootloader so it can load and run the original Apple firmware ↵Dave Chapman2006-01-05
| | | | | | again. The Rockbox firmware was doing too much to the hardware so we remove most of the initialisation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8301 a1c6a512-1295-4272-9138-f99709370657
* iPod: Change bootloader so that Rockbox loads by default. Holding down MENU ↵Dave Chapman2005-11-20
| | | | | | now boots to the Apple firmware. Check .rockbox/ for a firmware file (to be consistent with the iriver bootloader) and remove the cosmetic sleep. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8012 a1c6a512-1295-4272-9138-f99709370657
* Fixes for new 16-bit framebuffer typeDave Chapman2005-11-14
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7883 a1c6a512-1295-4272-9138-f99709370657
* Implement (unreliable) button detection using code from ipodlinux bootloader ↵Dave Chapman2005-11-13
| | | | | | - this needs replacing by a better button driver in firmware/ and triple-boot bootloader functionality. Current button mappings: MENU loads rockbox.ipod and checks the checksum (but doesn't execute it), PLAY will load and execute a Linux kernel (linux.bin). An error in either of those two actions, or no keypress will load the original firmware git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7848 a1c6a512-1295-4272-9138-f99709370657
* Ooops. There was an unclosed comment in the source.Dave Chapman2005-11-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7788 a1c6a512-1295-4272-9138-f99709370657