Code Comments
Programming Forum and web based access to our favorite programming groups.Wolfgang Kern wrote: > Rod Pemberton wrote: > > > > No it didn't affect it at all [on this very early AMD 486DX50], > and I'm surprised that later CPUs keep the limits in 16-bit RM. > I once read in the manuals that segment limits are hardwired > to 64K for RM, but x86 design seem to have changed meanwhile. > That was never true (although the manuals had a lot of baloney in them.) It is, however, true in *V86* mode. -hpa
Post Follow-up to this messageH. Peter Anvin wrote: > Dirk Wolfgang Glomp wrote: > > You don't know what the BIOS does behind the back of either DOS or > anything else. In particular, if the hardware requires access to high > memory (as some disk and network controllers do these days), you have to > go to PM. I've been running AMI BIOS under a VT hypervisor lately (basically, booting an OS with int 19h using native I/O and virtualized memory), and it does use unreal mode (apparently, for some local APIC stuff, don't ask me why, I have no idea). It also does that if you use int 13h. Interrupt handlers do not go to PM, though, at least not the disk I/O ones. By the way, emulating unreal mode with Intel's sucky VT is a special kind of fun.
Post Follow-up to this messageAm Sun, 23 Mar 2008 12:37:06 -0700 schrieb H. Peter Anvin: > Dirk Wolfgang Glomp wrote: > > You don't know what the BIOS does behind the back of either DOS or > anything else. In particular, if the hardware requires access to high > memory (as some disk and network controllers do these days), you have to > go to PM. For those controllers, i have to go to PM, or the driver is a PM-driver for the RM, or the BIOS goes to PM and back before DOS is booting? Dirk
Post Follow-up to this messageDirk Wolfgang Glomp wrote: > Am Sun, 23 Mar 2008 12:37:06 -0700 schrieb H. Peter Anvin: > > > For those controllers, i have to go to PM, or the driver is a PM-driver fo r > the RM, or the BIOS goes to PM and back before DOS is booting? > Typically, they drop into PM and back when they get an interrupt (software or hardware.) -hpa
Post Follow-up to this messageAm Mon, 24 Mar 2008 09:38:59 -0700 schrieb H. Peter Anvin: > Dirk Wolfgang Glomp wrote: > > Typically, they drop into PM and back when they get an interrupt > (software or hardware.) Are these onboard-controllers like SATA hooking to int13h? There is a problem to use emm386.exe? Dirk
Post Follow-up to this messageElcaro Nosille wrote: > Would it be possible to use a 32-bit addressing-mode in real-mode via > address-size prefix and thereby to have segments which are 4GB long? Yes, it's possible. However, first you have to change the size of the segments in the Internal Descriptor Cache. Otherwise, you'll get a GPF (i'm not sure, however, if the processor even tries to handle such a strange thing as a GPF triggered in real mode of if it tripple faults immediately).. . This (changing the size of the segments) is a feature of PM, so you need PM to do this. So, you go to 16-bit PM, you load your segment registers with 4GB segment descriptors, and then you switch back to real mode, since you still want to run the BIOS and things alike... Then, you can access data above 1MB and (I suppose), run code there. Beware that the BIOS won't be able to return to extended memory, though... What I described is what we usually call Unreal Mode, Voodoo Mode, Flat Real Mode, 32-bit Real Mode (this is the less accurate of them!), etc. In the unlikely case that you have a 386 or a 286, you can also use LOADALL (but it's not recommended unless you don't intend to share your code with anyone else). JJ
Post Follow-up to this messageAm Wed, 26 Mar 2008 02:53:27 +0000 schrieb João Jerónimo: [Unrealmode] > Then, you can access data > above 1MB and (I suppose), run code there. I think the Descriptor Cache can´t be hold a codesegment with 4GB when we switch back to RM. So only the instructionpointer(IP with 16bit) let us execute our opcodes in the fist MB of ram. Dirk
Post Follow-up to this messageOn Feb 18, 4:08_pm, Elcaro Nosille wrote: > Would it be possible to use a 32-bit addressing-mode in real-mode via > address-size prefix and thereby to have segments which are 4GB long? It's possible to use a 32 bit protected mode bios extender. This permits 32 bit protected mode programming with full bios access. æBIOS now boots and runs from a USB flash drive in both modes (floppy and hard drive) as well as Qemu emulation. æBIOS is free to download and includes the full source code in FASM. Mike Gonta look and see - many look but few see http://aeBIOS.com
Post Follow-up to this messageDirk Wolfgang Glomp wrote: > > I think the Descriptor Cache can´t be hold a codesegment with 4GB when we > switch back to RM. So only the instructionpointer(IP with 16bit) let us > execute our opcodes in the fist MB of ram. I admit you are likely to be right. JJ
Post Follow-up to this messageJJ "João Jerónimo" asked: > Elcaro Nosille wrote: > Yes, it's possible. However, first you have to change the size of the > segments in the Internal Descriptor Cache. Otherwise, you'll get a GPF (i'm > not sure, however, if the processor even tries to handle such a strange > thing as a GPF triggered in real mode of if it tripple faults immediately)... > This (changing the size of the segments) is a feature of PM, so you need PM > to do this. So, you go to 16-bit PM, you load your segment registers with > 4GB segment descriptors, and then you switch back to real mode, since you > still want to run the BIOS and things alike... Then, you can access data > above 1MB and (I suppose), run code there. Beware that the BIOS won't be > able to return to extended memory, though... > What I described is what we usually call Unreal Mode, Voodoo Mode, Flat > Real Mode, 32-bit Real Mode (this is the less accurate of them!), etc. > In the unlikely case that you have a 386 or a 286, you can also use LOADALL > (but it's not recommended unless you don't intend to share your code with > anyone else). The opcode for 'Loadall' got a totally different meaning on newer CPUs ! I figured it out a few ws ago, YES if you don't (re)set the limit of your seg-regs whenever you switch from PM to RM. The stored seg-limits (this hidden 48 bits) remain valid and let you access all 4GB within RM. Last checks showed that this is valid for CPUs above/equal 486DX, while previous CPUs may have a hard-wired 64 KB limit for RM (stated in 386/486 Intel docs) regardless of desciptor setups (mentioned as ignored at all in RM). Modern (586+) seem to remember the PM-limit settings for seg regs when re-entering real (unreal/bigreal then) mode [except for CS of course]. __ wolfgang
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.