Rockbox Development > New Ports
Sandisk Sansa e200 v2
saratoga:
--- Quote from: newflesh on March 12, 2008, 05:20:31 PM ---So, if we assume that the ROM-code can handle MSC transfers independently of the firmware, and that it has a function to look for the firmware files in the flash, wouldn't that indicate that there's a pretty safe way to unbrick the device if you can make files it accepts?
--- End quote ---
But how do you get into that mode? If you write a bootloader with the correct header, the ROM is going to think the firmware is ok and then switch control over to it. If your firmware then doesn't work properly, how will you get back to the ROM's USB mode?
newflesh:
Maybe there's some key combo that instructs the embedded code to run the install/update feature? Maybe starting with the MSC command does that... it sounds possible with brickhouse's support response.
Is there a bootloader in the firmware bins available? Could it be possible Sandisk decided to only use the bootloader on the ROM, and that the installer checks root for a bin before loading the installed firmware?
pgs:
--- Quote from: saratoga on March 12, 2008, 08:20:21 PM ---
But how do you get into that mode? If you write a bootloader with the correct header, the ROM is going to think the firmware is ok and then switch control over to it. If your firmware then doesn't work properly, how will you get back to the ROM's USB mode?
--- End quote ---
I could imagine that, if they did it properly, it could work, from boot ROM, like this:
reset:
start:
if(standalone) run_firmware
else /* following occurs in msc mode */
while(msc_mode) do_msc_stuff
/* out of MSC mode, i.e. USB detach */
if(new_firmware) update_firmware
udpate_db /*maybe in else clause? or maybe update_db.run_firmware */
reset
Since this would be in the internal ROM, it will always work.
If the firmware fails, it could be possible to attach the thing to a PC, start in MSC mode, and replace the firmware.
Of course, _if_ they did this way.
The update db thing is a bit unclear, running it in boot ROM makes no sense, on the other hand, somewhere it should go...
Topic change, maybe someone could be interested.
About the "hidden directories", instead of changing the attribute on the device, one option could be to "modify" some FAT "drivers" in order to see the attribute 0x18 as a dir.
There is a quite easy possibility, so use some FAT, fuse based, filesystem, under Linux.
So, I installed "libfat", from: http://sourceforge.net/projects/libfat/ and added the above attribute as directory.
This is pretty straightforward, just edit bits/libfat.h (in the source tree) with:
--- libfat.h.org 2007-05-22 10:04:49.000000000 +0200
+++ libfat.h 2008-03-15 15:03:43.000000000 +0100
@@ -244,10 +244,11 @@
#define ATTR_SYSTEM 0x4
#define ATTR_VOLUME_ID 0x8
#define ATTR_DIRECTORY 0x10
+#define ATTR_HIDDEN_DIRECTORY 0x18
#define ATTR_ARCHIVE 0x20
#define ATTR_LONG_NAME ( ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID )
-#define ATTR_ISDIR(D) ( ( (D) & ATTR_DIRECTORY ) == ATTR_DIRECTORY )
+#define ATTR_ISDIR(D) ( ( ( (D) & ATTR_DIRECTORY ) == ATTR_DIRECTORY ) || ( ( ( (D) & ATTR_HIDDEN_DIRECTORY ) == ATTR_HIDDEN_DIRECTORY ) ) )
/* values used by libfat. not correlated with fat file system values */
Configure, compile and mount (read-only), the hidden directory will be visible.
Hope this help.
pgs
saratoga:
--- Quote from: pgs on March 15, 2008, 10:11:22 AM ---
I could imagine that, if they did it properly, it could work, from boot ROM, like this:
reset:
start:
if(standalone) run_firmware
else /* following occurs in msc mode */
 while(msc_mode) do_msc_stuff
 /* out of MSC mode, i.e. USB detach */
 if(new_firmware) update_firmware
 udpate_db /*maybe in else clause? or maybe update_db.run_firmware */
 reset
Since this would be in the internal ROM, it will always work.
--- End quote ---
Yes but if the firmware you flash does not work, none of that will matter since the system will crash as soon as it boots. This is why you need a way to recover from bad flashes.
pgs:
--- Quote from: saratoga on March 15, 2008, 11:01:34 PM ---
Yes but if the firmware you flash does not work, none of that will matter since the system will crash as soon as it boots. This is why you need a way to recover from bad flashes.
--- End quote ---
There is one assumption that maybe was not clear: the MSC mode is in the ROM (Read Only Memory), not in the flash (or it is in the boot loader of the flash, which can be protected).
So, as soon as the device is attached to a PC, it goes in MSC (if enabled) and this will always work, no matter what firmware it has.
This is similar to the (not so new) BIOS recovery feature of PCs, where, even in case of bad flashing, there is a part of the BIOS untouched, which can boot and reprogram the flash by its own.
If the flashing is gone bad, the device will be anyway able to go in MSC and reprogram the flash, since this mode is non-modifiable.
In other words, the very first boot manager is in ROM and it always has the chance to start the firmware or go into MSC mode, no matter how bad is the firmware, and later re-flash or re-start the firmware.
They _could_ have implemented this way, hopefully they did.
pgs
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version