Subject: Re: COMPAT_IRIX, N32, mmap for /dev/zero.
To: GIRISH V. GULAWANI <girishvg@yahoo.com>
From: GIRISH V. GULAWANI <girishvg@yahoo.com>
List: port-mips
Date: 07/24/2002 15:33:26
hi.
i checked N32 binary with ktrace+kdump on the command
"mipscheck". it shows the shutdown() call has failed &
that it has returned error as invalid argument. now
what i don't understand is why /dev/zero would call
shutdown which is a socket call. 
after enabling the DEBUG_SYSCALLS, it is confirmed
that rld_sbrk calls mmap() for /emul/irix/dev/zero &
since it isn't there, it calls for /dev/zero. this
mmap() infact has failed. perhaps because, it does not
have handle on zero device. another problem here is,
the device number passed by irix_mmap() through
arguments to sys_mmap() is 0. i'd expect it to be
(2,12). and that is the reason the uvm_mmap() has
failed to see correctly mmmap() implementation for
zero device. instead it returns error, which happens
to match, had it been the zero device handle.
i'd like to know is how to get the device handle &
whether we can implement mmap() in the mem.c for the
zero device?? then how to??
thanks.
girish.


--- "GIRISH V. GULAWANI" <girishvg@yahoo.com> wrote:
> 
> yes i understand (37,0) is not the /dev/zero,
> instead
> its (2,12). infact i am using the latter one only. 
> i am having a standlone init, with couple of basic
> daemons. i am able to execute any O32 command either
> compiled for NetBSD or IRIX. also a N32 command like
> "sh" is also getting executed. 
> i haven't done ktrace for these binaries. thanks for
> suggestion.
> btw, i am running this on Malta board with 64MB RAM.
> is this alright??
> 
> --- Jaromir Dolecek <jdolecek@netbsd.org> wrote:
> > Device (37, 0) is pms0 under NetBSD/i386, it may
> not
> > be even
> > assigned under sgimips. Thus, the
> > /emul/irix/dev/zero device
> > you created was most definitely not okay; if you
> > really feel
> > you need it, it should be softlinked to NetBSD
> > /dev/zero.
> > 
> > Are your process limits bumped high enough? What
> > does
> > ktrace of the binary reveal?
> > 
> > GIRISH V. GULAWANI wrote:
> > > 
> > > Hello, all.
> > > 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.
> > > 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. If I add /emul/irix/dev/zero, device
> > number
> > > (37, 0), even the O32 binaries mentioned above
> do
> > not
> > > work. For example "uname -a" does not work in
> this
> > > case, while it works if I dont add emulation
> > device.
> > > Could anybody please help me in trying to figure
> > out
> > > how to handle this situation?? 
> > > Many thanks & regards,
> > > Girish.
> > > 
> > > 
> > > =====
> > > __________________________________
> > > Girish V. Gulawani.
> > > Tel: +81-90-7406-4009 (mobile)
> > >      +81-44-753-5778  (home)
> > >      (GMT+09:00)
> > > __________________________________
> > > 
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Health - Feel better, live better
> > > http://health.yahoo.com
> > > 
> > 
> > 
> > -- 
> > Jaromir Dolecek <jdolecek@NetBSD.org>
> > http://www.NetBSD.org/Ports/i386/ps2.html
> > -=- We should be mindful of the potential goal,
> but
> > as the tantric    -=-
> > -=- Buddhist masters say, ``You may notice during
> > meditation that you -=-
> > -=- sometimes levitate or glow.   Do not let this
> > distract you.''     -=-
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com