summaryrefslogtreecommitdiff
path: root/firmware/common/disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/disk.c')
-rw-r--r--firmware/common/disk.c43
1 files changed, 1 insertions, 42 deletions
diff --git a/firmware/common/disk.c b/firmware/common/disk.c
index f6b836cca8..4add5b99df 100644
--- a/firmware/common/disk.c
+++ b/firmware/common/disk.c
@@ -81,7 +81,6 @@ struct partinfo* disk_init(IF_MV_NONVOID(int drive))
81#endif 81#endif
82 82
83 ata_read_sectors(IF_MV2(drive,) 0,1, &sector); 83 ata_read_sectors(IF_MV2(drive,) 0,1, &sector);
84#ifndef CREATIVE_ZVx
85 /* check that the boot sector is initialized */ 84 /* check that the boot sector is initialized */
86 if ( (sector[510] != 0x55) || 85 if ( (sector[510] != 0x55) ||
87 (sector[511] != 0xaa)) { 86 (sector[511] != 0xaa)) {
@@ -104,46 +103,6 @@ struct partinfo* disk_init(IF_MV_NONVOID(int drive))
104 /* not handled yet */ 103 /* not handled yet */
105 } 104 }
106 } 105 }
107#else
108 struct partition_struct
109 {
110 unsigned int end;
111 unsigned int start;
112 char name[8];
113 };
114 struct hdd_struct
115 {
116 unsigned char MBLK[4];
117 int sector_size;
118 long long total_disk_size;
119 struct partition_struct partitions[4];
120 };
121 struct hdd_struct* hdd_struct = (struct hdd_struct*)sector;
122
123 if(hdd_struct->MBLK[0] != 0x4B ||
124 hdd_struct->MBLK[1] != 0x4C ||
125 hdd_struct->MBLK[2] != 0x42 ||
126 hdd_struct->MBLK[3] != 0x4D) /* 0x4B4C424D = KLBM */
127 {
128 DEBUGF("Bad boot sector signature\n");
129 return NULL;
130 }
131 else
132 {
133 /* parse partitions */
134 for ( i=0; i<4; i++ ) {
135 if(hdd_struct->partitions[i].name[0] != 0)
136 {
137 pinfo[i].type = ( strcmp(hdd_struct->partitions[i].name, "cfs") == 0 ? PARTITION_TYPE_FAT32_LBA : 0);
138 pinfo[i].start = hdd_struct->partitions[i].start;
139 pinfo[i].size = (hdd_struct->partitions[i].end - hdd_struct->partitions[i].start);
140
141 DEBUGF("Part%d: Type %02x, start: %08lx size: %08lx\n",
142 i,pinfo[i].type,pinfo[i].start,pinfo[i].size);
143 }
144 }
145 }
146#endif
147 return pinfo; 106 return pinfo;
148} 107}
149 108
@@ -200,7 +159,7 @@ int disk_mount(int drive)
200 { 159 {
201 return 0; 160 return 0;
202 } 161 }
203#if defined(TOSHIBA_GIGABEAT_S) || defined(CREATIVE_ZVx) 162#if defined(TOSHIBA_GIGABEAT_S)
204 int i = 1; /* For the Gigabeat S, we mount the second partition */ 163 int i = 1; /* For the Gigabeat S, we mount the second partition */
205#else 164#else
206 int i = 0; 165 int i = 0;