From: Sacha Chua (sacha@free.net.ph)
Date: Mon Jun 10 2002 - 02:58:35 EDT
"Wong Yee Peng" <wyeepeng@dso.org.sg> writes:
> I tried the bootldr-2.18.44.bin on my iPAQ. I found that it
> supports mounting a vfat filesystem on a CF card. So I mounted
> the card and tried the vfat write command to write some data
...
> the same, ie the write has not been done.
vfat write then vfat read to a different address seems to indicate
that the write has been performed. However, you're right - the file
size indicator changes, but the data itself doesn't.
Uh oh. <sigh>
Looks like another of those pesky reoccuring bootloader bugs. I'm
really sorry about this.
cat <file> doesn't report the changes, but vfat read (even after a
reboot) does. That means that the data's being written all right, but
it's somewhere it shouldn't be.
I made a test file foo on a newly-formatted CF. The test file
correctly starts at the 2nd cluster. Still no change reflected in cat.
copy bootldr hda1:foo finally manages to affect it. That probably
means I've got the wrong starting offset. But
# echo "foo" > foo
file_cluster badly computed!!! 0 <> 1073741823
Okay, I'm clueless. I suspect that I'm reading and writing to the
wrong sectors, but ide read_sector 0xc0000000 0x1f5 is 0 (first root
dir sector), as is read_sector of 0x215, so it's not easy to
debug. (Maybe there's something wrong with ide read_sector?)
I notice that vfat read_cluster 2 and the vfat writes use cluster 2,
sector 215, and place it at cylinder 2, start_sector 25.
However, ide read_sector 0x215 uses cylinder 2, start_sector 15. Hmm.
AHA! If I use ide read_sector 225, that picks up the same data that
read_cluster did. So - which one's correct?
AHA! vfat read_cluster 0xc0000000 0x3 0x4 does see my test data!
AHA! When the file starts on cluster 3, I can suddenly magically
change the data and have it appear.
Oh wait. Um. The bug disappeared. Any changes I make to the files are
reflected. I even poked my name into it.
I'm getting thoroughly confused now, so I'd really love it if someone
can step in and sort out that tangled code. I'll be up in the
mountains for the next few days on a vacation with one of my best
friends, so I won't be able to work on it just yet. <sigh> I wonder
what's wrong with it.
Try upgrading to the latest bootldr from CVS.
-- Sacha Chua <sacha@free.net.ph> - 4 BS CS Ateneo geek interests: emacs, linux, wearables, teaching compsci
This archive was generated by hypermail 2.1.5 : Fri Jan 17 2003 - 17:47:04 EST