vmlemon / Orion

Next-generation, L4Ka::Pistachio-based operating system
7 stars 0 forks source link

Support for UNIX Fast File System v2 #8

Open vmlemon opened 5 years ago

vmlemon commented 5 years ago

As part of adding support for the PS3, it may be useful to add support for reading CellOS partitions, in UNIX-FFS2 format, as implemented by NetBSD, and FreeBSD.

According to the "file" utility, the partitions have the following configuration, on a PS3: Part2_1.img: Unix Fast File system [v2] (big-endian) last mounted on /cell_mw_cfs, last written at Fri Aug 16 02:25:01 2019, clean flag 0, readonly flag 0, number of blocks 18947858, number of data blocks 18351596, number of cylinder groups 257, block size 16384, fragment size 4096, average file size 16384, average number of files in dir 64, pending blocks to free 0, pending inodes to free 0, system-wide uuid 0, minimum percentage of free blocks 8, TIME optimization

The wiki pages at https://www.psdevwiki.com/ps3/HDD_Encryption, and https://www.psdevwiki.com/ps3/Mounting_HDD_on_PC document partially, the encryption mechanism used by the CellOS (there's also tool, for Windows NT family OSes, that runs under WINE, that can be used to decrypt disk images of PS3 HDDs, that I've used, against my own PS3's HDD), for future reference.

It would also be necessary to implement support for the PS3 partition table format, if we wanted to be able to run Orion on a PS3 (which would belong to a separate issue).

vmlemon commented 5 years ago

For what it's worth, CellOS seems to use the UFS implementation from NetBSD 0.9(!), judging from the strings in the hypervisor memory dumps that I could obtain, from my system, and https://unix.superglobalmegacorp.com/NetBSD-0.9/newsrc/ufs/ufs_inode.c.html (GitHub mirror at https://github.com/Engil/makefs/blob/master/src/sys/ufs/ufs/ufs_inode.c, too).

We should probably use a newer version, but I suspect that portability had a part to play, in their decision to use such ancient code...