Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Lost when execve-ing the init.
@ 2002-03-23  4:48 Muthukumar Ratty
  2002-03-30  7:53 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Muthukumar Ratty @ 2002-03-23  4:48 UTC (permalink / raw)
  To: linux-mips


Hi,
I was trying a kernel I made and found that I got lost after it goes to
execve("/sbin/init") in init/main.c. I can ping the board which means the
board is alive. I tried to trace it down but got stuck with the following
code in "include/asm-mips/unistd.h" [ I believe it implements 
the execve function since in the same file I have .....
static inline _syscall3(int,execve,const char *,file,char **,argv,char
**,envp)] 

------------------------------------------------------------------------------

#define _syscall3(type,name,atype,a,btype,b,ctype,c) \
type name (atype a, btype b, ctype c) \
{ \
long __res, __err; \
__asm__ volatile ("move\t$4,%3\n\t" \
                  "move\t$5,%4\n\t" \
                  "move\t$6,%5\n\t" \
                  "li\t$2,%2\n\t" \
                  "syscall\n\t" \
                  "move\t%0, $2\n\t" \
                  "move\t%1, $7" \
                  : "=r" (__res), "=r" (__err) \
                  : "i" (__NR_##name),"r" ((long)(a)), \
                                      "r" ((long)(b)), \
                                      "r" ((long)(c)) \
                  : "$2","$4","$5","$6","$7","$8","$9","$10","$11","$12",
\
                    "$13","$14","$15","$24"); \
if (__err == 0) \
        return (type) __res; \
errno = __res; \
return -1; \
}
---------------------------------------------------------------------------

I guess...
After setting up the arguments its referencing (#defined ???) syscall. I
couldnt find the definition for "syscall". Could someone point me to the 
right place (and help me get some sleep please ;). Also any idea about how
to debug this. (Can I set breakpoint in syscall3??). (Any idea why its not
going.. error in my irq setup??...)

Thanks a lot,
Muthu.

PS : what does this funny thing mean???

   : "=r" (__res), "=r" (__err) \
                  : "i" (__NR_##name),"r" ((long)(a)), \
                                      "r" ((long)(b)), \
                                      "r" ((long)(c)) \
                  : "$2","$4","$5","$6","$7","$8","$9","$10","$11","$12",
\
                    "$13","$14","$15","$24"); \
if (__err == 0) \
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-30  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-23  4:48 Lost when execve-ing the init Muthukumar Ratty
2002-03-30  7:53 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox