Learn to write a simple OS kernel with keyboard/screen support (2014)

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

内容简介:This is a kernel that can read the charactersSee the repo

mkeykernel

This is a kernel that can read the characters a-z and 0-9 from the keyboard and print them on screen.

See the repo mkernel which is a minimal kernel that prints a string on the screen. mkeykernel just extends this to include keyboard support.

Blog post

Kernel 201 - Let’s write a Kernel with keyboard and screen support

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

If you get the following error message:

kc.o: In function `idt_init':
kernel.c:(.text+0x129): undefined reference to `__stack_chk_fail'

compile with the -fno-stack-protector option:

gcc -fno-stack-protector -m32 -c kernel.c -o bin/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 of mkernel repo .

Reboot.

Voila!

Learn to write a simple OS kernel with keyboard/screen support (2014)


以上所述就是小编给大家介绍的《Learn to write a simple OS kernel with keyboard/screen support (2014)》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

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

HTML和XHTML权威指南(第五版)

HTML和XHTML权威指南(第五版)

Chuck Musciano、Bill Kennedy / 技桥 / 清华大学出版社 / 2004-6-1 / 72.00元

HTML!XHTML!级联样式表!编写网页的标准很难整理,因为各种版本的Netscape和Internet Explorer在其实现方式上千差万别。《HTML与XHTML权威指南》将这些标准全部介绍给了读者。本书作者找出了各种标准和浏览器特性,并在创建网页方面为读者提出了很多建议,以便能够被更广泛的浏览者和平台所接受。 学习HTML或XHTML和学习其他任何语言一样。大部分学生都是从......一起来看看 《HTML和XHTML权威指南(第五版)》 这本书的介绍吧!

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

Base64 编码/解码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

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

HSV CMYK互换工具