Page 12 of 20

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 1:51 pm
by zap8600
Octocontrabass wrote: That's a triple fault. The QEMU interrupt log may be useful for finding the problem.
I have attached the log below.
Octocontrabass wrote: If you see this warning, your code is broken. Fix this warning before you try to debug anything.
I have fixed this issue.

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 2:12 pm
by Octocontrabass
Your IDT is invalid because this struct is wrong.

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 3:17 pm
by zap8600
Octocontrabass wrote:Your IDT is invalid because this struct is wrong.
What would be the correct way to write the struct? I'm using the one from here.

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 3:24 pm
by Octocontrabass
zap8600 wrote:I'm using the one from here.
Your struct does not match that struct.

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 3:44 pm
by zap8600
Octocontrabass wrote: Your struct does not match that struct.
I need to modify ist to be uint8_t and zero to be uint32_t, I believe. I've done that, but it still isn't working.

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 3:48 pm
by Octocontrabass
Does it change the exceptions that lead up to the triple fault?

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 4:10 pm
by zap8600
Octocontrabass wrote:Does it change the exceptions that lead up to the triple fault?
I believe you are taking about the check_exceptions. No, it doesn't.

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 4:34 pm
by Octocontrabass
In that case, there are probably other IDT issues.

What is the significance of the first parameter to idt_set_gate?

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 4:58 pm
by zap8600
Octocontrabass wrote:In that case, there are probably other IDT issues.

What is the significance of the first parameter to idt_set_gate?
I had forgotten about that argument. It was for writing the data to that IDT entry. I've fixed it, but the exceptions haven't changed.

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 5:09 pm
by Octocontrabass
Has anything in the interrupt log changed?

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 5:26 pm
by zap8600
Octocontrabass wrote:Has anything in the interrupt log changed?
Some things have changed. I put the log from an earlier test and the most recent log through diff. I don't think much changes, though. I'll attach the most recent QEMU log and the diff log.
diff.txt
(3.02 KiB) Downloaded 96 times
qemu2.txt
(22.31 KiB) Downloaded 64 times

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 5:37 pm
by devc1
Reply for need more explanation (Compiling in Windows is easier):

Well, for all the kernel, the drivers and libraries, this is my command line :

Code: Select all

%COMPILE% %srcfiles% %OBJFILES% /Fo:x86_64/ %CFLAGS% /Fe:oskrnlx64.exe /LD /link /OPT:LBR,REF /DLL /MACHINE:x64 /NODEFAULTLIB /SUBSYSTEM:native /ENTRY:KrnlEntry /FIXED:no /DYNAMICBASE /LARGEADDRESSAWARE
I don't have to makefile, linker.ld and all this complicated stuff.

UEFI is just like a library, you can type any function you need at google and it will show, everything is easily setup.


Hey, do you still have the compiling issues ?

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 5:39 pm
by Octocontrabass

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 5:48 pm
by zap8600
Octocontrabass wrote:

Code: Select all

     1: v=0d e=0008
The error code has changed. This error code indicates a problem loading a segment descriptor from the GDT.

Maybe the selector in your IDT doesn't correspond to a valid code segment in your GDT. I don't see where or how your GDT is set up, though.
I was trying to use the GDT set up by Limine. Should I make my own GDT?

Re: How to make a GDT?

Posted: Thu Oct 27, 2022 5:59 pm
by Octocontrabass
Limine provides a GDT you can use temporarily. You'll need to set up your own GDT at some point, though.