Tutorial MyMC PS2 Memory Card Utility
#1
Music 
mymc PS2 Memory Card Utility



mymc is a public domain utility for working with PlayStation 2 memory card images (.ps2) as used by the PlayStation 2 emulator PCSX2.

It allows save files in the MAX Drive (.max), EMS (.psu), SharkPort (.sps), X-Port (.xps) and Code Breaker (.cbs) formats to be imported directly into these images. It can also export save files in eiter the MAX Drive and EMS formats. See the README.txt file included in the distribution below for more details.

[Image: MyMC.png]

PlayStation 2 Memory Card File System
PlayStation 2 memory cards. It's based on the research I did while writing mymc, a utility for working with PS2 memory card images.

NAND Flash Memory Basics

Since PlayStation 2 (PS2) memory cards use NAND Flash it's helpful to understand some of the basics about this kind of memory works. Flash is a non-volatile form of memory that can be electrically erased and reprogrammed. Since it's non-volatile, meaning it doesn't need power to retain data, and reprogramable, meaning the data stored can be changed, it's the ideal form memory to use in memory card. However, flash memory does have number of limitations which affect how the PS2 uses its memory cards.

Glossary
A number of terms are used in this document that you may not familiar with or are different from other sources describing PS2 memory cards, so I've created short glossary.

block: See "erase block".
cluster: The unit of allocation used in the file system. A cluster is one or more pages in size.
ECC: Error correcting code. A means of encoding data so that random bit errors can be detected and corrected.
erase block: The basic erasable unit on a memory card.
half: A two byte unsigned half-word value.
page: The basic addressable unit on a memory card. Corresponds to page on the flash device used in the memory card, and is analogous to a sector on hard disk.
programming: The operation of changing erased bits on a flash device from 1 to 0.
superblock: The first page on the memory card where important information about the structure of the file system is kept.
word: A four byte unsigned word value.

File System Organization
The PS2 memory card file system has a fairly simple design, with some allowances made for the limitations of flash memory. Its overall structure is similar to the well known MS-DOS FAT file system. It uses a file allocation table (FAT) to keep track of allocated space and a hierarchical directory system where all of a file's metadata is stored in its directory entry. Like the FAT file system, which groups disk sectors into clusters, the PS2 memory card file system groups flash memory pages in to clusters. On standard PS2 memory cards, the cluster size 1024 bytes, or 2 pages long.

Standard Memory Card Layout:
[Image: PlayStation_2_MemoryCard_File_System.jpeg]


The Superblock

The key to the PS2 memory card file system is the superblock. Located in the first page of the memory, this is the only part of the file system with a fixed location. While some things like the do end up in fixed locations on standard 8M memory cards, you shouldn't rely on this.
Most of the fields in the superblock should be self-explanatory. The fields page_len, pages_per_cluster, pages_per_block, and clusters_per_card define the basic geometry of the file system. The FAT can be accessed using ifc_list and rootdir_cluster gives the first cluster of the root directory. Cluster offsets in FAT and directory entries are all relative to alloc_offset
File systems ment to be compatible with the PS2's memory card drivers have a fairly restricted set of geometry options. The field page_size can be either 512 or 1024. If the page size is 512 then pages_per_cluster can either be 1 or 2, otherwise it can only be 1. The limit on pages_per_block is 16. There doesn't seem to be any upper limit on clusters_per_card, however because of the size of ifc_list there can be no more than 8,388,608 allocatable clusters. While the clusters the make up the FAT can be located anywhere, the value of rootdir_cluster must be 0, indicating that the first allocatable cluster is the first cluster of the root directory.

[Image: PlayStation%202%20Memory%20Card%20File%20System_.png]

Referencia:
- mymc - PS2 Memory Card Image

:gallog:  :bravo:  :tzaritza:  :aikido:  :rally:  :yoshi:
Winning Eleven & ProEvolutionSoccer & FIFA EA Sports |Option Files|
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)