Page 1 of 1

Problem copying to FAT12 in Linux

Posted: Thu Jan 14, 2010 11:53 am
by overburn
I havbe been doing the brokenthorn tutorials and i have reached the bootloader 4 one.
everything compiles, however i have a small problem.
i use a floppy.img , due to a lack of physical floppy on my notebook.
When i try to mount the floppy.img resulting from writing the stage1 bootloader to the floppy , it works.
however, when i try to copy the stage 2 loader onto the floppy, i get this error:

Code: Select all

cp: cannot create regular file `Floppy/krnload.sys': No space left on device
could anyone give me an idea? (except switch to windows)

Re: Problem copying to FAT12 in Linux

Posted: Thu Jan 14, 2010 12:37 pm
by XanClic
I think I got that type of error, when I created an image with "dd if=/dev/zero of=floppy.img bs=512 count=2880" (or whatever) and then copied the bootloader to it with "dd if=boot.bin of=floppy.img bs=512 count=1", because the last command shrinks the image to 512 Bytes again (truncates it).

You have to do it that way:

Code: Select all

dd if=boot.bin of=floppy.img bs=512 count=1
dd if=/dev/zero of=floppy.img bs=512 count=2879 seek=1
The last command simply skips the boot sector and creates you an image with a size of 1474560 bytes.

Hope that helps.