Page 1 of 1

Size of boot image is 4 sectors -> genisoimage[solved]

Posted: Mon Sep 03, 2018 12:45 pm
by Klakap
Good day,
I wanted to do make .iso file with genisoimage. My bootloader has a size of 113 bytes(it is not yet completely finished), but genisoimage gives me the error
Size of boot image is 4 sectors -> genisoimage: Error - boot image 'images/os. img' has not an allowable size.
Please what should I do?

Re: Size of boot image is 4 sectors -> genisoimage: Error

Posted: Mon Sep 03, 2018 2:27 pm
by MichaelPetch
what is the size of os.img ? It should be the size of a floppy (ie 1440*1024=1474560 bytes would be a 1.44MB).

Re: Size of boot image is 4 sectors -> genisoimage: Error

Posted: Tue Sep 04, 2018 7:12 am
by Klakap
os.img is my bootloader with size 113 bytes.

Re: Size of boot image is 4 sectors -> genisoimage: Error

Posted: Tue Sep 04, 2018 10:18 am
by MichaelPetch
That is why. Your OS iage has to be the size of an established disk size. Try placing your kernel binary file inside a file that is the size of a 1.44MB disk image.You can do that with DD:

Code: Select all

dd if=/dev/zero of=os.img bs=1024 count=1440
dd if=kernel.bin of=os.img conv=notrunc seek=0
The first command creates an image file (os.img) the size of a 1.44MB floppy (1474560 bytes).The second command takes the name of your binary kernel (kernel.bin is whatever name you used to save your binary kernel file as) and places it starting at the beginning of the image without truncating the image file. This should produce a disk with your kernel inside what appears to be a 1.44MB disk image.

Re: Size of boot image is 4 sectors -> genisoimage: Error

Posted: Tue Sep 04, 2018 10:28 am
by Klakap
Very thanks, it works perfectly!