Copying Bootsector + Kernel to Floppy

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
Warrior

Copying Bootsector + Kernel to Floppy

Post by Warrior »

Alright guys, I'm back. I've done alot since then and I have a boot loader which should load the second sector in a floppy and load it.
Alright so I make Kernel start at 0x1000 (it's in assembly still)

Alright to copy it to my floppy I try to following on part copy:

.\tools\partcopy .\boot\boot.bin 0 200 -f0
.\tools\partcopy .\kernel\kernel.bin 0 200 -f0 1

Since the boot loader is at the begining I dont need the one after it but shouldn't that but my kernel at the second sector?

So I'm minding my own buisness and I try to build and my batch file returns:

Failed to read source at offset 15

:(

Well I try to load the bootloader to the first and second sector
like this

.\tools\partcopy .\boot\boot.bin 0 200 -f0
.\tools\partcopy .\boot\boot.bin 0 200 -f0 1

and..IT WORKS. -.-

Of course I expect my BIOS to object to having two bootloaders but my question is why isn't it loading my kernel.bin :| .
Curufir

Re:Copying Bootsector + Kernel to Floppy

Post by Curufir »

My guess would be that your kernel.bin isn't actually 512 bytes long.

Adjust:
.\tools\partcopy .\kernel\kernel.bin 0 200 -f0 1
So that it reflects the actual length of your kernel.bin file.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:Copying Bootsector + Kernel to Floppy

Post by bubach »

USAGE:

PARTCOPY source source_offset length destination {destination_offset}
So it should be:
.\tools\partcopy .\kernel\kernel.bin 0 kernel-size -f0 200
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
Post Reply