Page 1 of 1

can't load CS

Posted: Sun Apr 06, 2003 12:00 am
by huberot
Hi everybody,

my os boots with GRUB. It sets up a GDT and descriptors for code, data and stack. I'm now trying to install my own GDT somewhere else and switch to this one. But I found out, that I can't load the CS register. Even if I do nothing else as
    mov ax, cs
    mov cs, ax
in the code direct after the multi boot header, bochs terminates with the message:
    [CPU  ] load_seg_reg(): invalid segment register passed!

so do anybody know what's wrong here? Can't I load the CS with the same descriptor it currently points to?

Thanks for every help!

RE:can't load CS

Posted: Sun Apr 06, 2003 12:00 am
by kataklinger
you can't load CS just like that.
try to do something like this "jmp LIN_COD_SEL:my_new_gdt" :)