mini-os | Mirror of the Xen MiniOS Git from git | Version Control System library
kandi X-RAY | mini-os Summary
kandi X-RAY | mini-os Summary
Mirror of the Xen MiniOS Git from git://xenbits.xen.org/mini-os.git
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 mini-os
mini-os Key Features
mini-os Examples and Code Snippets
Community Discussions
Trending Discussions on mini-os
QUESTION
So, I'm building a mini-OS using a PDF I found online. So far, I was making decent progress on the project, however the pdf has reached a concept it doesn't really explain well.
The reader is given four examples of storing a string at a register with the intention of printing it. The fourth example is where things become confusing. Using figure 3.6 below, we find out that the string is 30 bytes away from the offset at bit '1e'.
Now, I understand why we are at 0x7cXX as it is the offset of the boot sector. What I do NOT understand is how we know that it's last 2 bits are 1e.
What I think the answer is : Well, we store the offset 0x0e to the ah register, right? And the interrupt command is 0x10 which is the low order bit of ah. The thing is, that doesn't really explain why that makes such sweeping changes to the binary version of the program in figure 3.6, and I got that from my intuition rather than any salient logic.
Why do we know the string variable is at 0x7c1e?
...ANSWER
Answered 2020-Aug-31 at 19:43Using the label is the proper way to do this, as suggested in the comments. You also will have to tell the assembler what your origin point (org
) is to have it emit the correct address. Besides, you should initialise the data segment (ds
) register because your memory load uses it implicitly.
I am assuming you're using NASM because the times
directive is a NASMism. To fix your code and have it use a label like you should:
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 mini-os
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