[BusyBox] errors when working with kernel 2.6.0
Du Chunlei
chunlei.du at samsung.com
Mon Apr 26 06:41:16 UTC 2004
Hi all,
I am trying to build a ramdisk based on busybox-1.00-pre8.
It works very well in linux-2.4.21. The shell(/bin/sh in the ramdisk) can end properly by applying command "exit". Meanwhile, the init process will be waken up from wait() system call, and print such message as "Press ENTER to start the shell!" . After enter key is hit, init process will recreate shell thread(/bin/sh).
However, when working against kernel 26, after I applied 'exit' command in the shell, _exit had been called, but the init process had not been waken up from wait(), and the system remained in cpu_arm920_do_idle().
The problem is , in one word, why init process can not be waken up from wait() system call when /bin/sh which is one of its children alread dead.
I do not know if following information can give some hints.
After I built busybox-1.00-pre8, it worked pretty well with linux-2.4.18. But, when working with linux-2.6.0, nothing was displayed after the kernel message of "Freeing init memory: 48K". So I added two message() statements as follows in init_main() function in init/init.c, and then it could work like I discribed before.
/* Figure out where the default console should be */
console_init();
//added by Du 2004 0423
message(CONSOLE, "\r After console_init() and before close(0/1/2)!\n");
/* Close whatever files are open, and reset the console. */
close(0);
close(1);
close(2);
if (device_open(console, O_RDWR | O_NOCTTY) == 0) {
//added by Du 2004 04 26
message(CONSOLE, "\rbefore set_term()!\n");
set_term(0);
close(0);
}
chdir("/");
setsid();
{
const char * const *e;
/* Make sure environs is set to something sane */
for(e = environment; *e; e++)
putenv((char *) *e);
}
/* Hello world */
message(MAYBE_CONSOLE | LOG, "init started: %s", bb_msg_full_version);
Any suggestion will be appreciated.
Regards,
Du
More information about the busybox
mailing list