problem of SWITCH TO USER MODE solved :-)
Re: problem of SWITCH TO USER MODE
try inspecting the value you're feeding LGDT with !
Re: problem of SWITCH TO USER MODE
i just copy someone's code (i am sorry ,forget who he is )Adek336 wrote:try inspecting the value you're feeding LGDT with !
but i change the function which load the gdtr.. ,
any suggestion is expected.... thank you all !!
Code: Select all
struct gdt_ptr_struct
{
u16int limit;
u32int base;
} __attribute__((packed));
Code: Select all
typedef struct gdt_ptr_struct gdt_ptr_t;
Code: Select all
gdt_ptr_t gdt_ptr;
Code: Select all
#define load_gdtr(n)\
__asm__("lgdt (%%eax)\n\t"\
::"a" (n));
Code: Select all
load_gdtr((u32int)&gdt_ptr);
Re: problem of SWITCH TO USER MODE solved :-)
so how did you eventually make it work?
- codemastersnake
- Member
- Posts: 148
- Joined: Sun Nov 07, 2004 12:00 am
- Contact:
Re: problem of SWITCH TO USER MODE solved :-)
I think this topic is worth to be added to WIKI
Re: problem of SWITCH TO USER MODE solved :-)
but we don't know what was the problem (or I misunderstand the post flow)
Re: problem of SWITCH TO USER MODE solved :-)
Adek336 wrote:so how did you eventually make it work?
in fact , the code i had been posted work well,
maybe the problem comes from boot code which i used, . i think. maybe
i modified the boot code, and the GDT code worked