From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tommy McCabe Subject: Re: Swapping Date: Fri, 28 May 2004 07:56:10 -0700 (PDT) Sender: linux-8086-owner@vger.kernel.org Message-ID: <20040528145610.49690.qmail@web51302.mail.yahoo.com> References: <20040528075244.GW15905@vega.vega.lgb.hu> Mime-Version: 1.0 Return-path: In-Reply-To: <20040528075244.GW15905@vega.vega.lgb.hu> List-Id: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-8086@vger.kernel.org --- G=E1bor L=E9n=E1rt wrote: > Re, >=20 > On Thu, May 27, 2004 at 07:45:07PM +0100, Alan Cox > wrote: > > Firstly older processors could not restart a > faulting instruction > > perfectly. Eg if you did > >=20 > > "move block of 32 bytes from x to y" > >=20 > > you didn't know how much was copied when it > faulted. Worse still=20 > > instructions that did the post increment/decrement > might or might > > not have changed the values. The 8086 is in this > category, the 80286 > > is [with sufficient care] not. I think he means "on the 8086, if you're copying X bytes from A to B, and there's some error, you can't tell how much of it has been copied". > I don't understand this. >=20 > mov cx,32 > push ds > pop es > mov si,0x100 > mov di,0x200 > rep movsb >=20 > This code (in intel asm syntax) copies 32 bytes from > offset 0x100 to > 0x200 withing the data segment. If you interrupt rep > prefixed movsb > register cx should inform you the state of the > prefixed movsb. >=20 > Or simply I've ignored something :) >=20 > > The other difference is by fixed v variable size). > Paging traditionally > > means fixed size blocks and not loading all the > program into memory at > > once. Works a treat on a 386, not useful on a 286. > In the 286 world > > instead you have to work with variable sized > segments being written to > > or from disk, but you could in 286PM but not on > 8086 load only some > > segments into memory and load others on the fault. >=20 > Also it's important to declare here than on 386, > paging and segmenting > works in parallel (if you enable paging of course). > On 286 you have got > only segmenting but you have got special meaning of > segment registers in > protected mode ie conatining selectors which are > "only" indices inside a > desciptor table. Segmenting is similar in 386 > protected mode but there > you have the possibility to use page granulity > instead of bytes, so instead > of maximum of 64K segment size, you can use maximum > segment size 4G. Since > paging and segmenting can works in parallel most > modern OSes (like Linux) > uses "flat" addressing mode, ie setting segment > sizes to 4G, and let paging > do the hw level protecting and other related stuffs > on per page basis. >=20 > And another interesting things for 386 is the so > called 'flat real > addressing mode). It's an ugly trick and only works > in real mode so not > in virtual 8086 mode. You can change into 32 bit > protected mode on 386, > and you can build a descriptor table with using 4G > wide segment limits. > Now you can load selectors into the segment > registers. And NOW. If you > switch back into real mode, size of the segments are > 4G (!) instead of 64K, > though meaning of segment IDs reamins the "real > mode" constructs, so=20 > segid*16=3Dreal_addr. This addressing mode is used by > some old scene demos. > However I don't know exactly if it's a bug or > feature :) as far as I can > remember it's because CPU has got a "cache" for eg > segment limits to avoid > to load from descriptor table each time, and since > 4G limit is loaded, > this limit is used in real mode too after switching > back into real mode. >=20 > However, Alan, please correct me if I'm wrong > somewhere. >=20 > - G=E1bor (larta'H) > - > To unsubscribe from this list: send the line > "unsubscribe linux-8086" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at=20 http://vger.kernel.org/majordomo-info.html =09 =09 __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/=20