Linux kernel series -12.a. Operating system development from loader to kernel

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.