Hello!!!!.
i´m entering protected mode and y set up the
data selector in ds,fs,gs,ss
now i have to change the cs from 0x5000 (real mode segment)
to 0x8 (the protected mode code selector)
i know that with a far jmp i can change the cs value
there´s another way to do this?
there´s another way to change the cs selector
RE:there´s another way to change the cs selector
>On 2002-04-17 14:16:34, blito wrote:
>Hello!!!!.
>i´m entering protected mode and y set up the
>data selector in ds,fs,gs,ss
>now i have to change the cs from 0x5000 (real mode segment)
>to 0x8 (the protected mode code selector)
>i know that with a far jmp i can change the cs value
>there´s another way to do this?
Why would you want to do it another way? Any reason
why a far jump isn't acceptable?
You can try this:
push 0x08
pop cs
I don't know if it'll work... it might. I don't
remember my opcodes too well anymore
Jeff
>Hello!!!!.
>i´m entering protected mode and y set up the
>data selector in ds,fs,gs,ss
>now i have to change the cs from 0x5000 (real mode segment)
>to 0x8 (the protected mode code selector)
>i know that with a far jmp i can change the cs value
>there´s another way to do this?
Why would you want to do it another way? Any reason
why a far jump isn't acceptable?
You can try this:
push 0x08
pop cs
I don't know if it'll work... it might. I don't
remember my opcodes too well anymore
Jeff
RE:there´s another way to change the cs selector
>On 2002-04-17 14:16:34, blito wrote:
>Hello!!!!.
>i´m entering protected mode and y set up the
>data selector in ds,fs,gs,ss
>now i have to change the cs from 0x5000 (real mode segment)
>to 0x8 (the protected mode code selector)
>i know that with a far jmp i can change the cs value
>there´s another way to do this?
Use RETF
BITS 16
push PMODE_CS
push dword pmode_eip
o32 retf
Did your bootloader stack and data segment
"disappear" after you loaded SS and DS?
This is not surprising
If you want to jump to a variable address,
you can still do what you're doing, but use
self-modifying code:
BITS 16
mov [entry + 2],eax ; EAX=pmode_eip
; ...enable A20 here, if necessary
; ...fix up GDT and gdt_ptr here
cli
lgdt [gdt_ptr]
mov ax,PMODE_DS
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
mov ss,ax
mov esp,pmode_esp
entry:
jmp PMODE_CS:dword 0
>Hello!!!!.
>i´m entering protected mode and y set up the
>data selector in ds,fs,gs,ss
>now i have to change the cs from 0x5000 (real mode segment)
>to 0x8 (the protected mode code selector)
>i know that with a far jmp i can change the cs value
>there´s another way to do this?
Use RETF
BITS 16
push PMODE_CS
push dword pmode_eip
o32 retf
Did your bootloader stack and data segment
"disappear" after you loaded SS and DS?
This is not surprising
If you want to jump to a variable address,
you can still do what you're doing, but use
self-modifying code:
BITS 16
mov [entry + 2],eax ; EAX=pmode_eip
; ...enable A20 here, if necessary
; ...fix up GDT and gdt_ptr here
cli
lgdt [gdt_ptr]
mov ax,PMODE_DS
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
mov ss,ax
mov esp,pmode_esp
entry:
jmp PMODE_CS:dword 0
RE:there´s
>On 2002-04-18 10:34:53, J. Weeks wrote:
>You can try this:
>push 0x08
>pop cs
No, it won't work . It would only work on an 8088 (and, perhaps, an 8086; well.. even on a 186 =) ). But the "pop cs" opcode is 0x0F, and it has absolutely other meaning in every processor from 286 and further, as you know =) .
>You can try this:
>push 0x08
>pop cs
No, it won't work . It would only work on an 8088 (and, perhaps, an 8086; well.. even on a 186 =) ). But the "pop cs" opcode is 0x0F, and it has absolutely other meaning in every processor from 286 and further, as you know =) .