2012年3月4日 星期日

SuperFloopy, USB Stick without partition problem

在舊版的WinCE 系統遇到了一個奇怪的問題
有一些新的USB Flash, 使用WINCE 來Format
之後 在舊版的WINCE 5.0 上不能讀取
但在較新的WINCE 5.0 (可能更新過) 讀取沒有問題

2. 後來發現這些會有問題的 flash disk, 竟然沒有 partition table, 又稱為 superfloopy.
3. 如果把這些flash 用Windows 7 format, 結果在 Windows 及 WINCE (old)都能讀

4. 經過非常仔細地比較 Windows 及 WINCE format 出來的內容, Boot, FAT, ...
找不出可疑的地方。 最後,竟然在不可能的地方發現。
原來Boot Sector 下方的字串區,WINCE 竟然會去比較。
而且比較的方式相當奇怪 並且找不出規則。

5. 後來 I realize , WINCE 是試著去讀取 partition table,WINCE 正常所 format 的值, 都為0 ,所以檢查不過,就不會load。而 Windows 7 所format 的值 剛好為字串區,剛好又符合WinCE 的檢查, 所以 ok.

6. solution. make false partition table data for WINCE to check.
一,要有兩個partition
二,  partition 1 的 LBA start address 要比 partition 0 的start address 小才行。兩個partition 的size 不能為0即可。
三, 兩個partition 的 type 要設  (如0x05) 不然Windows 7 會認不出並提示你format disk。

7. 問題總結。
一,起源是因為新的一些flash (SuperFloopy) 並沒有partition table, 第一個Physical Sector 就是Boot Sector MBR。
二,舊的WINCE 並不知道,一樣檢查partition table 然後拒絕載入。WINCE所format 的boot sector 這附近皆為0.
三, Windows 7 所format 的 boot sector,partition table 附近為顯示字串, 而且值剛好可以過關, 所以Windows 所format 的superfloopy 在舊的WINCE 沒問題。
四,較新的WINCE 5.0 應該有改過檢查的 code, 所以不管從裡format 的flash   都能用。
五, 其實Windows 7 一樣沒有handle this correctly, 一樣會去讀取partition table 並檢查, 在某些資料下(如有Start Sector, partition size, 但沒有partition type ), 會認為這個Disk 是unformatted 並提示使用者format.


related information but not this problem
http://support.microsoft.com/kb/904255

[HKEY_LOCAL_MACHINE\System\StorageManager\FATFS]
"BypassFATSectorCheck"=dword:1

沒有留言: