Thanks all for ur replies.<br>I gave a try to create a new rootfile system (ext2) by following the procedure in <a href="http://free-electrons.com">free-electrons.com</a> and examples in the busybox folder.<br>Surprisingly, it got built properly and run upto the same point and doesn't accept any commands i'm typing.<br>
I haven't added serial related stuff (gettty) in the inittab/rcS file as I am still not much clear about it.<br><br><br><b>My board setup is :</b><br>I am using JTAG debugger to load the kernel and root file system (DRAM controller initilization is done through JTAG) & then kernel and rootfs are loaded.<br>
I am getting the "printk" messages in terminal program (tera-term running in PC)<br><br>Since,I am not using bootloader ,I enable console prints in the call to cosole_init in start_kernel (by adding the flags CONSOLE_PRINTBUFFER | CON_ENABLED in the struct console)<br>
Once call to console_init happens,I am starting to get print messages.<br><br><b>My query is:</b><br>At later point after file system mounted, is this same console used for login? (i'm having only one UART port in my board -> ttySAC0)<br>
Am I getting this err (/bin/sh: can't access tty; job control turned off) because console is locked already for printk's?<br><b>What changes are needed in the inittab & /etc/init.d/rcS file to get the working shell prompt</b> <b>for this scenario</b>?<br>
<br><b>below are the console messages:</b><br>RAMDISK: ext2 filesystem found at block 0<br>RAMDISK: Loading 3072KiB [1 disk] into ram disk... \<br>done.<br>VFS: Mounted root (ext2 filesystem) readonly on device 1:0.<br>Freeing init memory: 80K<br>
<b>/bin/sh: can't access tty; job control turned off</b><br>/ #<br><br><br><b> /etc/inittab file contents</b><br># This is run first script<br>::sysinit:/etc/init.d/rcS<br># Start an "askfirst" shell on the console<br>
::askfirst:/bin/sh<br># Stuff to do when restarting the init process<br>::restart:/sbin/init<br># Stuff to do before rebooting<br>::ctrlaltdel:/sbin/reboot<br>::shutdown:/bin/umount a r <br><br><b>/etc/init.d/rcS file contents </b><br>
#!/bin/sh<br>mount t proc none /proc<br>mount t sysfs none /sys<br>exec /sbin/sh<br>/bin/sh<br><br><br>plz suggest me the changes required to get working shell prompt..<br><br>Thanks,<br><br><br><br><br><br><div class="gmail_quote">
On Mon, May 7, 2012 at 7:31 PM, Adam Lee <span dir="ltr"><<a href="mailto:adam8157@gmail.com" target="_blank">adam8157@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, May 07, 2012 at 06:21:05PM +0530, pcuser p wrote:<br>
> I am ending up in the shell prompt with the message as below:<br>
> "entered linuxrc script"<br>
> "/bin/sh: can't access tty; job control turned off<br>
> / $"<br>
><br>
</div><div class="im">> my kernel commad line is<br>
> "mem=32M console=ttySAC0,115200 root=/dev/ram0 init=/linuxrc initrd=<br>
> 0x80800000,8M user_debug=31"<br>
<br>
</div>In my kernel command line(with busybox), init=/sbin/init, I drop<br>
commands into /etc/profile.<br>
<div class="im"><br>
> Below are my /linuxrc and /etc/inittab file contents<br>
> linuxrc:<br>
><br>
> #!/bin/sh<br>
> /bin/echo "entered linuxrc script"<br>
> /bin/sh<br>
> exec /sbin/init<br>
<br>
</div>Don't run sh before init, this makes the warning.<br>
<br>
> /etc/inittab:<br>
<div class="im">><br>
> # Run gettys in standard runlevels<br>
> 3:2345:respawn:/sbin/getty 115200 ttySAC0<br>
><br>
<br>
</div>runlevels makes no sense here, but it should be OK.<br>
<br>
<br>
And, I use busybox to build the rootfs for kernel debugging:<br>
<a href="https://github.com/adam8157/kernel-studio" target="_blank">https://github.com/adam8157/kernel-studio</a><br>
the rootfs making script is at here right now:<br>
<a href="https://github.com/adam8157/kernel-studio/blob/master/mkrootfs" target="_blank">https://github.com/adam8157/kernel-studio/blob/master/mkrootfs</a><br>
Might helps.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Regards,<br>
Adam Lee<br>
--------------------------------<br>
E-mail: <a href="mailto:adam8157@gmail.com">adam8157@gmail.com</a><br>
Website: <a href="http://adam8157.info" target="_blank">http://adam8157.info</a><br>
--------------------------------<br>
</font></span></blockquote></div><br>