summaryrefslogtreecommitdiff
path: root/firmware/test/fat/ata-sim.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-10-20 22:50:58 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-10-20 22:50:58 +0000
commitb7b48fea02fdac51071eef084a980cee4bcba221 (patch)
treeca2e1f55fd67cda98b395eb0259d14426865af4f /firmware/test/fat/ata-sim.c
parent1df1e51a030e3a7c87f7e882f67b3c7588353300 (diff)
downloadrockbox-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.c7
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
25int ata_write_sectors(unsigned long start, unsigned char count, void* buf) 25int 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;