mkeykernel | A kernel that can read from keyboard and print
kandi X-RAY | mkeykernel Summary
kandi X-RAY | mkeykernel Summary
A kernel that can read from keyboard and print on-screen
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mkeykernel
mkeykernel Key Features
mkeykernel Examples and Code Snippets
Community Discussions
Trending Discussions on mkeykernel
QUESTION
I've been reading a ton of tutorials about OS development on x86, and so far all has gone well - until now. I can't figure out what the solution is for the life of me.
My goal is to write the simplest possible keyboard driver for x86. Things work well with QEMU, but not with GRUB.
I did my best to emulate mkeykernel based on the article by Arjun Sreedharan. Unfortunately, this problem also exists for mkeykernel.
When running my compiled kernel using qemu-system-i386 -kernel kernel.bin
, everything works as expected: I type, and letters are displayed on the screen.
However, when I create and run a GRUB ISO using grub-mkrescue
, the system reboots whenever I hit a key.
When running with qemu-system-i386 -cdrom build/myos.iso -d int --no-reboot
, I was able to find out that the CPU exception is 0xd General Protection Fault. At first, I thought this was because the GDT was set in an unexpected way by GRUB. But as you'll see below, I added my own GDT and it did not fix the problem.
I also found a close match on StackOverflow here. I followed pretty much all of the advice in that article, especially the one about packing the structs, to no avail.
This is the first time I've ever been so stumped to the point that I wrote a StackOverflow question :) Hopefully someone will be able to see the issue here!
I have included the source code for all relevant files and instructions to build them / recreate the problem below.
First file: kernel.asm
ANSWER
Answered 2020-Jul-14 at 03:09The solution (thanks to @MichaelPetch) was to setup segment registers after loading the GDT. My new entry point:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mkeykernel
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page