diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2002-05-03 11:59:53 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2002-05-03 11:59:53 +0000 |
| commit | c7f7934e8f74be4b98abe83c2f6a2593fd294cf0 (patch) | |
| tree | cdebbde186e8db107472c5a7b0775f050e7f4560 /firmware/test | |
| parent | 86a59ecdf6e6bf3e45938c0ca305b892777b28e0 (diff) | |
| download | rockbox-c7f7934e8f74be4b98abe83c2f6a2593fd294cf0.zip rockbox-c7f7934e8f74be4b98abe83c2f6a2593fd294cf0.tar.gz rockbox-c7f7934e8f74be4b98abe83c2f6a2593fd294cf0.tar.bz2 rockbox-c7f7934e8f74be4b98abe83c2f6a2593fd294cf0.tar.xz | |
Added disk/partition handling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@405 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/test')
| -rw-r--r-- | firmware/test/fat/Makefile | 13 | ||||
| -rw-r--r-- | firmware/test/fat/debug.h | 9 | ||||
| -rw-r--r-- | firmware/test/fat/main.c (renamed from firmware/test/fat/debug.c) | 28 |
3 files changed, 38 insertions, 12 deletions
diff --git a/firmware/test/fat/Makefile b/firmware/test/fat/Makefile index 8b60aba..6b253fe 100644 --- a/firmware/test/fat/Makefile +++ b/firmware/test/fat/Makefile @@ -1,18 +1,25 @@ +FIRMWARE = ../.. DRIVERS = ../../drivers -CFLAGS = -g -Wall -DTEST_FAT -I$(DRIVERS) -I. +CFLAGS = -g -Wall -DTEST_FAT -I$(DRIVERS) -I$(FIRMWARE)/common -I$(FIRMWARE) -I. -DDEBUG -DCRT_DISPLAY TARGET = fat -$(TARGET): fat.o ata-sim.o debug.o +$(TARGET): fat.o ata-sim.o debug.o main.o disk.o gcc -g -o fat $+ -lfl fat.o: $(DRIVERS)/fat.c $(DRIVERS)/fat.h $(DRIVERS)/ata.h $(CC) $(CFLAGS) -c $< -o $@ +disk.o: $(FIRMWARE)/common/disk.c + $(CC) $(CFLAGS) -c $< -o $@ + +debug.o: $(FIRMWARE)/debug.c + $(CC) $(CFLAGS) -c $< -o $@ + ata-sim.o: ata-sim.c $(DRIVERS)/ata.h -debug.o: debug.c debug.h $(DRIVERS)/ata.h +main.o: main.c $(DRIVERS)/ata.h clean: rm -f *.o $(TARGET) diff --git a/firmware/test/fat/debug.h b/firmware/test/fat/debug.h deleted file mode 100644 index ff786ab..0000000 --- a/firmware/test/fat/debug.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef DEBUG_H -#define DEBUG_H - -void dbg_dump_sector(int sec); -void dbg_dump_buffer(unsigned char *buf); -void dbg_print_bpb(struct bpb *bpb); -void dbg_console(struct bpb *bpb); - -#endif diff --git a/firmware/test/fat/debug.c b/firmware/test/fat/main.c index fa7ff86..ffe3dd8 100644 --- a/firmware/test/fat/debug.c +++ b/firmware/test/fat/main.c @@ -4,6 +4,12 @@ #include "fat.h" #include "ata.h" #include "debug.h" +#include "disk.h" + +void dbg_dump_sector(int sec); +void dbg_dump_buffer(unsigned char *buf); +void dbg_print_bpb(struct bpb *bpb); +void dbg_console(struct bpb *bpb); void dbg_dump_sector(int sec) { @@ -189,3 +195,25 @@ void dbg_console(struct bpb* bpb) } } } + +int main(int argc, char *argv[]) +{ + struct bpb bpb; + + if(ata_init()) { + DEBUGF("*** Warning! The disk is uninitialized\n"); + return -1; + } + if (disk_init()) { + DEBUGF("*** Failed reading partitions\n"); + return -1; + } + + if(fat_mount(&bpb,part[0].start)) { + DEBUGF("*** Failed mounting fat\n"); + } + + dbg_console(&bpb); + return 0; +} + |