Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #18759

Re: x86 real mode

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail
From Hans-Bernhard Bröker <HBBroeker@t-online.de>
Newsgroups comp.arch.embedded
Subject Re: x86 real mode
Date Sat, 18 Oct 2014 00:09:31 +0200
Lines 46
Message-ID <cadicpFqakoU1@mid.dfncis.de> (permalink)
References <m1r8pj$che$1@speranza.aioe.org> <pcn24a9869skgfal4rqrpn32mgu8dk5201@4ax.com> <m1s1tc$fim$1@speranza.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.dfncis.de JB3jcp/PFYbLNE0ZgmFn/AqnIkYX2fBUrZZijO2SEWhaoldXdygXBOKxG+
Cancel-Lock sha1:4j5uTEH455apHgio4GnjKIEZbBA=
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
In-Reply-To <m1s1tc$fim$1@speranza.aioe.org>
Xref csiph.com comp.arch.embedded:18759

Show key headers only | View raw


Am 17.10.2014 um 23:32 schrieb Don Y:

> It seems the "safest" (most conservative) assumption is to figure
> a single 64KB address space.

Huh?  How do you figure that the possibility that causes your own code 
to make _the_most_ assumptions about the behaviour of unknown, 
surrounding code, to be the _safest_?  When did it become safe to make 
unwarranted assumptions?

> If, instead, the x86 ALWAYS prepared
> a separate data space (etc), then I could assume a larger model.

Well, yes, it essentially always does just that.  All code addressing is 
relative to CS, all data addressing is relative to DS or SS, at least by 
default.  And since all those are allowed to be different, the only 
a-priori _safe_ assumption obviously is that they will be.

> Or, if the tiny model was IMPRACTICAL for any use

It's practical if the program is small enough to allow it, and the 
program loader being used supports it.

The usual one at the time did: tiny model is what MS-DOS *.com format 
programs use.  They're copied verbatim from disk to RAM (beginning 0x100 
bytes into a 64 KB page) , then all three primary segment registers are 
set to the start of that RAM region (i.e. CS=DS=SS=constant) and the 
loader just jumps to CS::0x0100.  So code and pre-initialized data are 
in one big block of RAM.  The remainder of those 64K are assumed to be 
used for .bss and stack.

The advantage was that the program loader doesn't have to make any code 
modifications to handle relocation of the code ... all addresses in the 
code are just offsets relative to the load base, which itself doesn't 
ever appear in the code, because it's kept in the segment registers.

The disadvantage was that the loader _didn't_ perform relocations, so 
there was no way to load bigger programs.  So along came the EXE program 
file format, which is a whole different kettle of fish.

> I.e., it seems safe to assume the tiny model was intended to be
> *usable* and not just "an engineering/marketing exercise".

It stopped being truly usable when programs outgrew 64 KB for code and 
all(!) data combined.

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

x86 real mode Don Y <this@is.not.me.com> - 2014-10-17 07:23 -0700
  Re: x86 real mode Arlet Ottens <usenet+5@c-scape.nl> - 2014-10-17 16:31 +0200
    Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-17 07:45 -0700
      Re: x86 real mode Arlet Ottens <usenet+5@c-scape.nl> - 2014-10-17 16:53 +0200
        Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-17 08:28 -0700
          Re: x86 real mode Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2014-10-17 18:35 +0300
          Re: x86 real mode Arlet Ottens <usenet+5@c-scape.nl> - 2014-10-17 17:36 +0200
            Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-17 13:54 -0700
              Re: x86 real mode Grant Edwards <invalid@invalid.invalid> - 2014-10-17 21:02 +0000
                Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-17 14:54 -0700
              Re: x86 real mode upsidedown@downunder.com - 2014-10-18 10:09 +0300
          Re: x86 real mode Grant Edwards <invalid@invalid.invalid> - 2014-10-17 16:11 +0000
      Re: x86 real mode Stefan Reuther <stefan.news@arcor.de> - 2014-10-17 18:37 +0200
      Re: x86 real mode Les Cargill <lcargill99@comcast.com> - 2014-10-17 12:58 -0500
  Re: x86 real mode David Brown <david.brown@hesbynett.no> - 2014-10-17 16:52 +0200
    Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-17 16:45 +0000
  Re: x86 real mode Robert Wessel <robertwessel2@yahoo.com> - 2014-10-17 10:03 -0500
  Re: x86 real mode Grant Edwards <invalid@invalid.invalid> - 2014-10-17 16:07 +0000
  Re: x86 real mode upsidedown@downunder.com - 2014-10-17 19:57 +0300
  Re: x86 real mode Les Cargill <lcargill99@comcast.com> - 2014-10-17 12:57 -0500
  Re: x86 real mode Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2014-10-17 21:18 +0300
    Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-17 21:48 +0000
      Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-17 15:06 -0700
        Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-17 22:25 +0000
          Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-17 15:39 -0700
            Re: x86 real mode George Neuner <gneuner2@comcast.net> - 2014-10-17 22:47 -0400
              Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-17 21:10 -0700
                Re: x86 real mode upsidedown@downunder.com - 2014-10-18 11:32 +0300
            Re: x86 real mode upsidedown@downunder.com - 2014-10-18 11:10 +0300
              Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-18 08:20 -0700
                Re: x86 real mode upsidedown@downunder.com - 2014-10-18 20:34 +0300
                Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-18 12:53 -0700
          Re: x86 real mode upsidedown@downunder.com - 2014-10-18 10:30 +0300
          Re: x86 real mode David Brown <david.brown@hesbynett.no> - 2014-10-18 20:22 +0200
      Re: x86 real mode upsidedown@downunder.com - 2014-10-18 10:22 +0300
        Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-18 09:06 +0000
          Re: x86 real mode Robert Wessel <robertwessel2@yahoo.com> - 2014-10-18 08:43 -0500
          Re: x86 real mode Gerd Brix <gbrix@gmx.eu> - 2014-10-18 16:39 +0200
          Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-18 17:52 -0700
            Re: x86 real mode George Neuner <gneuner2@comcast.net> - 2014-10-20 01:35 -0400
              Re: x86 real mode upsidedown@downunder.com - 2014-10-20 10:14 +0300
                Re: x86 real mode George Neuner <gneuner2@comcast.net> - 2014-10-20 14:12 -0400
              Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-20 08:15 -0700
    Re: x86 real mode Les Cargill <lcargill99@comcast.com> - 2014-10-17 18:39 -0500
      Re: x86 real mode Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2014-10-18 10:46 +0300
  Re: x86 real mode George Neuner <gneuner2@comcast.net> - 2014-10-17 15:29 -0400
    Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-17 14:32 -0700
      Re: x86 real mode Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2014-10-18 00:09 +0200
        Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-17 22:31 +0000
          Re: x86 real mode upsidedown@downunder.com - 2014-10-18 12:04 +0300
            Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-18 23:22 +0000
            Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-18 20:59 -0700
      Re: x86 real mode upsidedown@downunder.com - 2014-10-18 11:53 +0300
        Re: x86 real mode Don Y <this@is.not.me.com> - 2014-10-18 09:34 -0700
    Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-17 22:00 +0000
      Re: x86 real mode Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2014-10-18 00:26 +0200
        Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-17 22:36 +0000
      Re: x86 real mode George Neuner <gneuner2@comcast.net> - 2014-10-17 21:45 -0400
        Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-18 03:26 +0000
          Re: x86 real mode Robert Wessel <robertwessel2@yahoo.com> - 2014-10-17 23:26 -0500
            Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-18 05:42 +0000
          Re: x86 real mode Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2014-10-18 10:53 +0300
            Re: x86 real mode glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-10-18 09:12 +0000
        Re: x86 real mode Robert Wessel <robertwessel2@yahoo.com> - 2014-10-17 22:40 -0500
      Re: x86 real mode George Neuner <gneuner2@comcast.net> - 2014-10-17 22:07 -0400

csiph-web