Shubhangi Tamsekar | 27 Nov 2011 21:28
Picon

inferno hosted on Linux with arm

hi,

I have an arm board running qtopia linux. I want to run Inferno as a hosted OS on it. I have Ubuntu on my laptop where I am building it.

So I followed below steps -

  1. modify mkconfig as
  • SYSHOST=Linux
  • SYSTARG=$SYSHOST
  • OBJTYPE=arm
  • set my $PATH variable as PATH=$HOME/inferno/Linux/arm/bin:$PATH
  • ./makemk.sh
    • All goes well I get a message - 'mk binary built successfully!'
  • mk install
    • it goes well to a certain point and then shows an error as -
    (cd limbo; mk  install)
    iyacc -d limbo.y
    /home/inferno/Linux/arm/bin/iyacc: 1: Syntax error: word unexpected (expecting ")")
    mk: iyacc -d limbo.y  : exit status=exit(2)
    mk: for j in ...  : exit status=exit(1)

    Where am I going wrong? Please suggest if I am missing anything or doing something wrong.

    Thanks & regards,
    -Shubhangi

    Charles Forsyth | 28 Nov 2011 00:22
    Picon

    Re: inferno hosted on Linux with arm

    iyacc needs to be of the same cpu type as your Ubuntu (as do the build
    functions).
    You've built the arm version of iyacc, but that is interpreted as a
    shell script on x86.
    (It's a bit stupid that something doesn't complain about an
    incompatible architecture, and
    I think it's something in the Linux environment that's at fault there,
    nothing directly to do with Inferno.)
    
    You don't need PATH=$HOME/inferno/Linux/arm/bin:...
    because you're not running on the arm. Instead you need the 386 directory (if
    the Ubuntu is on some variant of x86). With OBJTYPE=arm, SYSTARG=Linux,
    mkfiles/mkfile-Linux-arm will expect an arm-gcc somewhere in the PATH,
    as a gcc-based cross-compiler running on x86 generating code for the ARM.
    (You can change the mkfile if some other cross-compiler name is appropriate.)
    
    
    Alberto Estenaga | 28 Nov 2011 05:39
    Picon

    Re: inferno hosted on Linux with arm

    UNSUBSCRIBE ME PLEASE

    On Mon, Nov 28, 2011 at 10:22 AM, Charles Forsyth <charles.forsyth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
    iyacc needs to be of the same cpu type as your Ubuntu (as do the build
    functions).
    You've built the arm version of iyacc, but that is interpreted as a
    shell script on x86.
    (It's a bit stupid that something doesn't complain about an
    incompatible architecture, and
    I think it's something in the Linux environment that's at fault there,
    nothing directly to do with Inferno.)

    You don't need PATH=$HOME/inferno/Linux/arm/bin:...
    because you're not running on the arm. Instead you need the 386 directory (if
    the Ubuntu is on some variant of x86). With OBJTYPE=arm, SYSTARG=Linux,
    mkfiles/mkfile-Linux-arm will expect an arm-gcc somewhere in the PATH,
    as a gcc-based cross-compiler running on x86 generating code for the ARM.
    (You can change the mkfile if some other cross-compiler name is appropriate.)

    Shubhangi Tamsekar | 28 Nov 2011 22:02
    Picon

    Re: inferno hosted on Linux with arm

    Thanks Charles.

    1. I changed the path to PATH=$HOME/inferno/Linux/386/bin
    2. set appropriate cross compiler name in mkfile-linux-arm
    3. and then do mk install
    Now it is able to pass beyond iyacc however, it is stuck mysteriously for limbo. Here are the error messages that I get -


    rm -f /home/inferno/Linux/arm/bin/limbo && cp o.out /home/inferno/Linux/arm/bin/limbo
    (cd libinterp; mk  install)
    /home/inferno/Linux/arm/lib/libinterp.a doesn't exist: assuming it will be an archive
    rm -f runt.h && limbo -a -I../module ../module/runt.m > runt.h
    sh: limbo: not found
    mk: rm -f runt.h ...  : exit status=exit(127), deleting 'runt.h'
    mk: for j in ...  : exit status=exit(1)


    Now what is wrong with my Limbo? I can see mk, iyacc and limbo files in my /inferno/Linux/arm/bin/ folder.

    Any idea?

    On Mon, Nov 28, 2011 at 4:52 AM, Charles Forsyth <charles.forsyth <at> gmail.com> wrote:
    iyacc needs to be of the same cpu type as your Ubuntu (as do the build
    functions).
    You've built the arm version of iyacc, but that is interpreted as a
    shell script on x86.
    (It's a bit stupid that something doesn't complain about an
    incompatible architecture, and
    I think it's something in the Linux environment that's at fault there,
    nothing directly to do with Inferno.)

    You don't need PATH=$HOME/inferno/Linux/arm/bin:...
    because you're not running on the arm. Instead you need the 386 directory (if
    the Ubuntu is on some variant of x86). With OBJTYPE=arm, SYSTARG=Linux,
    mkfiles/mkfile-Linux-arm will expect an arm-gcc somewhere in the PATH,
    as a gcc-based cross-compiler running on x86 generating code for the ARM.
    (You can change the mkfile if some other cross-compiler name is appropriate.)

    Charles Forsyth | 28 Nov 2011 22:31
    Picon

    Re: inferno hosted on Linux with arm

    it's a little devious, but it does look as though it should be all
    right in the end.
    
    similarly to iyacc, you need limbo as an x86 executable. possibly the
    best thing is to
    mk install Inferno with OBJTYPE=386, to get all the supporting commands,
    including limbo (the Limbo compiler), then set OBJTYPE=arm, and mk install
    to get the ARM-hosted version. I'd have written this up earlier except that:
     a. I didn't think of it
     b. to be fair, cross-compilation on non-Plan 9 systems to make other
    hosted systems is relatively new
     c. it was trivial under Plan 9, because cross-compilation is there by default,
         although in retrospect, there's a similar assumption (that the
    source system
         compilers have been made).
    
    On 28 November 2011 21:02, Shubhangi Tamsekar
    <shubhangi.tamsekar@...> wrote:
    > Thanks Charles.
    >
    > I changed the path to PATH=$HOME/inferno/Linux/386/bin
    > set appropriate cross compiler name in mkfile-linux-arm
    > and then do mk install
    >
    > Now it is able to pass beyond iyacc however, it is stuck mysteriously for
    > limbo. Here are the error messages that I get -
    >
    >
    > rm -f /home/inferno/Linux/arm/bin/limbo && cp o.out
    > /home/inferno/Linux/arm/bin/limbo
    > (cd libinterp; mk  install)
    > /home/inferno/Linux/arm/lib/libinterp.a doesn't exist: assuming it will be
    > an archive
    > rm -f runt.h && limbo -a -I../module ../module/runt.m > runt.h
    > sh: limbo: not found
    > mk: rm -f runt.h ...  : exit status=exit(127), deleting 'runt.h'
    > mk: for j in ...  : exit status=exit(1)
    >
    >
    > Now what is wrong with my Limbo? I can see mk, iyacc and limbo files in my
    > /inferno/Linux/arm/bin/ folder.
    >
    > Any idea?
    >
    > On Mon, Nov 28, 2011 at 4:52 AM, Charles Forsyth <charles.forsyth <at> gmail.com>
    > wrote:
    >>
    >> iyacc needs to be of the same cpu type as your Ubuntu (as do the build
    >> functions).
    >> You've built the arm version of iyacc, but that is interpreted as a
    >> shell script on x86.
    >> (It's a bit stupid that something doesn't complain about an
    >> incompatible architecture, and
    >> I think it's something in the Linux environment that's at fault there,
    >> nothing directly to do with Inferno.)
    >>
    >> You don't need PATH=$HOME/inferno/Linux/arm/bin:...
    >> because you're not running on the arm. Instead you need the 386 directory
    >> (if
    >> the Ubuntu is on some variant of x86). With OBJTYPE=arm, SYSTARG=Linux,
    >> mkfiles/mkfile-Linux-arm will expect an arm-gcc somewhere in the PATH,
    >> as a gcc-based cross-compiler running on x86 generating code for the ARM.
    >> (You can change the mkfile if some other cross-compiler name is
    >> appropriate.)
    >
    >
    
    
    dorin bumbu | 28 Nov 2011 22:56
    Picon

    Re: inferno hosted on Linux with arm

    check if the /home/inferno/Linux/arm/lib/ folder exists. if not create
    it by hand.
    
    On Mon, Nov 28, 2011 at 11:02 PM, Shubhangi Tamsekar
    <shubhangi.tamsekar@...> wrote:
    > Thanks Charles.
    >
    > I changed the path to PATH=$HOME/inferno/Linux/386/bin
    > set appropriate cross compiler name in mkfile-linux-arm
    > and then do mk install
    >
    > Now it is able to pass beyond iyacc however, it is stuck mysteriously for
    > limbo. Here are the error messages that I get -
    >
    >
    > rm -f /home/inferno/Linux/arm/bin/limbo && cp o.out
    > /home/inferno/Linux/arm/bin/limbo
    > (cd libinterp; mk  install)
    > /home/inferno/Linux/arm/lib/libinterp.a doesn't exist: assuming it will be
    > an archive
    > rm -f runt.h && limbo -a -I../module ../module/runt.m > runt.h
    > sh: limbo: not found
    > mk: rm -f runt.h ...  : exit status=exit(127), deleting 'runt.h'
    > mk: for j in ...  : exit status=exit(1)
    >
    >
    > Now what is wrong with my Limbo? I can see mk, iyacc and limbo files in my
    > /inferno/Linux/arm/bin/ folder.
    >
    > Any idea?
    >
    > On Mon, Nov 28, 2011 at 4:52 AM, Charles Forsyth <charles.forsyth <at> gmail.com>
    > wrote:
    >>
    >> iyacc needs to be of the same cpu type as your Ubuntu (as do the build
    >> functions).
    >> You've built the arm version of iyacc, but that is interpreted as a
    >> shell script on x86.
    >> (It's a bit stupid that something doesn't complain about an
    >> incompatible architecture, and
    >> I think it's something in the Linux environment that's at fault there,
    >> nothing directly to do with Inferno.)
    >>
    >> You don't need PATH=$HOME/inferno/Linux/arm/bin:...
    >> because you're not running on the arm. Instead you need the 386 directory
    >> (if
    >> the Ubuntu is on some variant of x86). With OBJTYPE=arm, SYSTARG=Linux,
    >> mkfiles/mkfile-Linux-arm will expect an arm-gcc somewhere in the PATH,
    >> as a gcc-based cross-compiler running on x86 generating code for the ARM.
    >> (You can change the mkfile if some other cross-compiler name is
    >> appropriate.)
    >
    >
    
    
    John Floren | 28 Nov 2011 23:10
    Favicon

    Re: inferno hosted on Linux with arm

    This is what I had to do for the Hellaphone. It's a little annoying
    but doesn't take that long.
    
    Speaking of Inferno on ARM, I compiled it for my Efika Smartbook (ARM
    v7l processor), but it seems to just... die, after you start a few
    processes. If I do "emu -r .", I can run "ls" and "ps" and such
    seemingly without limit, but if I run "man wm" a few times, it's
    almost certain to kill emu. I think it has something to do with the
    process handling code, I swear I ran into something like this while
    working with the Hellaphone.
    
    John
    
    On Mon, Nov 28, 2011 at 1:31 PM, Charles Forsyth
    <charles.forsyth@...> wrote:
    > it's a little devious, but it does look as though it should be all
    > right in the end.
    >
    > similarly to iyacc, you need limbo as an x86 executable. possibly the
    > best thing is to
    > mk install Inferno with OBJTYPE=386, to get all the supporting commands,
    > including limbo (the Limbo compiler), then set OBJTYPE=arm, and mk install
    > to get the ARM-hosted version. I'd have written this up earlier except that:
    >  a. I didn't think of it
    >  b. to be fair, cross-compilation on non-Plan 9 systems to make other
    > hosted systems is relatively new
    >  c. it was trivial under Plan 9, because cross-compilation is there by default,
    >     although in retrospect, there's a similar assumption (that the
    > source system
    >     compilers have been made).
    >
    > On 28 November 2011 21:02, Shubhangi Tamsekar
    > <shubhangi.tamsekar@...> wrote:
    >> Thanks Charles.
    >>
    >> I changed the path to PATH=$HOME/inferno/Linux/386/bin
    >> set appropriate cross compiler name in mkfile-linux-arm
    >> and then do mk install
    >>
    >> Now it is able to pass beyond iyacc however, it is stuck mysteriously for
    >> limbo. Here are the error messages that I get -
    >>
    >>
    >> rm -f /home/inferno/Linux/arm/bin/limbo && cp o.out
    >> /home/inferno/Linux/arm/bin/limbo
    >> (cd libinterp; mk  install)
    >> /home/inferno/Linux/arm/lib/libinterp.a doesn't exist: assuming it will be
    >> an archive
    >> rm -f runt.h && limbo -a -I../module ../module/runt.m > runt.h
    >> sh: limbo: not found
    >> mk: rm -f runt.h ...  : exit status=exit(127), deleting 'runt.h'
    >> mk: for j in ...  : exit status=exit(1)
    >>
    >>
    >> Now what is wrong with my Limbo? I can see mk, iyacc and limbo files in my
    >> /inferno/Linux/arm/bin/ folder.
    >>
    >> Any idea?
    >>
    >> On Mon, Nov 28, 2011 at 4:52 AM, Charles Forsyth <charles.forsyth <at> gmail.com>
    >> wrote:
    >>>
    >>> iyacc needs to be of the same cpu type as your Ubuntu (as do the build
    >>> functions).
    >>> You've built the arm version of iyacc, but that is interpreted as a
    >>> shell script on x86.
    >>> (It's a bit stupid that something doesn't complain about an
    >>> incompatible architecture, and
    >>> I think it's something in the Linux environment that's at fault there,
    >>> nothing directly to do with Inferno.)
    >>>
    >>> You don't need PATH=$HOME/inferno/Linux/arm/bin:...
    >>> because you're not running on the arm. Instead you need the 386 directory
    >>> (if
    >>> the Ubuntu is on some variant of x86). With OBJTYPE=arm, SYSTARG=Linux,
    >>> mkfiles/mkfile-Linux-arm will expect an arm-gcc somewhere in the PATH,
    >>> as a gcc-based cross-compiler running on x86 generating code for the ARM.
    >>> (You can change the mkfile if some other cross-compiler name is
    >>> appropriate.)
    >>
    >>
    >
    
    
    Charles Forsyth | 29 Nov 2011 00:12
    Picon

    Re: inferno hosted on Linux with arm

    Today is obviously "it's all my fault" day. The default installation
    for Linux still uses clone,
    which would be much more efficient but is less and less feasible as
    glibc acquires dependencies
    on pthreads. It's not trivial to substitute a different C library, so
    it would be better if the default
    installation instead was set up for pthreads. I'll push out the
    changes to do that.
    
    On 28 November 2011 22:10, John Floren <john@...> wrote:
    > Speaking of Inferno on ARM, I compiled it for my Efika Smartbook (ARM
    > v7l processor), but it seems to just... die, after you start a few
    > processes. If I do "emu -r .", I can run "ls" and "ps" and such
    > seemingly without limit, but if I run "man wm" a few times, it's
    > almost certain to kill emu. I think it has something to do with the
    > process handling code, I swear I ran into something like this while
    > working with the Hellaphone.
    
    
    Shubhangi Tamsekar | 30 Nov 2011 21:08
    Picon

    Re: inferno hosted on Linux with arm

    Charles,

    I tried the technique that you suggested. ( First mk install with 386 and then with mk install with arm )
    It worked all well but not completely. Now I am getting assembler errors.

    (cd emu; mk  install)
    (cd Linux; mk  install)
    arm-linux-gcc -c  asm-arm.S
    asm-arm.S: Assembler messages:
    asm-arm.S:26: Error: selected processor does not support `blx r1'
    mk: arm-linux-gcc -c  asm-arm.S  : exit status=exit(1)
    mk: echo "(cd $SYSTARG; ...  : exit status=exit(1)
    mk: for j in ...  : exit status=exit(1)

    Why is it suddenly denying use of register r1... ?

    Is it something to do with the clone that linux installation uses?

    <at> John, did you encounter anything of this sort? How did you manage to get it on to the Efika? please let me know if you have any blog/write up of the procedure you followed.


    -Shubhangi


    On Tue, Nov 29, 2011 at 4:42 AM, Charles Forsyth <charles.forsyth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
    Today is obviously "it's all my fault" day. The default installation
    for Linux still uses clone,
    which would be much more efficient but is less and less feasible as
    glibc acquires dependencies
    on pthreads. It's not trivial to substitute a different C library, so
    it would be better if the default
    installation instead was set up for pthreads. I'll push out the
    changes to do that.

    On 28 November 2011 22:10, John Floren <john-5LnL+yMQqcfR7s880joybQ@public.gmane.org> wrote:
    > Speaking of Inferno on ARM, I compiled it for my Efika Smartbook (ARM
    > v7l processor), but it seems to just... die, after you start a few
    > processes. If I do "emu -r .", I can run "ls" and "ps" and such
    > seemingly without limit, but if I run "man wm" a few times, it's
    > almost certain to kill emu. I think it has something to do with the
    > process handling code, I swear I ran into something like this while
    > working with the Hellaphone.

    Charles Forsyth | 30 Nov 2011 21:56
    Picon

    Re: inferno hosted on Linux with arm

    That's doubly weird: first that it's using blx, second that no one's
    mentioned it before.
    blx is a bl (branch and link) that also forces an exchange of
    instruction sets (ie, forces
    Thumb mode), which is not a little odd. It looks as though the donors
    of that code
    were running in an environment where most code was compiled for Thumb, but
    Inferno was using arm32 mode (what i'd call "normal" ARM). Phones
    often liked Thumb
    mode, so perhaps that's it.
    
    Try replacing the blx by a plain bl.
    
    On 30 November 2011 20:08, Shubhangi Tamsekar
    <shubhangi.tamsekar@...> wrote:
    > asm-arm.S:26: Error: selected processor does not support `blx r1'
    
    

    Gmane