summaryrefslogtreecommitdiffstats
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.tar.bz2
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)
return -1;
}
+ /* Defaults */
+ ipod->num_heads = 0;
+ ipod->sectors_per_track = 0;
+
if (!DeviceIoControl(ipod->dh,
IOCTL_DISK_GET_DRIVE_GEOMETRY_EX,
NULL,
@@ -105,10 +109,14 @@ int ipod_open(struct ipod_t* ipod, int silent)
if (!silent) print_error(" Error reading disk geometry: ");
return -1;
} else {
- ipod->sector_size=diskgeometry.BytesPerSector;
+ ipod->sector_size = diskgeometry.BytesPerSector;
+ ipod->num_heads = diskgeometry.TracksPerCylinder;
+ ipod->sectors_per_track = diskgeometry.SectorsPerTrack;
}
} else {
- ipod->sector_size=diskgeometry_ex.Geometry.BytesPerSector;
+ ipod->sector_size = diskgeometry_ex.Geometry.BytesPerSector;
+ ipod->num_heads = diskgeometry_ex.Geometry.TracksPerCylinder;
+ ipod->sectors_per_track = diskgeometry_ex.Geometry.SectorsPerTrack;
}
return 0;