I am having trouble with it rebooting when I try to jump to the new code segment.
my segment descriptor structure looks like this:
Code: Select all
typedef struct
{
uint limit_0_15:16 __attribute__((__packed__));
uint base_0_23:24 __attribute__((__packed__));
uint accessed:1 __attribute__((__packed__));
uint read_write:1 __attribute__((__packed__));
uint expand_conform:1 __attribute__((__packed__));
uint code:1 __attribute__((__packed__));
uint system:1 __attribute__((__packed__));
uint dpl:2 __attribute__((__packed__));
uint present:1 __attribute__((__packed__));
uint limit_16_19:4 __attribute__((__packed__));
uint long_mode:1 __attribute__((__packed__));
uint default_op:1 __attribute__((__packed__));
uint granularity:1 __attribute__((__packed__));
uint base_24_31:8 __attribute__((__packed__));
} segment_descriptor;
I am able to LGDT with my array of 8192 descriptors, but when I try to jump into my new code segment (selector 0x08), it reboots.
the code for jumping to the new code segment is pretty typical, in NASM:
Code: Select all
jump_to_new_segment:
jmp 0x08:new_seg
new_seg:
mov eax, 0x10
mov ds, eax
mov ss, eax
mov es, eax
mov fs, eax
mov gs, eax
ret
any help will be very appreciated.
thanks in advance.
Andy