Detecting partition size

How would a custom ROM hack support auto detecting partitions? For example, detecting whether the F: drive crosses the 137 GB boundary or instead uses G: for that part.

It'd be nice to make like a perfect BIOS that does everything. Maybe even support booting from any system type and autodetecting as needed.

Original thread: https://assemblergames.com/threads/detecting-partition-size.49670/