summaryrefslogtreecommitdiff
path: root/rbutil/ipodpatcher/ipodio-win32.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-06-16 22:32:57 +0000
committerDave Chapman <dave@dchapman.com>2007-06-16 22:32:57 +0000
commit56780e3e417cb1b9d1d453592d58c988c8029c16 (patch)
tree78cf5d5ebb36348932bc7f425a107d838b656fe9 /rbutil/ipodpatcher/ipodio-win32.c
parent9e0dfa1a533206200d2fcc87113417d8676e8fd7 (diff)
downloadrockbox-56780e3e417cb1b9d1d453592d58c988c8029c16.tar.gz
rockbox-56780e3e417cb1b9d1d453592d58c988c8029c16.zip
Initial integration of a --format option, based on fat32format.exe. The main limitation is that it only works on disks with 512-byte sectors - it needs adapting to the 2048-byte sector ipods. It has only been tested on Linux and Mac OS X, with a 60GB ipod Color, but appears to work.... When this feature has been more widely tested, the intention is to add code to convert the information in an Apple Partition Map (which can currently be read by ipodpatcher) to a DOS partition table, and hence allow conversion of Macpods to Winpods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13643 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/ipodpatcher/ipodio-win32.c')
-rw-r--r--rbutil/ipodpatcher/ipodio-win32.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/rbutil/ipodpatcher/ipodio-win32.c b/rbutil/ipodpatcher/ipodio-win32.c
index 83f00b8cd9..342a06a358 100644
--- a/rbutil/ipodpatcher/ipodio-win32.c
+++ b/rbutil/ipodpatcher/ipodio-win32.c
@@ -86,6 +86,10 @@ int ipod_open(struct ipod_t* ipod, int silent)
86 return -1; 86 return -1;
87 } 87 }
88 88
89 /* Defaults */
90 ipod->num_heads = 0;
91 ipod->sectors_per_track = 0;
92
89 if (!DeviceIoControl(ipod->dh, 93 if (!DeviceIoControl(ipod->dh,
90 IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, 94 IOCTL_DISK_GET_DRIVE_GEOMETRY_EX,
91 NULL, 95 NULL,
@@ -105,10 +109,14 @@ int ipod_open(struct ipod_t* ipod, int silent)
105 if (!silent) print_error(" Error reading disk geometry: "); 109 if (!silent) print_error(" Error reading disk geometry: ");
106 return -1; 110 return -1;
107 } else { 111 } else {
108 ipod->sector_size=diskgeometry.BytesPerSector; 112 ipod->sector_size = diskgeometry.BytesPerSector;
113 ipod->num_heads = diskgeometry.TracksPerCylinder;
114 ipod->sectors_per_track = diskgeometry.SectorsPerTrack;
109 } 115 }
110 } else { 116 } else {
111 ipod->sector_size=diskgeometry_ex.Geometry.BytesPerSector; 117 ipod->sector_size = diskgeometry_ex.Geometry.BytesPerSector;
118 ipod->num_heads = diskgeometry_ex.Geometry.TracksPerCylinder;
119 ipod->sectors_per_track = diskgeometry_ex.Geometry.SectorsPerTrack;
112 } 120 }
113 121
114 return 0; 122 return 0;