Building
Posted: Sun Aug 14, 2011 4:29 pm
Hi,
I'm Jackson and I'm building a bootloader I've finished Stage1 and trying to load Stage2 of my bootloader but, I can't build the thing to test it. I'm using Linux so I'm using dd and the loopback device. I've seen the page on OSdev on it but every time I try it says the loopback device is busy or it says Sizes don't match. Then I tried the build(shell script) file below but, it always says "cp: cannot create regular file `tmp-loop/KRNLDR.SYS': No space left on device" the code is below. What's wrong?
if test "`whoami`" != "root" ; then
echo "You must be logged in as root to build"
echo "Enter su or sudo bash to switch to root"
exit
fi
if [ ! -e coppingos.flp]
then
echo "Making Floppy..."
mkdosfs -C MyOS/MyOS.flp 1440 || exit
fi
echo "Compiling Files..."
nasm MyOS/Stage2.asm -o MyOS/KRNLDR.SYS
nasm MyOS/Stage1.asm -o MyOS/Stage1.bin
echo "Copying bootloader to floppy..."
dd status=noxfer conv=notrunc if=MyOS/Stage1.bin of=MyOS/MyOS.flp || exit
echo "Copying Kernel and files to floppy..."
rm -rf tmp-loop
mkdir tmp-loop && mount -o loop -t vfat MyOS/MyOS.flp tmp-loop && cp MyOS/KRNLDR.SYS tmp-loop
echo "Unmounting loopback floppy"
umount tmp-loop || exit
rm -rf tmp-loop
echo "Done"
I'm Jackson and I'm building a bootloader I've finished Stage1 and trying to load Stage2 of my bootloader but, I can't build the thing to test it. I'm using Linux so I'm using dd and the loopback device. I've seen the page on OSdev on it but every time I try it says the loopback device is busy or it says Sizes don't match. Then I tried the build(shell script) file below but, it always says "cp: cannot create regular file `tmp-loop/KRNLDR.SYS': No space left on device" the code is below. What's wrong?
if test "`whoami`" != "root" ; then
echo "You must be logged in as root to build"
echo "Enter su or sudo bash to switch to root"
exit
fi
if [ ! -e coppingos.flp]
then
echo "Making Floppy..."
mkdosfs -C MyOS/MyOS.flp 1440 || exit
fi
echo "Compiling Files..."
nasm MyOS/Stage2.asm -o MyOS/KRNLDR.SYS
nasm MyOS/Stage1.asm -o MyOS/Stage1.bin
echo "Copying bootloader to floppy..."
dd status=noxfer conv=notrunc if=MyOS/Stage1.bin of=MyOS/MyOS.flp || exit
echo "Copying Kernel and files to floppy..."
rm -rf tmp-loop
mkdir tmp-loop && mount -o loop -t vfat MyOS/MyOS.flp tmp-loop && cp MyOS/KRNLDR.SYS tmp-loop
echo "Unmounting loopback floppy"
umount tmp-loop || exit
rm -rf tmp-loop
echo "Done"