Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
12
Return to list New
Author: jadr2ddude

OPI One Cluster Processing

[Copy link]

11

Threads

75

Posts

376

Credits

Intermediate member

Rank: 3Rank: 3

Credits
376
Post time 2016-6-24 09:31:37 | Show all posts
@jadr2ddude
you can use linux, but inferno (as plan9, as qnx, they all used same ideas) was designed especially for building systems distributed by network.
where many computers from different places work as single computer.
inferno and plan9 designed by bell labs, the father of unix, C, C++ and other
these were military projects (yes, it was not a joke when i named it skynet. it was the real development and inferno planned to be a core of real network of military things (rockets, tanks, avions, your army knife))
because of military order they were closed long time.

inferno was designed for highest portability (for example it can run on top of other OS as framework or without OS on bare hardware)
and easy programming. it has 2 languages interpreted sh (my examples here in sh) and compiled limbo (it looks like something between C++, pascal/oberon with some very highlevel constructions like from python, and it has easy to use multithreading system with mutexes, channels etc embedded directly into the language (as go or xc))
it also includes graphical sourcelevel debugger like ddd (also was writen in limbo and can work without recompilation)

it can be compiled under linux (and windows and mac and other) in minutes.
it has as minimum 3 pluses
1. you can develop your program on any system you want and run on other system without recompilation as it is a virtual machine
2. it is significally faster then other VMs including java and .net because of internal architecture, and because of jit compilers for most of architectures (x86, arm, mips, sparc, power)
3. it takes less of resources, thanks to very good garbage collector (when i tested it on win ce it took only 7-8mb with gui environment and pair of programs runned)

also it provides many abilities now absent in regular OSes or programming languages (maybe excluding go - a son of limbo, and xmos xc - also looks like limbo)


a example - how to browse/parse webpages directly from shell:
```
ndb/cs   #start connection service

fn rd_foo { #foo to read a page
  id=$1

  {
    echo 'GET /orangepibbsen/forum.php?mod=viewthread&tid=1459&extra=page%3D1 HTTP/1.1' &&
    echo 'connection: close' &&
    echo 'host: www.orangepi.org' &&
    echo ''
  } > /net/tcp/$id/data  #send a regular GET query to server

  cat /net/tcp/$id/data  #output received from server page to terminal

#  var=`{read < /net/tcp/$id/data} #or catch it to variable for parsing as example
}

fn get_opi_forum {  #foo to connect to a server
  (null ip)=`{ndb/csquery net!www.orangepi.org!http}  #get the IP of the server
#  echo $ip  # you can see received IP

  {
    id=`{read}  #get the id of just opened tcp channel
    echo connect $ip > /net/tcp/$id/ctl  #connect tcp channel $id to your server

    rd_foo $id #run the foo to read a page
  } <> /net/tcp/clone #by opening this file new tcp channel creates, by closing closes
                      # <> - mean - open for read and write and no close till the end
                      # of all commands between {}
}

get_opi_forum  #do the main foo
```
(all examples till now were in sh. inferno allows to make much operations with sh then linuxes' bash, for example regular replace, building of GUIs)
(limbo runs faster then sh but it will be in the future)

you can call commands of hosting OS from sh using command "os" and send/receive data from it to inferno
```
os <command string of hosting os>
```

next time i try to write how write a extension to inferno callable as limbo module in C (inferno contain a special tool to help in writing of C extensions)
Reply

Use magic Report

11

Threads

75

Posts

376

Credits

Intermediate member

Rank: 3Rank: 3

Credits
376
Post time 2016-6-24 09:55:22 | Show all posts
PS i forgot. here is a ready to use inferno based distributed system
https://bitbucket.org/inferno-os/owen

some slides about inferno-owen:
http://www.resc.rdg.ac.uk/presentations/Inferno_25-03-04/
www.vitanuova.com/papers/ugrid.pdf

it already included in the package from my mega.nz. if you interested, i try to write a pair of examples how to use it
Reply

Use magic Report

1

Threads

6

Posts

122

Credits

Registered member

Rank: 2

Credits
122
 Author| Post time 2016-6-24 10:54:56 | Show all posts
Yes I will consider also trying out inferno, but most of the stuff I need to run/test is in C/C++.
Reply

Use magic Report

11

Threads

75

Posts

376

Credits

Intermediate member

Rank: 3Rank: 3

Credits
376
Post time 2016-6-25 19:57:00 | Show all posts
i don't know details of your project, sorry.

for me inferno is a C library with powerful typesafe communication protocol supported transfer of regular data, files, system calls (as qnet from qnx). yes, it has embedded scripting engine, but it can used without it (a harder way - http://9p.cat-v.org/implementations).

- to embed inferno as library in a C/C++ project just modify (rename) main function in the <inferno-os>/emu/port/main.c
- to remove unnessesery components/devices/libraries just comment or delete them from <inferno-os>/Linux/emu
- if you don't want to run sh at startup - just change /appl/cmd/emuinit.b startup module. line 63:

from: return (mod, "sh" :: "-c" :: "$*" :: args);
to: return (mod, "your own module"::"arg1"::"arg2"::"etc");
compile it: limbo emuinit.b
and move result: mv emuinit.dis /dis


also you can add your C module. here a example of embedding vx86 sandbox to run x86 elf files from inferno media:
http://ipn.caerwyn.com/2009/01/lab-92-vxinferno.html

if you should write biggest part in C/C++, you can use it as C library (as inferno itsef %90 C) with a scripting language (Linux without scripting configs?? this sounds as windows) as part of the library.

to select what scripts you need to include into your distribution use "disdep" command
```
disdep <your compiled script>.dis
disdep /dis/emuinit.dis
```
Reply

Use magic Report

0

Threads

5

Posts

48

Credits

Novice

Rank: 1

Credits
48
Post time 2018-10-12 23:37:36 | Show all posts
Wow great idea
Reply

Use magic Report

0

Threads

5

Posts

48

Credits

Novice

Rank: 1

Credits
48
Post time 2018-10-12 23:39:24 | Show all posts
But there's a question... are you expecting all the OPI board as a gift from orange pi organization??
Reply

Use magic Report

0

Threads

5

Posts

48

Credits

Novice

Rank: 1

Credits
48
Post time 2018-10-12 23:41:47 | Show all posts
But there's a question... are you expecting all the OPI board as a gift from orange pi organization??
Reply

Use magic Report

12
Return to list New
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-8-18 09:24 GMT+8 , Processed in 0.030837 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list