Putting multiple files in one image?
-
theelitenoob
- Posts: 16
- Joined: Wed Aug 24, 2011 11:19 am
Putting multiple files in one image?
Hey, So I got my bootloader working, and a simple kernel file, with just printing "Hello, World!". But my problem is how do i create a single image file? For example I have a bootloader.bin file, would i link it with a kernel.o object file then use dd to make it into a single bootable image. Or is there a different way to compile my project into one bootable file?
Re: Putting multiple files in one image?
You sure are an elite.
Google search it. You may find something like "Winimage"
Google search it. You may find something like "Winimage"
- Brynet-Inc
- Member

- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: Putting multiple files in one image?
You're not exactly all that clever yourself, GhostXoPCorp.VolTeK wrote:You sure are an elite.
-
theelitenoob
- Posts: 16
- Joined: Wed Aug 24, 2011 11:19 am
Re: Putting multiple files in one image?
I know that, How would i put it all into one file, like a .bin or something.VolTeK wrote:You sure are an elite.
Google search it. You may find something like "Winimage"
Like, linking my project into a final file, like my bootloader and my kernel and so on.
Re: Putting multiple files in one image?
You don't link the bootloader to the kernel. I'm guessing you do not use any filesystem and just wants to load the sectors right after the bootsector as your kernel, in that case you can just merge the files to an "image" with DOS command copy - scroll down to see usage example here:
http://ask-leo.com/how_can_i_rejoin_two ... o_one.html
http://ask-leo.com/how_can_i_rejoin_two ... o_one.html
Re: Putting multiple files in one image?
Stay on topic with your posts.Brynet-Inc wrote:You're not exactly all that clever yourself, GhostXoPCorp.
-
theelitenoob
- Posts: 16
- Joined: Wed Aug 24, 2011 11:19 am
Re: Putting multiple files in one image?
Oh, ok, so if i compile into separate binaries, (.bins) then write them to an image, placing one after another, it would work?bubach wrote:You don't link the bootloader to the kernel. I'm guessing you do not use any filesystem and just wants to load the sectors right after the bootsector as your kernel, in that case you can just merge the files to an "image" with DOS command copy - scroll down to see usage example here:
http://ask-leo.com/how_can_i_rejoin_two ... o_one.html
Re: Putting multiple files in one image?
if you're trying to do what i think you are, then yes. but you might as well just write them to disk (or mounted img file) one after eachother instead of combining them first - unless you are using the resulting file itself as the image? (might need padding to 1.44mb for that to work)
Either way you must have code in the bootsector to read in the next part (sectors) to memory and jump to it, just putting it together as one file won't work by itself - just in case you didn't know.
For creating and mounting an image file in windows i suggest using imDisk:
http://www.ltr-data.se/opencode.html/#ImDisk
For writing the bootsector (and kernel right after it) - PartCopy:
http://asmhackers.net/geezer/johnfine/pcopy02.zip
Usage for bootsector to mounted drive a:
partcopy boot.bin 0 200 -f0
Syntax:
filename - offset on disk in hex - bytes to write in hex - drive to write to
for a 1kb kernel after the bootsector that would be "partcopy kernel.bin 200 400 -f0"
starting at hex 200 (512 byte) writing hex 400 (1024 byte)
Either way you must have code in the bootsector to read in the next part (sectors) to memory and jump to it, just putting it together as one file won't work by itself - just in case you didn't know.
For creating and mounting an image file in windows i suggest using imDisk:
http://www.ltr-data.se/opencode.html/#ImDisk
For writing the bootsector (and kernel right after it) - PartCopy:
http://asmhackers.net/geezer/johnfine/pcopy02.zip
Usage for bootsector to mounted drive a:
partcopy boot.bin 0 200 -f0
Syntax:
filename - offset on disk in hex - bytes to write in hex - drive to write to
for a 1kb kernel after the bootsector that would be "partcopy kernel.bin 200 400 -f0"
starting at hex 200 (512 byte) writing hex 400 (1024 byte)
-
theelitenoob
- Posts: 16
- Joined: Wed Aug 24, 2011 11:19 am
Re: Putting multiple files in one image?
Oh, i know about jumping to the sectors after it, and thanks for the partcopy and imDisk links, i understand now, thank you!bubach wrote:if you're trying to do what i think you are, then yes. but you might as well just write them to disk (or mounted img file) one after eachother instead of combining them first - unless you are using the resulting file itself as the image? (might need padding to 1.44mb for that to work)
Either way you must have code in the bootsector to read in the next part (sectors) to memory and jump to it, just putting it together as one file won't work by itself - just in case you didn't know.
For creating and mounting an image file in windows i suggest using imDisk:
http://www.ltr-data.se/opencode.html/#ImDisk
For writing the bootsector (and kernel right after it) - PartCopy:
http://asmhackers.net/geezer/johnfine/pcopy02.zip
Usage for bootsector to mounted drive a:
partcopy boot.bin 0 200 -f0
Syntax:
filename - offset on disk in hex - bytes to write in hex - drive to write to
for a 1kb kernel after the bootsector that would be "partcopy kernel.bin 200 400 -f0"
starting at hex 200 (512 byte) writing hex 400 (1024 byte)

