How do i appropiately load the IDT?
Re: How do i appropiately load the IDT?
if the LIDT instruction was your only problem, why did you post about it instead of just looking it up in the manuals? volume 2 is the proper answer to any question about an instruction
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
Re: How do i appropiately load the IDT?
So? I do rtfm sometimes.crunch wrote:Is your plan to just post about every single step in os development? Obviously you are not picking up on the fact that you MUST be able to read documentation and then be able to translate that into code.
There is no problem with asking questions. This stuff can be difficult to grasp. If you're getting stuck here, you're not going to make it much farther (without significant handholding) until you learn how to rtfm
And my IRQ1 handler? Made all by me. I just read documentation and... well, translated it into code.
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: How do i appropiately load the IDT?
"IDTR(Limit) ← SRC[0:15];
IDTR(Base) ← SRC[16:47]; "
The thing is, how do i implement this?
I know i can implement the first with something like "char limit[16];", but i'm not sure how to do the second.
IDTR(Base) ← SRC[16:47]; "
The thing is, how do i implement this?
I know i can implement the first with something like "char limit[16];", but i'm not sure how to do the second.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS
Re: How do i appropiately load the IDT?
You have already implemented this. Function lidt() in your mainf.c, starting at line 104 does exactly that. (Assuming your Github DixiumOS repo is up to date).NunoLava1998 wrote:"IDTR(Limit) ← SRC[0:15];
IDTR(Base) ← SRC[16:47]; "
The thing is, how do i implement this?
Or did you copy the code from somewhere, without knowing what it is for? You have to quit that habit.
It is normal to look at other peoples code to see how things are done. Or even copy some, but you must always understand what it does.
Get inspired from it, play around, break it, fix it, break it again, but never copy blindly.
That being said, are you familiar with JamesM or Bran's kernel development tutorials?
If something looks overcomplicated, most likely it is.
-
- Member
- Posts: 273
- Joined: Sun Oct 09, 2016 4:38 am
- Libera.chat IRC: NunoLava1998
Re: How do i appropiately load the IDT?
I meant how to make something like:Velko wrote:You have already implemented this. Function lidt() in your mainf.c, starting at line 104 does exactly that. (Assuming your Github DixiumOS repo is up to date).NunoLava1998 wrote:"IDTR(Limit) ← SRC[0:15];
IDTR(Base) ← SRC[16:47]; "
The thing is, how do i implement this?
Or did you copy the code from somewhere, without knowing what it is for? You have to quit that habit.
It is normal to look at other peoples code to see how things are done. Or even copy some, but you must always understand what it does.
Get inspired from it, play around, break it, fix it, break it again, but never copy blindly.
That being said, are you familiar with JamesM or Bran's kernel development tutorials?
"char limit[16];
char base[16..47];"
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.
https://github.com/NunoLava1998/DixiumOS
https://github.com/NunoLava1998/DixiumOS
Re: How do i appropiately load the IDT?
Learn C.NunoLava1998 wrote: I meant how to make something like:
"char limit[16];
char base[16..47];"
Re: How do i appropiately load the IDT?
You did understand it wrong. (32-bit) LIDT loads a structure that is 48 bits long, not bytes. 16 bits for IDT's length, and then 32 - its address.NunoLava1998 wrote:I meant how to make something like:
"char limit[16];
char base[16..47];"
C structure:
Code: Select all
struct {
uint16_t length;
void* base;
} __attribute__((packed))
If something looks overcomplicated, most likely it is.
Re: How do i appropiately load the IDT?
Why would you want to do that?NunoLava1998 wrote: I meant how to make something like:
"char limit[16];
char base[16..47];"