Re: Future of ELKS

Gábor Lénárt
2004-05-24T09:42:08Z

On Fri, May 21, 2004 at 02:38:59PM -0400, Jody wrote:
> I was trying to hint that we should try to use less than 64KB per process
> in another unquoted snippet...I don't know everything about 8086's but I do

You can use even 1 byte granulity if you wish, sure it's now hw based.
Segmenting in real mode (as 8086 does) only means that a 64K "window"
starts at every 16 bytes. Sure these "windows" (segments) are overlapping
each other! I mean:

linear_address="segment_address"*16+offset

where "segment_address" is the number you write into the segment registers
(CS,DS,ES,SS, and FS and GS in the case of 386+). Of course you can say
that at (segment:offsset) 0x1000:0 you have a memory allocation using
32 bytes memory, and at 0x1002:0 you have another block and such. The
only problem that there is no hw protection so setting data segment register
(DS) to 0x1000 you should NOT write offsets greater than 0x1F (decimal 31),
since you have got 32 bytes there, remember?

The 64K is the maximum. Like in 286 protected mode, but there you have got
hw mechanism to limit eg to 32 byte, and an exception will be generated if
you try to use an offset greater than the size of the segment (in protected
mode segment registers stores selectors which are indices in the LDT or GDT
- local/global descriptor tables, which are describing linear starting
address of the segment, protection and so on).

And at 386, you can choose between byte or page granility, with selecting
page granulity (4096 bytes) you can create 4G wide segment. That is the
so called linear addressing used by almost all modern OSes on 386+. This
is possible, since there is another mechanism over segmenting at 386+ named
paging. But is's another story :)

- Gábor (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 http://vger.kernel.org/majordomo-info.html