hi, zhangfx,
    I followed your advice by adding printf to the do_ri function and
found that when the kernel init the system, this function was called
hundreds of times and then the kernel panic, so it means that there
are illegal instruction exist, but why do_ri will be called so many
times?
    another question is that by add printf to the init source code, I
found that the kernel panics in the open_devnull_stdio,

void open_devnull_stdio(void)
{
    int fd;
    static const char *name = "/dev/__null__";
    if (mknod(name, S_IFCHR | 0600, (1 << 8) | 3) == 0) {
        fd = open(name, O_RDWR);
        unlink(name);
        if (fd >= 0) {
            dup2(fd, 0);    //*************************this call don't
panic the kernel*******************
            dup2(fd, 1);    //*************************panic
here**************************
            dup2(fd, 2);
            if (fd > 2) {
                close(fd);
            }
            return;
        }
    }

    exit(1);
}

as you can see from the source code, the dup2 is a system call, and
the kernel was compiled by using cross-compile from loongson
community, there should no illegal instructions exist?
If it possible the kernel panic at other position and the printf
information don't flush out?

-- 
You received this message because you are subscribed to the Google Groups 
"loongson-dev" group.
To post to this group, send email to loongson-dev@googlegroups.com.
To unsubscribe from this group, send email to 
loongson-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/loongson-dev?hl=en.

Reply via email to