Learn to write your first OS kernel

栏目: IT技术 · 发布时间: 5年前

内容简介:This is a minimalist kernel which prints "GRUB requires your kernel executable to be of the pattern

mkernel

This is a minimalist kernel which prints " my first kernel " on the screen and then hangs.

  • The kernel is multi-boot compliant and loads with GRUB.

Blog post

Kernel 101 – Let’s write a Kernel

Build commands

nasm -f elf32 kernel.asm -o kasm.o
gcc -m32 -c kernel.c -o kc.o
ld -m elf_i386 -T link.ld -o kernel kasm.o kc.o

Test on emulator

qemu-system-i386 -kernel kernel

Get to boot

GRUB requires your kernel executable to be of the pattern kernel-<version> .

So, rename the kernel:

mv kernel kernel-701

Copy it to your boot partition (assuming you are superuser):

cp kernel-701 /boot/kernel-701

Configure your grub/grub2 similar to what is given in _grub_grub2_config folder.

Reboot.

Voila!

Learn to write your first OS kernel

The next step

See mkeykernel repo


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Web开发权威指南

Web开发权威指南

[美] Chris Aquino,、[美] Todd Gandee / 奇舞团 / 人民邮电出版社 / 2017-9 / 99.00元

本书在知名培训机构Big Nerd Ranch 培训教材的基础上编写而成,囊括了JavaScript、HTML5、CSS3等现代前端开发人员急需的技术关键点,包括响应式UI、访问远程Web 服务、用Ember.js 构建应用,等等。此外,还会介绍如何使用前沿开发工具来调试和测试代码,并且充分利用Node.js 和各种开源的npm 模块的强大功能来进行开发。 全书分四部分,每部分独立完成一个项......一起来看看 《Web开发权威指南》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具