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"
Building
Re: Building
Or the fact that you're overwriting the floppy's first sector with your own bootloader - but the first sector contains information necessary for the filesystem to work at all.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Building
That's only going to be a problem if the bootsector lacks the correct filesystem data (which in this case it probably does: it mounts but acts broken afterwards; I don't expect someone to be stupid enough to actually try and add a >1.44M stage 2). After all your FAT-compatible bootloader has to be filesystem-aware so you probably end up including all the labels for the superblock's data anyway.immibis wrote:Or the fact that you're overwriting the floppy's first sector with your own bootloader - but the first sector contains information necessary for the filesystem to work at all.