🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.intel
Article #418

Re: Segment limits on 80386

#418
From: Bill Beebe
Date: Sat, 20 Jan 1990 00:52
32 lines
2279 bytes
In article <1990Jan17.164046.10641@idt.unit.no> torb@idt.unit.no () writes:
>
>What I want to know is the maximum segment size for a *small* segment.
>Both references mentioned above says both 64KB and 1MB for expand-up
>segments. What's right ?? I would guess 1MB since the limit field is
>20 bits long. 
>
>For expand down segments the references agree on 64KB as maximum for a
>small segment. Is this right ?? 1MB seems more logical with a 20
>bit limit field.
>

In the original 286 documentation the user was advised to leave the upper
word of the segment discripter as zero for 286 protected mode code. If
you did that and you want to run that 286 PM code on your 386, then it will
run with the the same 64K segment limit as it did on the 80286. The high
descriptor word on the 386 contains additional bits for the segment base
and limit size, a granularity bit, and a few other bits I can't recall
because I don't have the book in front of me.

I do remember that the upper word contains bits 24 to 31 of the base,
and bits 16-19 of the limit. Now, if the granularity bit is clear,
the limit is interpreted in units of one byte. Thus the maximum segment
limit is 1 Mbyte on 1 *byte* boudaries. If the granularity bit is set,
the limit is interpreted in units of 4096, or 4 Kbytes. That means a segment
can have a limit of up to the full addressing range of the base address.
This mechanism allows the 386 to be set up in flat mode where the base
is set to zero, the limit is set to all binary ones (the highest address),
and the granularity bit is set for the 4K intrepretation. So you have
your choices: run the 386 like a 286 with the highest 16 bits set to zero,
take advantage of the additional limit bits and the granularity bit to
pick how large you want your segments to be, or run the 386 in Mot mode.
Technical Details
Message-ID: <3073@rtmvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!rpi!crdgw1!ge-dab!peora!tarpit!rtmvax!wbeebe
References: <1990Jan17.164046.10641@idt.unit.no>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!rpi!crdgw1!ge-dab!peora!tarpit!rtmvax!wbeebe
From: wbeebe@rtmvax.UUCP (Bill Beebe)
Newsgroups: comp.sys.intel
Subject: Re: Segment limits on 80386
Message-ID: <3073@rtmvax.UUCP>
Date: 20 Jan 90 00:52:00 GMT
References: <1990Jan17.164046.10641@idt.unit.no>
Reply-To: wbeebe@rtmvax.UUCP (Bill Beebe)
Organization: RTmVax Public Unix System, Orlando FL
Lines: 32