[comp.unix.wizards] Need memory at 0 on SUN

augustss@cs.chalmers.se (Lennart Augustsson) (10/21/88)

I need to run a program on a SUN3 (running SunOS 3.4) with virtual 
read/write memory starting at virtual address 0.  Sun (in their infinite
wisdom) has decided that memory starts at 0x2000.  Accessing 0-0x1fff causes
a segmentation violation (normally I think this is a good idea, but not
this time).  Does anyone know how to get this?  I have already tried obvious
things like other magic numbers, telling the linker to put code at 0...  I've
also tried less obvious things like mapping a part of the screen to address
0 with mmap.  So far all attempts have failed and I would be grateful for any
hints.  (No, we don't have the source code for SunOS 3.4, so modifying
the kernel would be difficult.)



-- 

	Lennart Augustsson
Email:	augustss@cs.chalmers.se or augustss@chalmers.csnet

johng@ecrcvax.UUCP (John Gregor) (10/24/88)

In article <2768@fnatte.cs.chalmers.se> augustss@cs.chalmers.se (Lennart Augustsson) writes:
>I need to run a program on a SUN3 (running SunOS 3.4) with virtual 
>read/write memory starting at virtual address 0.  Sun (in their infinite
>wisdom) has decided that memory starts at 0x2000.  Accessing 0-0x1fff causes
>a segmentation violation
>-- 
>	Lennart Augustsson
>Email:	augustss@cs.chalmers.se or augustss@chalmers.csnet

One possibility would be to keep a 'virtual' copy of page 0 somewhere else.
Then when your program references 0-0x1fff, you catch the fault, disassemble the
offending instruction, and emulate it using your virtual copy of page 0.

No, I don't have something that does this.  Yes, I know it is a horrible
kludge.  If someone has one of these already (or a better solution), I'd
like to know as well.

-- 

John Gregor                                       johng%ecrcvax.UUCP@pyramid.COM

guy@auspex.UUCP (Guy Harris) (10/24/88)

>I need to run a program on a SUN3 (running SunOS 3.4) with virtual 
>read/write memory starting at virtual address 0.  ... Does anyone
>know how to get this?

Not without modifying the kernel.

Why do you assert that you "need" this?