LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 12: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, 12:28 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
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, 01: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



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 08:54 AM
SPI Flash driver (mtd) for Spansion S25FL128P luklem Linux - Embedded & Single-board computer 0 07-30-2009 10:04 AM
File Recovery from linux formatted partition ullasvm Linux - Software 2 11-21-2006 12:54 AM
HFS+ Formatted Flash Drive Mounts as Read-Only applewax Linux - Hardware 4 11-03-2006 10:00 AM
Has anyone written a Flash animation app? Cogvos Linux - Software 2 05-28-2005 05:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 05:29 PM.

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
Open Source Consulting | Domain Registration