Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | "wolfgang kern" <nowhere@never.at> |
|---|---|
| Newsgroups | alt.lang.asm, alt.os.assembly, alt.os.development |
| Subject | Re: Little Big Mode |
| Date | 2016-06-15 10:00 +0200 |
| Organization | KESYS-development |
| Message-ID | <njr1uh$1m8n$1@gioia.aioe.org> (permalink) |
| References | <nj3hgq$1nvk$1@gioia.aioe.org> <nj436b$gmj$1@dont-email.me> <njocm8$1u8n$1@gioia.aioe.org> <20160614171413.3a4d60cb@_> |
Cross-posted to 3 groups.
Rod Pemberton wrote: >> After checking I can say that all (386+) Intel/AMD CPUs work >> identical in TrueRealMode, that mean segments are limited to 64Kb >> (aka 16bit). There aren't single instructions to override this >> limits, but we got the well known trick to have Unreal Mode: >> 1. check if A20 is ON (only 1 MB available if OFF) >> 2. enter PM32 and set segment limits, ie: base 0 and full 4GB range. > By "enter PM32" do you mean set CR0.PE? ... > Did you mean "enter PM" here instead of "enter PM32"? Yes, just enter PM, but load data-segments with full-range decriptors right after the far jump. This far jump could be either 16 or 32 bit. > As I understand it, neither PM16 or PM32 is activated until the far > jump, but access to hidden PM features is enabled via setting CR0.PE. I once tried to load segment registers after setting PE without a far jump and I remember restrictions and some mad behave (see below). >> 3. switch to PM16 (just far jump) for a 16-bit code-segment limit *). > Is a far jump to activate PM (either PM16 or PM32) necessary for this? it's told so by AMD-docs, and I better stay on the safe side. > My understanding was that once CR0.PE was set, then you could change > limits and return to RM16, i.e., no far is jump required to activate > PM, or for unreal mode. > I've not attempted this. That is just based on what I've read. me too saw code snips which enter unreal without this jmp, but any IRQ will immediate enter PM then and crash. So you need to disable IRQs during all unreal actions and BIOS functions cant be called anyway. > As a side note, normally, we minimize the instructions between setting > CR0.PE and executing a PM far jump instruction. PM activates (either > PM16 or PM32) only with a far jump after PM is enabled via CR0.PE being > set, correct? Yeah, that's how I see and use it without problems. > Do BIOS calls use far jumps frequently? So, I'm wondering how long > you can execute code in RM16 after enabling PM via CR0.PE. > Do BIOS calls use far jumps frequently? Oh no, the first BIOS call make it crash, INTx 'is' a FAR CALL ;) I'd recommend to use only a clean RM->UnReal switch. Go_Unreal: RM: CLI LGDT... ;hope you already prepared it right before. set PE ;OR CR0,1 by eax jmpf PM ;must use a PL0 CS PM: load DS,ES... ;with FLAT data descriptor, but keep SS. clr PE ; jmpf Unreal Unreal: ; load segregs.. ; STI ... clear register highwords are required for some BIOS calls __ wolfgang
Back to alt.lang.asm | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Little Big Mode "Mike Gonta" <mikegonta@gmail.com> - 2016-06-06 05:58 -0400
Re: Little Big Mode Cecil Bayona <cbayona@cbayona.com> - 2016-06-06 10:00 -0500
Re: Little Big Mode "wolfgang kern" <nowhere@never.at> - 2016-06-14 09:45 +0200
Re: Little Big Mode Cecil Bayona <cbayona@cbayona.com> - 2016-06-14 10:08 -0500
Re: Little Big Mode "wolfgang kern" <nowhere@never.at> - 2016-06-14 21:18 +0200
Re: Little Big Mode Rod Pemberton <NoHaveNotOne@bcczxcfre.cmm> - 2016-06-14 17:14 -0400
Re: Little Big Mode "wolfgang kern" <nowhere@never.at> - 2016-06-15 10:00 +0200
Re: Little Big Mode JJ <jj4public@vfemail.net> - 2016-06-07 13:21 +0700
Re: Little Big Mode CN <qmbmnp3799@pacbell.net> - 2016-06-15 03:08 -0700
csiph-web