Skip to contentSkip to conversation

405 -- a little console help, part 2

DISCUSSION Mark Pilon 5 participants 7 messages Nov 8, 2001 – Nov 11, 2001

lore
Share & tools
lore

Mark Pilon

author
#0 lore raw

I've got a little more info -- /bin/sash doesn't produce any output and just sits there, echoing charachters typed. I'll try poking around w/ gdb/abatron but am not sure how to find the exec'd shell.

if I spawn ash w/ init=/bin/ash:
...
Looking up port of RPC 100003/2 on 192.168.200.4
Looking up port of RPC 100005/1 on 192.168.200.4
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 56k init
executing init = /bin/ash
sh: can't access tty; job control turned off
#

-- but at least I get a prompt and it seems to work.

I'm not sure what the message "can't access tty; job control turned off" means -- I'll have to get the source for ash and debug it.

I would have thought that spawning init=/bin/sash would have been the easiest.

the target filesystem is pieces of mvista's hhl2.0 target for ppc405.

Since I'm nfs mounting it, I'm going to just mount the whole thing and see if what I need turns up; it'd be nice to know for those wanting to run a more spare system.

Mark
--
Mark Pilon

Minolta-QMS
P.O. Box 37
Fallon, MT. 59326-0037

1-406-853-0433

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 8 lines · Mark Pilon

I've got a little more info -- /bin/sash doesn't produce any output and just sits there, echoing charachters typed. I'll try poking around w/ gdb/abatron but am not sure how to find the exec'd shell.

if I spawn ash w/ init=/bin/ash:
...
-- but at least I get a prompt and it seems to work.

That is very odd, I don't know why ash would work and sash does not. Very strange indeed.

Quoted 2 lines

I'm not sure what the message "can't access tty; job control turned off" means -- I'll have to get the source for ash and debug it.

This sounds like you do not have proper /dev/* populated.. i.e. /dev/console, /dev/tty, /dev/pts, etc. For initial system bringup you can ignore that warning. (However, keep in mind that ctrl-C, ctrl-Z, etc job control will not work..) This might also partially be a symptom of ash starting as process 1, process 1 contains special rules in the kernel as it is the init process.

--Mark

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#6 lore raw
In reply to Mark Pilon
Quoted 2 lines · Mark Pilon

I'll try poking
around w/ gdb/abatron but am not sure how to find the exec'd shell.

I hacked up some user defined functions in gdb to let me do ps and some other things that I found useful for kernel debugging. I've attached my .gdbinit so you can see what I did. Warning:
there are some processor specific bits in some of the functions, but the ps function "should just work".

Scott Anderson

#2 lore raw
In reply to Mark Hatle
Quoted 7 lines · Mark Hatle
Quoted 5 lines · Mark Pilon

I've got a little more info -- /bin/sash doesn't produce any output and just sits there, echoing charachters typed. I'll try poking around w/ gdb/abatron but am not sure how to find the exec'd shell.

Quoted 5 lines
Quoted 2 lines

if I spawn ash w/ init=/bin/ash:
...

That is very odd, I don't know why ash would work and sash does not. Very strange indeed.

Ah, I think I know why this might be - are you using the 2_4_devel tree?

All static executables segfaulted before reaching main until very
recently: the 4xx's MMU makes it possible to actually enforce the execute permission bit on pages. Since most processors don't allow this, however, there are heaps of bugs in userland (binutils etc.) where pages aren't marked executable that need to be. In this case there was instruction just before the got that wasn't marked executable.

For now, at least, I've disabled enforcement of the page execute permissions, because there's just too much stuff that breaks with it on.

--
David Gibson | For every complex problem there is a
[email protected] | solution which is simple, neat and
| wrong. -- H.L. Mencken
http://www.ozlabs.org/people/dgibson

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

author
#3 lore raw
Quoted 12 lines · David Gibson

Ah, I think I know why this might be - are you using the 2_4_devel tree?

All static executables segfaulted before reaching main until very
recently: the 4xx's MMU makes it possible to actually enforce the execute permission bit on pages. Since most processors don't allow this, however, there are heaps of bugs in userland (binutils etc.) where pages aren't marked executable that need to be. In this case there was instruction just before the got that wasn't marked executable.

Quoted 3 lines

For now, at least, I've disabled enforcement of the page execute permissions, because there's just too much stuff that breaks with it on.

What's the fix for this? It sounds like I want to un-do that change enforcing page execute permissions -- David, could you give me a spot to look and a suggested patch? anyone?

thanks,

Mark
--
Mark Pilon

Minolta-QMS
P.O. Box 37
Fallon, MT. 59326-0037

1-406-853-0433

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#4 lore raw
Quoted 13 lines · Mark Pilon
Quoted 12 lines · David Gibson

Ah, I think I know why this might be - are you using the 2_4_devel tree?

All static executables segfaulted before reaching main until very
recently: the 4xx's MMU makes it possible to actually enforce the execute permission bit on pages. Since most processors don't allow this, however, there are heaps of bugs in userland (binutils etc.) where pages aren't marked executable that need to be. In this case there was instruction just before the got that wasn't marked executable.

Quoted 7 lines
Quoted 3 lines

For now, at least, I've disabled enforcement of the page execute permissions, because there's just too much stuff that breaks with it on.

What's the fix for this? It sounds like I want to un-do that change enforcing page execute permissions -- David, could you give me a spot to look and a suggested patch? anyone?

I've checked the fix into the latest linuxppc_2_4_devel. Failing that, look in do_page_fault() in arch/ppc/mm/fault.c, look for a test against vma->flags & VM_EXEC, and remove it.

--
David Gibson | For every complex problem there is a
[email protected] | solution which is simple, neat and
| wrong. -- H.L. Mencken
http://www.ozlabs.org/people/dgibson

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#5 lore raw

Hi,

Quoted 4 lines · David Gibson

I've checked the fix into the latest linuxppc_2_4_devel. Failing that, look in do_page_fault() in arch/ppc/mm/fault.c, look for a test against vma->flags & VM_EXEC, and remove it.

I've got similiar problem, just that Seg faults form Dynamically linked programs is just a beginning...
When I boot from ramdisk all programs work fine... aka mount, ls, bash... but when I try to boot from disk (root=/dev/hda2 for example) my init prints 'Bug in dynamic linker: dynamic-link.h in line 62' (it might be slightly changed because I wrote it from head, but error describes same informations). So I checked in glibcs what this error is and I found out that assertion was caused because of 'bad dynamic tag'.
If I mount disk from ramdisk and try to execute programs the same happens... if they are dynamically compiled the same bug ('bad dynamic tag') happens. I use linuxppc_2_4_devel kernel from mvista, daytagged from last wednesday (7.11.2001), glibcs from HardHat linux (precompiled for IBM 405 gp).

Has anyone same problems? Could it be another bug in standard libarires? Anywhere else in cross-compiler enviroment... binutils maybe?

Regards, Jure

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/