pgimeno wrote: ↑Thu Jun 23, 2022 9:16 pmThat error means that the size of the file you created is not a multiple of 516096 bytes.jca wrote: ↑Thu Jun 23, 2022 8:14 pm It still does not work, running the command manually in the console gives:
ERROR: '/media/usb0/games/PCXT/hdd.img', file size does not match standard CHS geometry (x:16:63), please specify geometry explicitly with -g
I think someone mentioned having this error but it still worked for him. Should I try with a smaller disk, like 20MB?
The standard geometry it's talking about is x cylinders (x varies), 16 heads, 63 sectors per head. A sector is 512 bytes. Since the only parameter you can vary is the number of cylinders, the size must be an exact multiple of one cylinder, that is, of 16*63*512 = 516096 bytes; otherwise you have to specify a different geometry (cylinders, heads and sectors) with the -g parameter by editing the serdrive command in the script that mounts the disk.
You don't, its a computer, let it do all the hard work for you *see post below*jca wrote: ↑Thu Jun 23, 2022 9:39 pm This thing is driving me crazy:
On Github for serdrive I found default is a 32 MB disk, with CHS geometry 65:16:63.
I tried it but it did not work. After calculation it happens this is not 32MB but 33.54624MD.
My disk is 33,554,432 bytes, how do I calculate the damn thing?
Try c-style calculation, its easier:pgimeno wrote: ↑Thu Jun 23, 2022 9:49 pmWith Linux, try with:For a specific size, divide the required size in bytes by 516096 and round up to obtain the number of cylinders.Code: Select all
dd if=/dev/zero of=<target_name> bs=516096 count=<number_of_cylinders>
For example, for 20 MiB, that's 41 cylinders because 20*1024*1024/516096 = 40.63492...
Code: Select all
dd if=/dev/zero bs=$((16*63*512)) count=<number_of_cylinders> of=<target_name>
Nice, I'm holding off for a bit due to time constraints