Mail Archives: djgpp/1999/10/21/13:46:24
Hi there!
I've got a nasty (so it seems to me) problem with structs. I have this nice
kernel with some descriptors in the gdt describing some tss and in that tss
(which is, of course, a struct) I define eip as &isr00 which is a pointer
to a function. No problem at all, so I thought that the following code should
also work:
extern struct tsslayout tssexception00;
struct sdescriptor gdt[] =
{
<snip>
sizeof(tss) - 1, (long) &tssexception00, 0x21, SDTTSSNB0, GDXU1B32, 0x00,
<snip>
};
So the baselow is a pointer to a struct. By this I hoped to initialize a tss
inside the kernel space and let the gdt descriptor point to that. To me, there
doesn't seem to be any problem since structs are defined in the .data-section
as _tssexception00 followed by a lot of words and dwords. So to get the offset
and use that seems not difficult to me. However, I get the following error
message:
gdt.c:48: initializer element for `gdt[6].baselow' is not computable at load
time
Well, gdt[6] is my tss descriptor (see above) and baselow obviously is
(long) &tssexception00. So the address of my struct is somehow not computable
from the respect of gcc. Can someone help me out please? I can't imagine I am
the only one trying to define a tss inside the kernel address space and use
a pointer to reference it in the gdt.
By the way, it doesn't matter if my tss struct is not extern but included
in gdt.c.
Hmm.. I see that I made some other mistakes, too. Obviously, the pointer to
tssexception00 is 32bits and doesn't fit in baselow. So I have to split it.
Any help here? In other words, does someone have a sample c program with tss's
and stuff?
Thanx in advance,
David
- Raw text -