"unreal" mode - possible protection

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
J. Weeks

"unreal" mode - possible protection

Post 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
Chase

RE:"unreal" mode - possible protection

Post 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
Guest

RE:"unreal" mode - possible protection

Post 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.
Post Reply