What do i put in gdt_start and idt_start?
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
What do i put in gdt_start and idt_start?
I'm trying to load the GDT/IDT using the same method as you would use in Assembly. However, i have no idea what to put in the gdt_start and idt_start sections (I need code this time, since i don't know what are the things that are usually put in there).
Can anyone help?
EDIT: I figured out the idt_start is the one in the struct in the IDT page (dw = uint16_t, db = uint8_t). Only need gdt_start
By "idt_end" and that, i mean:
In Assembly, you only can initialize the IDT or GDT with using lidt or lgdt [gdt_info]/[idt_info]. This needs (g/i)dt_start and (g/i)dt_end. I know what is the value of the _end, but not of the gdt_start one.
I'm trying to implement this in C/C++, however.
Can anyone help?
EDIT: I figured out the idt_start is the one in the struct in the IDT page (dw = uint16_t, db = uint8_t). Only need gdt_start
By "idt_end" and that, i mean:
In Assembly, you only can initialize the IDT or GDT with using lidt or lgdt [gdt_info]/[idt_info]. This needs (g/i)dt_start and (g/i)dt_end. I know what is the value of the _end, but not of the gdt_start one.
I'm trying to implement this in C/C++, however.
Last edited by NunoLava1998 on Mon Jan 02, 2017 3:42 pm, edited 1 time in total.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS
- moondeck
- Member
- Posts: 56
- Joined: Sat Dec 19, 2015 12:18 pm
- Libera.chat IRC: moondeck
- Location: The Zone, Chernobyl
Re: What do i put in gdt_start and idt_start?
What exactly are you talking about? gdt_start? idt_start? huh?
My operating system https://github.com/moondeck/hydrogen/
Re: What do i put in gdt_start and idt_start?
He is just copying code from http://wiki.osdev.org/LGDT without understanding it.
And as the comment there says, what you should put there is "Some GDT entries, like null, kernel code, kernel data, user code, user data, TSS..."
And as the comment there says, what you should put there is "Some GDT entries, like null, kernel code, kernel data, user code, user data, TSS..."
Re: What do i put in gdt_start and idt_start?
Please stop copy-pasting code like a parrot.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
- moondeck
- Member
- Posts: 56
- Joined: Sat Dec 19, 2015 12:18 pm
- Libera.chat IRC: moondeck
- Location: The Zone, Chernobyl
Re: What do i put in gdt_start and idt_start?
faith in humanity is lost
My operating system https://github.com/moondeck/hydrogen/
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
Re: What do i put in gdt_start and idt_start?
So? I don't know what those are. I implemented a big part of my IDT/GDT almost-complete loader, not copy pasting.Kevin wrote:He is just copying code from http://wiki.osdev.org/LGDT without understanding it.
And as the comment there says, what you should put there is "Some GDT entries, like null, kernel code, kernel data, user code, user data, TSS..."
Besides, i wasn't copy pasting, i was actually chatting with some os devers for 3 hours trying to get IDT to work.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
Re: What do i put in gdt_start and idt_start?
i am not in this aspect (tbh just a bit, but not everything).Roman wrote:Please stop copy-pasting code like a parrot.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS
- moondeck
- Member
- Posts: 56
- Joined: Sat Dec 19, 2015 12:18 pm
- Libera.chat IRC: moondeck
- Location: The Zone, Chernobyl
Re: What do i put in gdt_start and idt_start?
Yeah, you were chatting with us, but you didnt wanna understand, and kept telling us GDT isnt needed (LOL).
Please, read and understand before attempting to do this.
Please, read and understand before attempting to do this.
My operating system https://github.com/moondeck/hydrogen/
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
Re: What do i put in gdt_start and idt_start?
So? I am reading and understanding. It was a while ago actually. And yes, i don't need idt_start (the struct was the idt_start equivalent.). Only gdt_start.moondeck wrote:Yeah, you were chatting with us, but you didnt wanna understand, and kept telling us GDT isnt needed (LOL).
Please, read and understand before attempting to do this.
Anyway, can we resume to the question?
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS
- moondeck
- Member
- Posts: 56
- Joined: Sat Dec 19, 2015 12:18 pm
- Libera.chat IRC: moondeck
- Location: The Zone, Chernobyl
Re: What do i put in gdt_start and idt_start?
NunoLava1998 wrote: Anyway, can we resume to the question?
NOOOO! WE CANT RESUME! BECAUSE YOU HAVE NO IDEA WHAT YOU'RE DOING!
AND NOOOO! YOU ARE NOT UNDERSTANDING ANYTHING! ALL YOU DO IS COPY THE DAMN CODE!
Last edited by moondeck on Mon Jan 02, 2017 3:51 pm, edited 1 time in total.
My operating system https://github.com/moondeck/hydrogen/
Re: What do i put in gdt_start and idt_start?
Have you no pride whatsoever?
Re: What do i put in gdt_start and idt_start?
Please read carefully what GDT/IDT and GDTR/IDTR are and what LGDT/LIDT do.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
Re: What do i put in gdt_start and idt_start?
GDT: Global Descriptor TableRoman wrote:Please read carefully what GDT/IDT and GDTR/IDTR are and what LGDT/LIDT do.
IDT: Interrupt Descriptor Table
GDTR: Global Descriptor Table Register
IDTR: Interrupt Descriptor Table Register
LGDT: Loads the specified GDT.
LIDT: Loads the specified IDT.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: What do i put in gdt_start and idt_start?
I think we should calm down a bit. Understanding these data structures means more than just knowing what those acronyms expand to. Their representation and semantics are described in the Intel and AMD manuals. There, you'll find out how they work and if you read their descriptions, you'll know what to put in each entry to get the results you expect in your OS.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
Re: What do i put in gdt_start and idt_start?
I'm doing this now for several reasons:moondeck wrote:NunoLava1998 wrote: Anyway, can we resume to the question?
NOOOO! WE CANT RESUME! BECAUSE YOU HAVE NO IDEA WHAT YOU'RE DOING!
AND NOOOO! YOU ARE NOT UNDERSTANDING ANYTHING! ALL YOU DO IS COPY THE DAMN CODE!
- 1. Later i'll write my own code, i can't write too much code for the very low level of C.
2. I'm learning, i have to understand code.
3. I actually have started making code myself.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS