Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I'm trying a few things with multiboot and I have built a small example that as far as I understand should work. Once the code is called at the start label I set the stack and then load a new GDT. After the GDT is loaded I do a far jump and update the rest of the segment registers. However, at the point of the far jump the virtual machine (qemu 0.14.1) resets and I can't figure out why. Does anyone have an idea on why this happens?
Had the same problem not so long ago I found that jumping to new segment cs:eip without having done a cache invalidation made cpu use old gdt data and that caused triplefault since no IDT was present during this time (boot).
It's not a bootloader and it's not NASM syntax. However the question for the actual class of bug is there:
Are you sure 'gdt' represents the linear address of your GDT ?
What's your linker script and other command line instructions?
.quad gdt
Should be .long for correctness. LGDT in 32-bit mode expects a 32-bit address. Not that it will fix your problem though.
Usually in the case of such a crash, the log produced by bochs will provide you with the exact cause of the error. Can you run your kernel under bochs and post the log if that doesn't make your problem obvious?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]