slsh (Interpreter for S-Lang scripts) and Yun

opkg update
opkg install slsh
nano hello.sls

message("Hello, world!");

slsh hello.sls
Hello, world!



 

Write comment (0 Comments)

Install TCL:

opkg update
opkg install tcl

Find out what installed:

opkg files tcl

Package tcl (8.5.8-1) is installed on root and has the following files:
/usr/bin/tclsh8.5
/usr/lib/libtcl8.5.so
nano /mnt/sda1/hello.tcl

#!/usr/bin/tclsh8.5
puts {hello, world}

chmod 755 /mnt/sda1/hello.tcl

/mnt/sda1/hello.tcl

Error came out:

Can't find a usable init.tcl in the following directories:
    /usr/lib/tcl8.5 /usr/lib/tcl8.5 /lib/tcl8.5 /usr/library /library /tcl8.5.8/library /tcl8.5.8/library

Fix Error:

mkdir -p /usr/lib/tcl8.5
cd /usr/lib/tcl8.5
wget -O init.tcl https://www.dropbox.com/s/8if5kks92hmc8ep/init.tcl?dl=0 --no-check-certificate


Run it again:

/mnt/sda1/hello.tcl
hello, world

 

Write comment (0 Comments)
nano hello.s
# File: hello.s -- Say Hello to MIPS Assembly Language Programmer
# Author: falcon <wuzhangjin(at)gmail.com>, 2009/01/17
# Ref:
#    [*] http://www.tldp.org/HOWTO/Assembly-HOWTO/mips.html
#    [*] MIPS Assembly Language Programmer's Guide
#    [*] See MIPS Run Linux(second version)
# Compile:
#       $ gcc -o hello hello.s
#       or
#       $ as -o hello.o hello.s
#       $ ld -e main -o hello hello.o

    .text
    .globl main
main:

    .set noreorder
    .cpload $gp       # setup the pointer to global data
    .set reorder
                      # print sth. via sys_write
    li $a0, 1         # print to standard ouput
    la $a1, stradr    # set the string address
    lw $a2, strlen    # set the string length
    li $v0, 4004      # index of sys_write:
                      # __NR_write in /usr/include/asm/unistd.h
    syscall           # causes a system call trap.

                      # exit via sys_exit
    move $a0, $0      # exit status as 0
    li $v0, 4001      # index of sys_exit
                      # __NR_exit in /usr/include/asm/unistd.h
    syscall

    .rdata
stradr: .asciiz "hello, world!\n"
strlen: .word . - stradr  # current address - the string address
# end
root@Arduino:/mnt/sda1# gcc -o hello hello.s
root@Arduino:/mnt/sda1# ./hello
hello, world!

 








Write comment (0 Comments)

Install OpenWrt-SDK:

Openwrt SDK

source ~/setup.sh
nano helloworld.f90
program HelloWorldF90
    write(*,*) "Hello World!"
end program HelloWorldF90
mips-openwrt-linux-uclibc-gfortran helloworld.f90 -o helloworld-f90-gnu
scp helloworld-f90-gnu root@192.168.0.102:/mnt/sda1
root@Arduino:/mnt/sda1# ./helloworld-f90-gnu
./helloworld-f90-gnu: can't load library 'libgfortran.so.3'

The Fortran runtime library is needed.

 

wget https://www.dropbox.com/s/w9nmw1nilbbs475/libgfortran_4.6-linaro-1_ar71xx.ipk?dl=0 -O libgfortran_4.6-linaro-1_ar71xx.ipk --no-check-certificate
opkg install libgfortran_4.6-linaro-1_ar71xx.ipk

Test run:

root@Arduino:/mnt/sda1# ./helloworld-f90-gnu
 Hello World!

 

Write comment (0 Comments)