Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/ios27/SETTINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,28 @@ in the order above (the database file, which only `medialibraryd` or a writer ma
18 Nov).
- Settings > Bluetooth opens as a blank white page on 24B156 (it drew on 24A446). No Settings abort came with it (boot o272,
13:35). Not investigated.

## About > Capacity "0 KB" (18 November)

Seen on the 24B156 port: Settings > General > About shows **Capacity: 0 KB** (iPhone Storage asks the same question).

Where the number comes from (24B156's `AboutSettings.bundle`, `-[PSGAboutDataSource _loadValues]`, a single-user device):
`MGCopyAnswer("DiskUsage")[kMGQDiskUsageTotalDiskCapacity]`, rounded to whole GB and formatted decimal. The root image being HFSX
instead of APFS is not the cause: Available comes from `NSURLVolumeAvailableCapacityForImportantUsageKey` (statfs), and
`APFSVolumeGetSpaceInfo` is only called for a multi-user iPad.

libMobileGestalt's `NANDSize()` (strings "`SInt64 NANDSize(void)`", "`IOServiceGetMatchingService() for disk0 failed!`",
"`kIOMediaSizeKey`") takes TotalDiskCapacity from the IORegistry, not from the file system:

IOServiceGetMatchingService(kIOMasterPortDefault, IOBSDNameMatching(kIOMasterPortDefault, 0, "disk0"))
IORegistryEntryCreateCFProperty(entry, CFSTR("Size"), kCFAllocatorDefault, 0) -> CFNumber SInt64

The kernel has no IOStorageFamily, so no IOMedia and no `disk0` (`XNU-MICROSD.md` section 10): the lookup fails, NANDSize is -1, the answer
is 0. (`TotalDataCapacity` and the rest of `DiskUsage` are `statfs("/private/var")` and were not the problem. The MobileGestalt cache
that `94-camera` removes is not involved either: it only holds what the first boot computed.)

The change is in the kernel, `Scion-Project/xnu` pull request 64: `bsd/dev/herolte_ufs.c` records the LUN's size (the GPT's backup header
LBA + 1) when it finds the root partition and calls `sweet_media_publish()` (`iokit/Kernel/arm/SweetMedia.cpp`), which attaches a plain
IOService named `disk0` under the platform expert with `BSD Name` = `disk0`, `Size`, `Whole`, `Writable`, `Removable`. It is not an IOMedia
(DiskArbitration and IOStorage matching do not see it). A 64 GB S9 should show **64 GB**. The boot log has
`SWEET MEDIA: disk0 registered, Size <bytes>`. No root step is needed. Built, not yet run on a phone.
2 changes: 1 addition & 1 deletion profiles/ios-27.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ profile ios-27
xnu_commit ac9718fb1af618d5ce8678d0dc6e8a58f252216f
xnu_fork https://github.com/Scion-Project/xnu.git
fork_branch scion/xnu-12377
fork_commit f251408549e5e1063c29fc43faf20eca88a6f69e
fork_commit 5d485cfad6be117fefa7c8e34c36a45e7bb23b26
fork_copy profiles/ios-27.copy
fork_stage xnu/stage/00_setup_coreentitlements.sh
drivers none
Expand Down
Loading