hi-memory access in real-mode
Posted: Sat Mar 03, 2012 3:23 pm
Dear All;
How do I R/W memory above 16M before switching to protected mode? TIA.
How do I R/W memory above 16M before switching to protected mode? TIA.
The Place to Start for Operating System Developers
https://f.osdev.org/
In general, you can't.Boba wrote:How do I R/W memory above 16M before switching to protected mode? TIA.
that's what i wish i could do, but my knowledge is limited by 16M (int15.87 to be exact).bubach wrote:If you're in 16-bit mode you might as well use the BIOS interrupts to get memory...
If the BIOS interrupt handlers, say, reload the segment registers (and you can't be sure that they don't), then wouldn't you need to switch back to unreal mode? I find that to be as bad as constantly switching between real and protected mode.Love4Boobies wrote:... implement descriptor caches, I use unreal mode in my boot loader on systems with BIOS-type firmware. It's not more difficult---on the contrary, you get a 4 GiB address space and are able to use the BIOS interrupt handlers. That means no more switching back and forth.
not sure i'm in line with you: are you using 'unreal mode' in your 'non-16-bit' code?Love4Boobies wrote:Given that all non-16-bit x86 implementations ... implement descriptor caches, I use unreal mode ...
I dobut there are many implementations that do that, as much boot loader code relies on this technique; other than that, there would be little reason for the BIOS to do anything of that nature. If you want to play it somewhat safer, only use FS or GS. Either way, if this problem even exists in the real world, it's very uncommon.Shikhin wrote:Hi,
If the BIOS interrupt handlers, say, reload the segment registers (and you can't be sure that they don't), then wouldn't you need to switch back to unreal mode? I find that to be as bad as constantly switching between real and protected mode.Love4Boobies wrote:... implement descriptor caches, I use unreal mode in my boot loader on systems with BIOS-type firmware. It's not more difficult---on the contrary, you get a 4 GiB address space and are able to use the BIOS interrupt handlers. That means no more switching back and forth.
You misunderstand; a non-16-bit x86 implementation is any 32/64-bit x86 CPU (i.e., 80386 or later).Boba wrote:not sure i'm in line with you: are you using 'unreal mode' in your 'non-16-bit' code?Love4Boobies wrote:Given that all non-16-bit x86 implementations ... implement descriptor caches, I use unreal mode ...
i need to access the upper memory before the pm kicks in. to me, 'non-16-bit' means 32-bit
protected mode. although my target range is very narrow, i'd like to avoid the 'implementation
specific' approach as mentioned by bluemoon.
related to this, i wonder if dos hi-memory drivers (and 32-bit extenders) use pm?
... and after detecting it, how do i access it beyond 16M before going 32-bit?Love4Boobies wrote:There are many ways to detect memory; your primary tool being INT 15h, EAX = E820h (BIOS)...
You've already been answered: by switching to unreal mode.Boba wrote:... and after detecting it, how do i access it beyond 16M before going 32-bit?Love4Boobies wrote:There are many ways to detect memory; your primary tool being INT 15h, EAX = E820h (BIOS)...