Page 1 of 1

"unreal" mode - possible protection

Posted: Sat Jul 07, 2001 11:00 pm
by J. Weeks
I'm currently writing a pmode OS, but I've read
a lot about unreal mode recently and it's peaked
my interest.

I'm guessing that once unreal mode has been
initialized, loading another segment register will
cause it to fail... therefore making it rather
unsecure for a real operating system, but
interesting to play around with. Correct?

This would mean using the BIOS is out, correct?

Would it be possible, however, to define a
segment from 0 - 0xfffffff and one from, say,
0x0001000 - 0xffffffff and switch between them?
Or will _any_ changing of the current segment
cause unreal mode to fault?

Thanks,
j.weeks

RE:"unreal" mode - possible protection

Posted: Mon Jul 09, 2001 11:00 pm
by Chase
>On 2001-07-08 22:35:30, J. Weeks wrote:

>Would it be possible, however, to define a
>segment from 0 - 0xfffffff and one from, say,
>0x0001000 - 0xffffffff and switch between them?
>Or will _any_ changing of the current segment
>cause unreal mode to fault?

From what I've read, any change to the segment
regs during real mode causes things like length to
be reloaded with correct values for real mode.

You could have two regs pointing to different areas and just
switch between them but I not really sure about copying from one
to another. My guees would be no though...

-Chase

RE:"unreal" mode - possible protection

Posted: Mon Jul 09, 2001 11:00 pm
by Guest
>I'm guessing that once unreal mode has been
>initialized, loading another segment register will
>cause it to fail...

Reloading a segment register after returning
to real mode changes the segment base address
only (0 - FFFF0h). It doesn't change the segment limit.

>This would mean using the BIOS is out, correct?

You can still use the BIOS after enabling unreal mode.

>Would it be possible, however, to define a
>segment from 0 - 0xfffffff and one from, say,
>0x0001000 - 0xffffffff and switch between them?

Sure.

I've read that you should not enable unreal mode for the CS and SS registers, though.