barebox large disk problem
Hi!
I'm trying to use ST2000DM006-2DM164 SATA 2000 GB hard disk with barebox. This disk has 3907029168 sectors.
Alas barebox uses 32-bit signed integer to store disk sector count (int num_blocks from struct block_device, see include/block.h for details) and hereby the ST2000DM006 disk is too large for barebox.
I'm planning to increase block_device.num_block size from 32bit to 64bit. But changing struct block_device may have some unobvious drawbacks and I can't test all block_device usage situations (e.g. EFI).
Any suggestions?
Signature · 7 lines
Best regards, Antony Pavlov _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 9 lines · Antony Pavlov
Hi!
I'm trying to use ST2000DM006-2DM164 SATA 2000 GB hard disk with barebox. This disk has 3907029168 sectors.
Alas barebox uses 32-bit signed integer to store disk sector count (int
num_blocksfrom structblock_device, seeinclude/block.hfor details) and hereby the ST2000DM006 disk is too large for barebox.
Quoted 5 lines
I'm planning to increase block_device.num_block size from 32bit to 64bit. But changing struct
block_devicemay have some unobvious drawbacks and I can't test allblock_deviceusage situations (e.g. EFI).Any suggestions?
You do the change and send it to the list, we'll review it carefully ;)
In case of EFI I assume you mean the efi-block-io driver. Here EFI internally works with 64bit variables anyway which we narrow down to 32bit for barebox. Using the 64bit variables instead shouldn't have any undesired side effects.
It could be that some architectures lack some 64bit modulo or div operations, but we'll notice that in the compile test.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox