LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices



Reply
 
Search this Thread
Old 01-18-2010, 01:16 PM   #1
Braiam
LQ Newbie
 
Registered: Dec 2009
Posts: 5

Rep: Reputation: 0
File written, under FreeDOS, on spi flash (formatted as FAT12) is not found in Linux


Hi all,

I have a development board which has an spi flash. Under linux, this flash is mounted as MTD block device. I'm using the formatting tool provided by manufacturer, called spitool.exe. If I write file to the flash when I want to read it under FreeDOS it is not found. Otherwise If I write file under FreeDOS it is not found under Linux. The flash is formatted as FAT12 disk. BIOS emulates the spi flash as a floppy disk. The superblock is written by the spitool.exe. Why is it occurring?
I read the flash in raw mode and I realized that the Directory Entry of the file (in root directory) was written at different byte offset when the file was written under FreeDOS in relation to Linux. Root Directory Entries can only be written starting at sector 13 up to sector 27. But under FreeDOS the Root Directory Entries was written starting at sector 41.
Any help will be appreciated.
 
Old 01-18-2010, 01:28 PM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
What is the mount command you use under Linux, to mount the gadget? The reason I ask is (though I don't know much about the deep down workings of the various FAT formats) I wonder if Linux is detecting it as the correct FAT version, and/or if not, could "wrong FAT version" account for the offset difference you discovered??

From `man mount` there is the option: fat=12

..which might force the correct FAT type (assumibng it's wrong to begin with, but again, I don't know whether the different FATs each use a different offset, leading to what you describe).

Sorry I can't offer anything further; I hope someone else has something to offer!

Sasha
 
Old 01-18-2010, 02:47 PM   #3
Braiam
LQ Newbie
 
Registered: Dec 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by GrapefruiTgirl View Post
What is the mount command you use under Linux, to mount the gadget? The reason I ask is (though I don't know much about the deep down workings of the various FAT formats) I wonder if Linux is detecting it as the correct FAT version, and/or if not, could "wrong FAT version" account for the offset difference you discovered??

From `man mount` there is the option: fat=12

..which might force the correct FAT type (assumibng it's wrong to begin with, but again, I don't know whether the different FATs each use a different offset, leading to what you describe).

Sorry I can't offer anything further; I hope someone else has something to offer!

Sasha
I added some "printk's" in FAT source file and I recompiled the FAT driver. One printk shows the FAT bits (12, 16 or 32). And it showed 12 bits for the FAT recorded on the flash (accordingly to FAT superblock).

Thank you for your response.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is incompatible FAT12 driver between Linux and FreeDOS? Braiam Linux - Kernel 2 12-28-2009 09:54 AM
SPI Flash driver (mtd) for Spansion S25FL128P luklem Linux - Embedded & Single-board computer 0 07-30-2009 11:04 AM
File Recovery from linux formatted partition ullasvm Linux - Software 2 11-21-2006 01:54 AM
HFS+ Formatted Flash Drive Mounts as Read-Only applewax Linux - Hardware 4 11-03-2006 11:00 AM
Has anyone written a Flash animation app? Cogvos Linux - Software 2 05-28-2005 06:07 PM


All times are GMT -5. The time now is 10:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration