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 2,748 of 4,255    |
|    mutazilah@gmail.com to James Harris    |
|    Re: PDOS/86 (1/2)    |
|    20 Jul 21 14:24:27    |
      From: muta...@gmail.com              On Tuesday, July 20, 2021 at 9:30:58 PM UTC+10, James Harris wrote:              > > I am happy to have a separate compilation for 8086       > > vs 80386.              > That's good. It separates specification (the source code) from       > implementation (various CPU modes). But it should give you all kinds of       > possibilities and I don't think you are exploiting the options it gives.       > See below for examples.              I'm not attempting to exploit every option. What I am       trying to do is, with the benefit of hindsight (not sure       if it was possible to determine this the moment the       8086 came out) - restrict my assembler code, my C       library, and my C compiler, and threaten Gates with       NATO air strikes to provide the required MSDOS API,       to write 8086 executables such that the number "4"       was not hardcoded anywhere, and that in the future,       chip manufacturers would potentially provide a chip       that runs those 8086 executables with anything up       to 16-bit segment shift.              I see no advantage to hardcoding the number 4 in my       executables, and it offends my sensibilities to see it.              Note that AmigaOS hardcodes *address* 4 too.              In my own AmigaOS executables I also have the       number 4 (no real choice), but I provide a peer-reviewed       way for the caller of my executables (e.g. some alternate       OS) to provide an alternative to the number 4. Done in a       manner that provides no disadvantage whatsoever,       unless you count a few extra instructions at executable       startup time.              > > But if there are a variety of CPUs that can run 8086       > > executables, and some of them address 1 MiB max,       > > and some of them address 512 MiB max,              > You maybe think that's a lot but I don't see why you would want to limit       > programs like that. For example, why can you not keep to the 16-bit       > integers you want to be part of the 16-bit ecosystem but use 32-bit       > pointers so that programs can address 4G?              It is not me who is limiting it, it is the 80386 not providing       sufficient descriptors to map out the entire 4 GiB.              And regardless, 512 MiB for 8086 executables that run       under a slight variation of MSDOS, or even, real MSDOS,       is a hell of a lot more than anyone else is doing.              And they are 32-bit pointers anyway (large memory model).       They're just not flat. Well they are in fact flat when the       segment shift becomes 16 bits, but the executable is not       aware of that, as it has been built with segmented pointers.              > There are at least three ways to do that:       > * unreal              That won't work on an 8086.              > * 16-bit operations in 32-bit mode              That's what I was originally trying to do, hence the question       about what x'66' does on a real 8086. Thanks to Joe, this       technique has since been improved such that I don't need       to know about x'66'.              Regardless, my new technique is still PM32, depending on       what you're calling "32-bit mode".              > * soft CPU              I don't know what that is. If it's not 8086 instructions it isn't       what I'm trying to achieve. If it is some sort of emulation,       that's not what I'm trying to achieve either.              > > I would       > > like to write code to the lowest common denominator       > > if possible, rather than have 27 sort-of-8086 large       > > memory model variants.              > That's a good goal but /compiled/ code can have two paths along the       > lines of       >       > if I am running on a real 8086       > |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca