OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:54 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Unreal Mode
PostPosted: Sat Mar 11, 2017 12:42 am 
Offline
User avatar

Joined: Mon Feb 20, 2017 1:01 am
Posts: 13
Location: The Moon
I am reading more about OS development on other websites and found out about Unreal Mode, where you switch to protected mode, load a new GDT, and switch back to real mode, so you can use Real Mode benefits without the penalty of the little amount of ram.
My OS design does not use normal binary files, and instead uses a bytecode system read by the kernel (Similar to how Java works) so I do not have to worry about malicious programs with a sneaky CLI or HLT in the code.
With my design, is Unreal Mode still safe or should I continue using Protected Mode?

_________________
Developing an OS that is so early in development, it can't do anything because stupid me can't figure out interrupts
Image


Top
 Profile  
 
 Post subject: Re: Unreal Mode
PostPosted: Sat Mar 11, 2017 12:46 am 
Offline
Member
Member
User avatar

Joined: Sun Dec 25, 2016 1:54 am
Posts: 204
http://wiki.osdev.org/Unreal_Mode

Knowing you target architecture would help - as well as 32 or 64 bit?

If 64 bit - why bother?

_________________
Plagiarize. Plagiarize. Let not one line escape thine eyes...


Top
 Profile  
 
 Post subject: Re: Unreal Mode
PostPosted: Sat Mar 11, 2017 12:50 am 
Offline
User avatar

Joined: Mon Feb 20, 2017 1:01 am
Posts: 13
Location: The Moon
dchapiesky wrote:
http://wiki.osdev.org/Unreal_Mode

Knowing you target architecture would help - as well as 32 or 64 bit?

If 64 bit - why bother?

Developing mainly for 32 bit. I will develop 64 bit when I get farther into development.

_________________
Developing an OS that is so early in development, it can't do anything because stupid me can't figure out interrupts
Image


Top
 Profile  
 
 Post subject: Re: Unreal Mode
PostPosted: Sat Mar 11, 2017 12:56 am 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

beauhefley wrote:
I am reading more about OS development on other websites and found out about Unreal Mode, where you switch to protected mode, load a new GDT, and switch back to real mode, so you can use Real Mode benefits without the penalty of the little amount of ram.
My OS design does not use normal binary files, and instead uses a bytecode system read by the kernel (Similar to how Java works) so I do not have to worry about malicious programs with a sneaky CLI or HLT in the code.
With my design, is Unreal Mode still safe or should I continue using Protected Mode?


For BIOS functions, "real mode" is a relatively insignificant problem (it's fairly easy to solve using a variety of methods).

For all the problems that actually do matter, see this warning.

You should not use BIOS functions; and if you aren't using BIOS functions then you have no reason to prefer (e.g.) Unreal Mode over Protected Mode.


Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re: Unreal Mode
PostPosted: Sat Mar 11, 2017 12:58 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
What are the "Real Mode benefits"?


Top
 Profile  
 
 Post subject: Re: Unreal Mode
PostPosted: Sat Mar 11, 2017 1:30 am 
Offline
Member
Member

Joined: Tue Mar 04, 2014 5:27 am
Posts: 1108
beauhefley wrote:
is Unreal Mode still safe or should I continue using Protected Mode?


Could you elaborate your question? What kind of safety are you talking about?


Top
 Profile  
 
 Post subject: Re: Unreal Mode
PostPosted: Sat Mar 11, 2017 11:16 am 
Offline
User avatar

Joined: Mon Feb 20, 2017 1:01 am
Posts: 13
Location: The Moon
Oh ok. I will continue using protected mode. I thought that the only problems with real mode were the ram limit and no memory protection and ring modes.

_________________
Developing an OS that is so early in development, it can't do anything because stupid me can't figure out interrupts
Image


Top
 Profile  
 
 Post subject: Re: Unreal Mode
PostPosted: Sat Mar 11, 2017 11:17 am 
Offline
User avatar

Joined: Mon Feb 20, 2017 1:01 am
Posts: 13
Location: The Moon
Actually, it might be good for now, as I do not have much time and have to go to school. Maybe over the summer I can re-write my code with my own drivers.

_________________
Developing an OS that is so early in development, it can't do anything because stupid me can't figure out interrupts
Image


Top
 Profile  
 
 Post subject: Re: Unreal Mode
PostPosted: Sat Mar 11, 2017 11:48 am 
Offline
Member
Member
User avatar

Joined: Wed Aug 17, 2016 4:55 am
Posts: 251
iansjack wrote:
What are the "Real Mode benefits"?

In the older systems for which unreal mode was originally used, protected mode was much slower, and unreal mode allowed direct access to more than 640KB while working around that issue. This stopped being the case from Pentium onwards though, and you're better off using protected mode (or long mode!) in just about anything even remotely modern.

EDIT: and yes I've seen documents describing unreal mode without ever mentioning how its main advantage is gone from Pentium onwards.


Top
 Profile  
 
 Post subject: Re: Unreal Mode
PostPosted: Sat Mar 11, 2017 8:36 pm 
Offline

Joined: Sun Feb 26, 2017 4:42 pm
Posts: 16
My first stage boot loader uses unreal mode to load the second stage boot loader from disk to memory. By using unreal mode I can use int 13h to perform the disk read into upper memory. I plan on moving to a fully protected mode first stage boot loader before the switch to long mode + a jump to the second stage boot loader.

That's about the only useful thing I'd consider about unreal mode :)


Top
 Profile  
 
 Post subject: Re: Unreal Mode
PostPosted: Sat Mar 11, 2017 9:17 pm 
Offline
Member
Member
User avatar

Joined: Fri Mar 07, 2008 5:36 pm
Posts: 2111
Location: Bucharest, Romania
Well, protected mode was never slower than unreal mode. The overhead was always related to using the protection features of protected mode. But if you start comparing a protected kernel with an unprotected one, it's like comparing apples to oranges. Since you're using software protection, all the user code can run in ring 0 and thus the checks related to trapping into the kernel and switching back to user mode can be skipped.

_________________
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], FrankRay78, SemrushBot [Bot] and 52 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group