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

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
VSlezak
Member
Member
Posts: 314
Joined: Sat Mar 10, 2018 10:16 am

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

Post by VSlezak »

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?
Last edited by VSlezak on Tue Sep 04, 2018 10:29 am, edited 1 time in total.
MichaelPetch
Member
Member
Posts: 829
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

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

Post 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).
VSlezak
Member
Member
Posts: 314
Joined: Sat Mar 10, 2018 10:16 am

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

Post by VSlezak »

os.img is my bootloader with size 113 bytes.
MichaelPetch
Member
Member
Posts: 829
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

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

Post 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.
VSlezak
Member
Member
Posts: 314
Joined: Sat Mar 10, 2018 10:16 am

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

Post by VSlezak »

Very thanks, it works perfectly!
Post Reply