Reputation: 1078
I am studying about the Operating System concepts. I created a simple boot loader and a second stage loader in assembly. I'm new to Linux, so I don't know how to emulate it. I went through a lot of sites, but couldn't find a perfect explanation.
So, How would I use dd tool and qemu to emulate boot.asm and load.asm files in emulator and how would I do the same into an USB and boot it in a real machine?
Please guide me so that I will catch it up..
OS : Ubuntu 16.04.1 Assembly : 8086 assembly
Upvotes: 1
Views: 2526
Reputation: 145
That '.img' file is container which contains required binaries, e.g. '[bootloader][kernel][dtb]'. With 'dd' you can create such container.
Another word, you can merge all this required files into one, e.g. 'boot.img' with offsets which you pointed out. Also all offsets need declare in header file for your bootloader. After 'boot.img' will be successfully created, you can pass it through option '-bios' (emulated rom) into qemu.
Qemu will start execute this file from 0x0 offset - it is your bootloader. You bootloader will copy kernel into RAM and will pass execution to your kernel.
Upvotes: 1