Subject: Re: COMPAT_IRIX, N32, mmap for /dev/zero.
To: GIRISH V . GULAWANI <girishvg@yahoo.com>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: port-mips
Date: 08/13/2002 13:36:32
On 07/23/2002 03:50:42, GIRISH V. GULAWANI <girishvg@yahoo.com> wrote:

I'm a bit late on this question, but since I've wrote the code, I
feel like I have to explain waht's wrong :o)

> After adding COMPAT_IRIX option to the kernel I am
> able to bring up the shell "sh" of IRIX 6.3, which I
> suppose is N32 type. Some other commands basically O32
> are also okay. However commands like elfdump,
> mipscheck fail. The error message appears as --
> rld_sbrk: Can't map /dev/zero -- probably not enough
> virtual memory.

Yes. N32 support is really limited. Basically, IRIX N32 binaries
can work if they never do any system call with 64 bit arguments.
mmap does this (the file offset is 64 bit long), and this is 
why you see a failure there in the ktrace. 

Because mmap won't work, this means no dynamically linked N32
binary can work.

> As I understand its trying to mmap the device
> /dev/zero but since mmap is not initialized & also not
> implemented, the sbrk fails to map. Please note that I
> am just using lib & lib32. I am not emulating IRIX
> devices. 

You don't need to. /dev/zero  will be fine, as soon 
as the N32 problem will be addressed...

> Could anybody please help me in trying to figure out
> how to handle this situation?? 

For now, things are completely stopped on the N32 front. There
is no way to get things working without some 64 bit support
in the toolchain. 

BTW, if you are interested in COMPAT_IRIX implementation, check
my paper series on it at www.onlamp.com

-- 
Emmanuel Dreyfus
manu@netbsd.org