can anybody explain the functionality behind file_to_sectors? what is it supposed to do and how?
I'd like to see how it could be implemented for exfat.
thanks
That is the function used by prepNTFS to allow backup managers see the ISOs as native files.
prepNTFS or IRISMAN call that function for every ISO scanned or processed by selection in the case of IRISMAN.
The function file_to_sectors generate 2 lists: one is the list with the address of the initial raw sectors for each segment of the ISO file passed as parameter, the other is a list with the size of each segment (consecutive raw sectors).
If the ISO is multi-part, the lists of each multi-part file are appended to the initial lists.
Then the application creates a config file with a header containing the parameters needed by "rawseciso" plugin to access the storage in raw mode and the list of raw sectors and size of segments file needed to read the whole ISO file. The config file is stored in a native file system for later use.
For these ISO stored in non-standard file systems (ntfs, ext3) the backup manager read these config files and list them as "ISO files" stored in ntfs/ext3. For instance: /dev_hdd0/tmp/wmtmp/My Game.iso.ntfs[PS3ISO] is displayed as /ntfs0:/PS3ISO/My Game.iso
When the user mounts one of these ISO files, the backup manager starts the rawseciso plugin and passes the data of config file as parameter. The rawseciso plugin acts as intermediary between Cobra and the storage device. It starts the discfile_proxy in Cobra and rawseciso plugin emulates the physical disc serving the sectors requested by the SCSI driver via Cobra's proxy.
A retail game is accessed from disc (more or less) like this:
Game <=> GameOS <=> SCSI <=> bluray driver <=> raw sectors
An ISO file stored in a standard file system (hdd0/fat32) is accessed like this:
Game <=> GameOS <=> SCSI <=> Cobra <=> cell file system <=> file data
An ISO file stored in a non-standard file system (ntfs/ext3) is accessed like this:
Game <=> GameOS <=> SCSI <=> Cobra <=> discfile_proxy <=> rawseciso plugin <=> storage device <=> raw sectors
A remote ISO is accessed like this:
Game <=> GameOS <=> SCSI <=> Cobra <=> discfile_proxy <=> netiso plugin <=> net <=> ps3netsrv <=> file system <=> file data