diff options
Diffstat (limited to 'firmware/test/fat/ata-sim.c')
-rw-r--r-- | firmware/test/fat/ata-sim.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/test/fat/ata-sim.c b/firmware/test/fat/ata-sim.c index a37fabcfc0..a64e0a4d4d 100644 --- a/firmware/test/fat/ata-sim.c +++ b/firmware/test/fat/ata-sim.c | |||
@@ -9,7 +9,7 @@ static FILE* file; | |||
9 | 9 | ||
10 | int ata_read_sectors(unsigned long start, unsigned char count, void* buf) | 10 | int ata_read_sectors(unsigned long start, unsigned char count, void* buf) |
11 | { | 11 | { |
12 | DEBUGF("Reading block 0x%lx\n",start); | 12 | DEBUGF("[Reading block 0x%lx]\n",start); |
13 | if(fseek(file,start*BLOCK_SIZE,SEEK_SET)) { | 13 | if(fseek(file,start*BLOCK_SIZE,SEEK_SET)) { |
14 | perror("fseek"); | 14 | perror("fseek"); |
15 | return -1; | 15 | return -1; |
@@ -17,14 +17,14 @@ int ata_read_sectors(unsigned long start, unsigned char count, void* buf) | |||
17 | if(!fread(buf,BLOCK_SIZE,count,file)) { | 17 | if(!fread(buf,BLOCK_SIZE,count,file)) { |
18 | printf("Failed reading %d blocks starting at block 0x%lx\n",count,start); | 18 | printf("Failed reading %d blocks starting at block 0x%lx\n",count,start); |
19 | perror("fread"); | 19 | perror("fread"); |
20 | return -1; | 20 | return -2; |
21 | } | 21 | } |
22 | return 0; | 22 | return 0; |
23 | } | 23 | } |
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); | 27 | DEBUGF("[Writing block 0x%lx]\n",start); |
28 | 28 | ||
29 | if (start == 0) { | 29 | if (start == 0) { |
30 | DEBUGF("Holy crap! You're writing on sector 0!\n"); | 30 | DEBUGF("Holy crap! You're writing on sector 0!\n"); |
@@ -37,7 +37,7 @@ int ata_write_sectors(unsigned long start, unsigned char count, void* buf) | |||
37 | } | 37 | } |
38 | if(!fwrite(buf,BLOCK_SIZE,count,file)) { | 38 | if(!fwrite(buf,BLOCK_SIZE,count,file)) { |
39 | perror("fwrite"); | 39 | perror("fwrite"); |
40 | return -1; | 40 | return -2; |
41 | } | 41 | } |
42 | return 0; | 42 | return 0; |
43 | } | 43 | } |