Loader to do two things, let's start with the first item, load the kernel into memory:
1. Load the kernel into memory.
2. Jump into protected mode.
When you first compile a no-kernel:
NASM Boot.asm-o Boot.bin
NASM Loader.asm-o Loader.bin
DD if=boot.bin of=a.img bs=512 count=1 conv=notrunc
sudo mount-o loop a.img/mnt/hgfs/
sudo cp loader.bin/mnt/hgfs/-V
sudo umount/mnt/hgfs/
The results of the operation are as follows:
Next, compile the kernel and write it to the floppy image:
Nasm-f Elf-o KERNEL.O kernel.asm
Ld-m elf_i386-s-o kernel.bin kernel.o
sudo mount-o loop a.img/mnt/hgfs/
sudo cp kernel.bin/mnt/hgfs/-V
sudo umount/mnt/hgfs/
The results of the operation are as follows:
No longer "no KERNEL", we see that a dot appears behind the loading, indicating that loader read a sector. However, we do not have any other work to do except load the kernel into memory, so we can see "ready." , no other phenomenon arises.
" Source "
Linux kernel series -12.a. Operating system development from loader to kernel