TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: HERMAN SCHONFELD
from: CRAIG HART
date: 1997-07-07 12:15:00
subject: Memory!

Hi..
 HS> CH> Correction to lesson one: in real mode, the 286+ can access 
088kb-16
 HS> CH> bytes of memory. This is achieved by segmentreg=FFFFh offset reg=0 
o
 HS> CH> FFFFh. This is how the 286+ ITSELF operates.
 HS> It can't access 1088kb. A 16-bit pointer can only access up to 2^16
 HS> bytes, or 64kb.
I take it by the phrade '16-bit pointer' that what you mean to say is the
seg:ofs addressing mode. Alhough the 'ofs' has a limit of 64kb in real mode,
it's not really relevant. do the math I mentioned originally. Segment FFFF,
offset 4096, for example:
   FFFF0    (seg)
+   4096    (ofs)
= 104086    (Resultant address)
Clearly this is BEYOND the first megabyte. Try it some time. It works. It's 
how himem.sys 'creates' and accesses the HMA, which is beyond 1Mb, without 
entering protected mode. The only thing himem does is to enable A20 so that 
the addresses don't wrap - but that's an artifact of the IBM-PC Design, NOT 
an artifact of the 80286, which is what we are discussing...
 HS> "When in real mode, the 80x86 processor is has limited access to only
 HS> 1,024 kb using a segment:offset resolution." "Extending DOS, Ray
 HS> Gwin".
Ray is wrong, or rather I'd say he is the victim of making an oversimplistic 
statement- at first it reads correctly, and indeed it is the truth for an 
8088/ 8086/80188/80186... and even the 'default' hardware design of the 286 
based PC..
It is still NOT true for the 80286 ITSELF!!!
Read Microsoft's XMS specifications closely. Pay a lot of Attention to
sections such as:
'DEFINITIONS:
------------
    Extended
    Memory      -   Memory in 80286 and 80386 based machines which is located
                    above the 1MB address boundary.
    High Memory
    Area (HMA)  -   The first 64K of extended memory.  The High Memory
                    Area is unique because code can be executed in it while
                    in real mode.  The HMA officially starts at FFFF:10h
                    and ends at FFFF:FFFFh making it 64K-16 bytes in length.
'
for example.
 HS> CH> Now, hardware incorporated in the **specific design** of the IBM-PC
 HS> CH> effectively disables this feature whilst in real mode. This specifc
 HS> CH> hardware is called the A20 Gate. This feature was included so that
 HS> CH> the design would remain
 HS> 100%
 HS> CH> software compatable with the older, 8086 based design. The fact that
 HS> you
 HS> CH> only program on a PC whose hardware design limits you to 1024kb
 HS> CH> whilst in real mode does not subtract from the fact that the 286+
 HS> CH> it's self does NOT have this limitation.
 HS> I doubt it does, there is no mention of it in the DPMI specification!
the DPMI specification is NOT a bible of the IBM-PC's hardware design. There 
is but one A20 related reference in the DPMI 0.9 specification, and it's in 
the 'programmer's notes' section and it reads thus:
'                o    Unless you have explicitly enabled the A20 address
                      line through the XMS interface, do not assume that
                      memory from  1Mb to  1Mb+64K-16 (the  High  Memory
                      Area) is  addressable once your program is running
                      in protected  mode.   If you  want to  be able  to
                      access the  HMA  then  you  must  enable  the  A20
                      through XMS  before entering  protected mode.  XMS
                      calls are  not supported  in protected mode.  Note
                      that  this   restriction  is  only  important  for
                      software that wishes to access the HMA.  Under all
                      implementations of  DPMI the  physical A20 address
                      line  will   always  be  enabled  while  executing
                      protected mode code.  However, some 80386 specific
                      DPMI implementations simulate 1Mb address wrap for
                      compatibility   reasons.      Under   these   DPMI
                      implementations, the  HMA will  not be  accessible
                      unless  the   A20  is   enabled  through  the  XMS
                      interface.'
It clearly tells you that you are looking in the wrong place, and tells you 
to see the XMS specifications for this information.
 HS> CH> Finally, you can switch on the A20 gate yourelf if you like and 
restor
 HS> CH> the full addresability - you just need to know how to program the
 HS> CH> hardware, or, in this day and age, ask Himem.sys to do it for you.
 HS> Well, perhaps you could give me your "reference" so I could go over
 HS> it, it seems doubtful that they would include that feature.
Well, once again, read the XMS specs. Look at fuctions such as 'global enable 
A20' and the like. For a hardware reference, try the book 'The Undocumented 
PC' by Frank Van Gilluwe (spelling?). To control A20, yourself though, you 
can do it two ways:
AT Method: Use keyboard controller commands D0 and D1
PS/2 Method: Use I/O port 92 bit 1
 HS> CH> AFAIK the 80386 was the first processor to introduce hardware 
upport
 HS> CH> for multi-tasking and task-switching. Care to say how the '286
 HS> CH> implements this so-called 'hardware support'?
 HS> I'll reply to this some other time -- I'm nearly out of time.
I'll be waiting...
       Craig
--- FMail/386 1.20+
---------------
* Origin: Comms Barrier BBS +61.3.9585.1112, +61.3.9583.6119 (3:632/533)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.