nergzd723 wrote:
I don't code on C well but I just want to do that. It's like challenge to me.
C is a very difficult language to learn correctly. Unlike many other languages, it has very little error detection. If you write bad code, the compiler may not warn you. If you're lucky, your program will crash to tell you you've made a mistake. If you're not, your program will appear to work fine - until it doesn't, and you have no idea why.
Trying to learn C while developing an operating system will certainly be a challenge, but it may be wise to get some experience developing userspace programs in C first.
nergzd723 wrote:
But I saw something strange: before sti it WAS the GDT and IDT, and after it it just disappears. I think it is really strange. Maybe when CPU exception occurs, it resets the adresses of IDT and GDT? Cause BOCHS says that their base is the same.
A triple fault resets the CPU to its power-on defaults (
mostly). If you're looking at the GDTR/IDTR after the triple fault, that's why.
nergzd723 wrote:
Then,enabling line A20 and entering Protected Mode is because I don't usually use GRUB and don't want to. I use direct multiboot kernel execution in QEMU.
QEMU loads your OS in protected mode with the A20 line already enabled, so you don't need code to switch to protected mode or enable A20.
Perhaps you should
read more about multiboot.
nergzd723 wrote:
And the last: why do QEMU don't stop on triple fault?
Ask the QEMU developers.