can't load CS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
huberot

can't load CS

Post 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!
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

RE:can't load CS

Post by kataklinger »

you can't load CS just like that.
try to do something like this "jmp LIN_COD_SEL:my_new_gdt" :)
Post Reply