Page 1 of 1
question
Posted: Fri Mar 21, 2003 12:18 pm
by Grinjander
Hi,
I know it's a stupid question, but i don't know how can i get an address of this struct:
int off1;
int off2;
I have an address ( a pointer ) splited in this two integers. And i'd like to kwon the whole address. Can anyone helpme please.
I'll use it to get my IDT address.
Re:question
Posted: Fri Mar 21, 2003 12:29 pm
by Tim
If you have a structure like this:
Code: Select all
struct some_structure
{
int off1;
int off2;
};
some_structure s;
...then you can get the address of the start of the structure using [tt]&s[/tt].
Re:question
Posted: Fri Mar 21, 2003 2:22 pm
by Grinjander
Hi Tim.
No, my struct is an IDT entry. So the off1 and aff2 are separated by two integers.
That's what i don't know how to do, get the whole address when they are separated.
Re:question
Posted: Fri Mar 21, 2003 3:27 pm
by Tim
OK, then you can't. You will need to do bit manipulation to separate the 32 bits into the relevant fields.
Re:question
Posted: Fri Mar 21, 2003 10:55 pm
by Grinjander
Ok,
Thanks Tim. But i can't imagine how can i do this. Can you put me an example please? Or any web or code... I've tried to make very things with negetive results.
Thanks
Re:question
Posted: Sat Mar 22, 2003 4:18 am
by Tim
This is basic C language stuff. You should go and read up on the relevant parts of the C language, then come back and try this.
Re:question
Posted: Sat Mar 22, 2003 10:42 am
by GRinjander
I only ask you an example, i try to serach it in google but i don't found anything, before post this here.
Re:question
Posted: Sun Mar 23, 2003 5:12 pm
by Tim
I believe that you should be able to program well in your chosen language before starting OS development. OS development is difficult enough without having to learn programming at the same time.
If you aren't already a capable programmer, I recommend that you go and learn programming before you start on an OS project.