flat assembler
Message board for the users of flat assembler.

Index > Main > how to jmp far to Long Mode segment?

Author
Thread Post new topic Reply to topic
fonolite



Joined: 14 Dec 2005
Posts: 32
fonolite 16 Jan 2006, 06:40
I set up compatibility mode with AMD64 cpu.

I checked LMA=1.
This is compatibility mode.(PML4 paging and LME=1)

I tested as below.
RM16 -> PM16 ->(jmp far)-> PM32 segment (CS.L=0 & CS.D=1)

jmp far FWORD [di] (indirect jmp far is OK!, offset & selector)


But, changed CS.L=1 & CS.D=0 (long mode).

jmp far to PM64 is illegal. it reboots.

I tried direct jmp far such as db 66h, 0EAh, dd offset, dw selector
is illegal, too.


Compatibility mode is OK, but I can't jump to 64bit long mode segment.

What is my problem? Anyone help?
Post 16 Jan 2006, 06:40
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 16 Jan 2006, 07:44
I think that this topic fits here because of the reason its not any certain OS, but we have a different section for these. Maybe if this topic would be moved to OS, then it would attract the attention of some guys there. I don't know any other way Smile
Post 16 Jan 2006, 07:44
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
fonolite



Joined: 14 Dec 2005
Posts: 32
fonolite 16 Jan 2006, 08:13
OK, I post it again in OS construction section.
Post 16 Jan 2006, 08:13
View user's profile Send private message Reply with quote
fonolite



Joined: 14 Dec 2005
Posts: 32
fonolite 16 Jan 2006, 11:41
Hi, I made it by myself. Shocked

Entering long mode, the initial base of code segment descriptor becomes zero.

There is no segmentation in long mode. Only flat model.

I re-designed cs64 descriptor with base 0.

It works fine. Really glad to me. Very Happy
Post 16 Jan 2006, 11:41
View user's profile Send private message Reply with quote
CodeWorld



Joined: 15 Nov 2003
Posts: 69
CodeWorld 17 Jan 2006, 07:16
Hi fonolite!

Can you send me example with going in long mode, please?

Thanks!(codeworld<@>yandex.ru)

_________________
Image
FASM & RUS OSDEV at WWW.SYSBIN.COM (EN: ww2.sysbin.com)
Post 17 Jan 2006, 07:16
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.