diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-10-20 22:50:58 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-10-20 22:50:58 +0000 |
commit | b7b48fea02fdac51071eef084a980cee4bcba221 (patch) | |
tree | ca2e1f55fd67cda98b395eb0259d14426865af4f /firmware/test/fat/ata-sim.c | |
parent | 1df1e51a030e3a7c87f7e882f67b3c7588353300 (diff) | |
download | rockbox-b7b48fea02fdac51071eef084a980cee4bcba221.tar.gz rockbox-b7b48fea02fdac51071eef084a980cee4bcba221.zip |
Snapshot of file writing code. Bugs remain. Only short names are supported yet.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2726 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/test/fat/ata-sim.c')
-rw-r--r-- | firmware/test/fat/ata-sim.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/test/fat/ata-sim.c b/firmware/test/fat/ata-sim.c index ab7266d6a0..a37fabcfc0 100644 --- a/firmware/test/fat/ata-sim.c +++ b/firmware/test/fat/ata-sim.c | |||
@@ -24,6 +24,13 @@ int ata_read_sectors(unsigned long start, unsigned char count, void* buf) | |||
24 | 24 | ||
25 | int ata_write_sectors(unsigned long start, unsigned char count, void* buf) | 25 | int ata_write_sectors(unsigned long start, unsigned char count, void* buf) |
26 | { | 26 | { |
27 | DEBUGF("Writing block 0x%lx\n",start); | ||
28 | |||
29 | if (start == 0) { | ||
30 | DEBUGF("Holy crap! You're writing on sector 0!\n"); | ||
31 | exit(0); | ||
32 | } | ||
33 | |||
27 | if(fseek(file,start*BLOCK_SIZE,SEEK_SET)) { | 34 | if(fseek(file,start*BLOCK_SIZE,SEEK_SET)) { |
28 | perror("fseek"); | 35 | perror("fseek"); |
29 | return -1; | 36 | return -1; |