Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.os.development    |    Operating system development chatter    |    4,255 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,246 of 4,255    |
|    wolfgang kern to muta...@gmail.com    |
|    Re: segmentation    |
|    04 Sep 22 01:36:10    |
      From: nowhere@nevernet.at              On 02/09/2022 19:20, muta...@gmail.com wrote:       > On Friday, September 2, 2022 at 6:53:49 PM UTC+8, wolfgang kern wrote:              >> [...]       >>> No, default status is no wraparound, but some       >>> environments may wrap around anyway due to the fact       >>> that there are 20 or fewer address lines.       >> The KEY to wrap around at 1MB once was the A20 gate,       >> it's now just an historical thing found only in museums.       >> PCs don't even have an A20 gate anymore (==always ON).       >>       >> the HMA (0010_0000 aka FFFF:0010..) was very often used       >> by DOS and friends, so they needed A20 ON.       >>       >> easy to make it wrap at 1MB with segment limits.       >> but it will wrap only if the access is aligned while       >> crossing the boundary with a multi-byte instruction       >> end up in a Seg-Fault or with an GP-error if PM.              > Sure. What I'm looking for is a set of rules       > to follow, with the benefit of hindsight.              > From memory, the PSP used when a .com file       > is loaded, makes use of address wrap.              I cannot confirm your assumption above,       .com are organized at 0100 so the PSP is at 0000.       therefore a .com-file is size limited to 63.75K.              Rules ? my rules are according to given hardware.       I'd just recommend to always avoid address wrap [A20 ON].              the inherent backwards addressing uses overflow to make       an unsigned displacement look as if signed [isn't wrap].              for speed reasons my initial ESP=0, it could under-run]       old DOS used a misaligned SP (ffff instead 0) to force       a segment fault on stack under-run [but made all slow].              as you seem to work on virtual machines you can define       whatsoever rules you like :)       You cannot alter any features of existing REAL hardware.              AFAIK x86 is the only CPU family with address Shift-Add. Others       use either banks or two [w/o shift] registers for >64K.       __       wolfgang              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca