Problem copying to FAT12 in Linux

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
User avatar
overburn
Member
Member
Posts: 50
Joined: Sun Feb 22, 2009 9:15 am

Problem copying to FAT12 in Linux

Post 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)
One Tequila, Two Tequila, Three Tequila, Floor!
User avatar
XanClic
Member
Member
Posts: 138
Joined: Wed Feb 13, 2008 9:38 am

Re: Problem copying to FAT12 in Linux

Post 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.
Post Reply