www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/16/09:00:08

From: "Alexei A. Frounze" <alex DOT fru AT mtu-net DOT ru>
Newsgroups: comp.os.msdos.djgpp
Subject: Fwd: Re: Help with Inline ASM...
Date: Sun, 16 Apr 2000 13:28:56 +0400
Organization: MTU-Intel ISP
Lines: 65
Message-ID: <38F987D8.74145BAE@mtu-net.ru>
NNTP-Posting-Host: ppp97-187.dialup.mtu-net.ru
Mime-Version: 1.0
X-Trace: gavrilo.mtu.ru 955887115 21507 212.188.97.187 (16 Apr 2000 12:11:55 GMT)
X-Complaints-To: usenet-abuse AT mtu DOT ru
NNTP-Posting-Date: 16 Apr 2000 12:11:55 GMT
X-Mailer: Mozilla 4.72 [en] (Win95; I)
X-Accept-Language: en,ru
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> 
> On Fri, 14 Apr 2000, Alexei A. Frounze wrote:
> 
> > Please read all the following text until its end. Then reply.
> 
> I thought I always did that, no need to remind me.

I tell this because it seems to me that people start replying immediately. I.e.
they read a section and reply, read another section and reply and so on. This
very often means they *loose general idea behind* all my message. They simply
skip it.

> 
> > You're right, we can not modify segment marked as executable/read. But since
> > data segment is mapped on the code segment as well, you may modify it just
> > uding the DS selector.
> 
> Yes, this is done on purpose, so that interrupt and exception handlers
> could access crucial variables safely (since only CS is known to be
> valid in an interrupt or exception handler).  The DJGPP library actually
> uses this to provide several important features, like signals and FP
> emulation.


> We seem to use two very different definitions of what ``flat memory
> model'' is.
> 
> According to my definition, the flat model is when any linear address
> can be accessed without reloading the segment registers.  DJGPP
> doesn't allow this (for example, you need _dos_ds to access the
> conventional memory), so its memory model is not flat.

:)))
Not really. GCC was not developed for *DOS* and *DPMI*. It's just a free 32-bit
GNU C/C++ compiler for i386+. And it may be compiled for Windows as well as for
DOS/DPMI. Btw, it's available for Linux... Originally it doesn't support any
segment reloads at all. Just 32-bit offsets. Doesn't this mean that DJGPP/GCC
works in a flat memory model??? Yes it means, because support for real mode DOS
with all those segments/selectors is a specific case and nothing else. Yes, it's
specific, although most of people use this specific thingy. It's specific for
compiler itself but not for users. :)

> This all was discussed to death in a thread that I mentioned in my
> message.  I suggest to find it in the DJGPP archives and read it.

I have no need. *Original* post was about *modifying code segment*. And I tried
to tell that it's possible by refering to code segment part with segment
register override. I.e. using "mov [ds:xxx]" instead of "mov [cs:xxx]" where xxx
is a label in the code segment.

> Page-level protection is not supported by most DPMI servers, so DJGPP
> cannot use it.
> 
> But that has nothing to do with flat memory model.

This again means that modifying the code segment is possible.

bye.
Alexei A. Frounze
-----------------------------------------
Homepage: http://alexfru.chat.ru
Mirror:   http://members.xoom.com/alexfru


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019