Swap space - The Answer

Martin Neubauer m.ne at gmx.net
Tue Nov 12 08:14:15 PST 2002


At 03:18 12.11.02 +0100, you wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
> > >Of course the counter is data! But what happens when the counters address
> > > is in the code segment? Will the code segment be swapped or will it be
> > > dropped out of memory and later re-read from filesystem?
> > Anything that is dynamic is part of data, and that includes pointers.
>
>No here's an example in pseudo assembler (as my ast assembler experience was
>on 16bit machines):
>
>mov ip,bx
>jump [bx+128]
>nop
>nop
>nop
>nop
>nop
>nop
>nop
>nop
>mov [bx+64],ax
>inc ax
>mov ax,[bx+64]
>
>As you can seem we make a jump over the pointer and then increase the pointer
>that is somewhere at the nop's.
>All this can be in the code segment - no need for pointers.
>As I remeber that was the general solutions for .com-files in DOS as these
>files have limited segment sizes and amounts. (I think only one 64k code
>segment, no data segments; but this was quite long ago.)
>

Well, on 32-bit machines it is common that the code segment is not 
writeable. (It's just because real computers are not strictly of a von 
Neumann architecture). Even Win32 does that.

Hope it clears a bit,

Martin Neubauer


-- 

"But where will I go?"
"Somewhere where they know nothing about computing...where they wouldn't 
know a RAM chip from a potato chip!"
"But I don't want to visit Microsoft!"
    The Bastard Operator from Hell - http://bofh.ntk.net

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list