Thank you for replying!!! I thought so when it came to the section .data, section .text. I figured once you were experienced enough you would know when to omit parts like that. I have seen a lot of code without the sections part so I had to ask lol. Thought i was misunderstanding something.
As far as the bootloader, I have a question on that process.
I am following the
http://www.brokenthorn.com/Resources/OSDevIndex.html tutorial, using virtualbox, and ubuntu as a subsystem. The tools they use in that tutorial are outdated and I am having trouble understanding the connection between our files, the tools, and virtualbox.
The problem that I am having is the second stage isn't loading up properly. It shows in virtualbox that the first stage is loaded up but the second file isn't. So I want to get some clarification on how the process works.
I understand that in our first stage
boot.asm we are limited to 512, which gets written into the first sector of a floppy image
disk.img.
bash -c "nasm -f bin boot.asm -o boot.bin"
bash -c "dd if=boot.bin of=disk.img conv=notrunc"
I understand that because we are limited, we need to use that limited space in the first sector, to call the second stage
KRNLDR.SYS. In
boot.asm we wrote the functions/routines for a fat12 file system and
KRNLDR.SYS is the fat12 filename that we are trying to get or need to call.
bash -c "nasm -f bin Stage2.asm -o KRNLDR.SYS"
copy KRNLDR.SYS A:\KRNLDR.SYS
my first question: If we mount the disk.img with imdisk.
imdisk -a -f disk.img -s 1440K -m A:
Once we run this new drive, does it becomes our fat12 directory?
meaning that we created a drive, mounted the disk.img to it, and now
the memory that we allocated for this drive is the memory being used
for our fat12?
If so then after the drive is created, we now have our created file system that
we can copy KRNLDR.SYS into? finally putting us in the position to get the fat12 file at runtime by stage one?
I feel like that seems right and would take care of my second stage problem.
The second question: Since we have mounted the disk.img onto the drive.
How does virtualbox also connect to that same disk.img file being used
by the drive? We can not use drives as a booting format in virtualbox,
only .img, .flp, .iso file types. So do we have to create a batch that
allows virtualbox to run the disk.img first, takes the first stage
steps, transfer ownership or connects the image to the drive some how,
so that we can finally have a file system to call the second stage from.
I feel like I am really over thinking this step.
The batch file I have so far:
bash -c "nasm -f bin boot.asm -o boot.bin"
bash -c "dd if=boot.bin of=disk.img conv=notrunc"
imdisk -a -f disk.img -s 1440K -m A:
bash -c "nasm -f bin Stage2.asm -o KRNLDR.SYS"
copy KRNLDR.SYS A:\KRNLDR.SYS
When I was using a single boot, it was no problem, to just use the
disk.img straight from the directory that it was created from and not mounting a drive. but now, based off if question is true, then the drive is required for a two step boot loading process to work properly. Any help would be much appreciated!!!