May 22, 2018

Xinu on the Orange Pi

At the time of this writing this is an active project, with many things not yet complete.

The Orange Pi is a small ARM based single board computer. There are actually a bewildering number of Orange Pi boards. The Xinu effort is directed at those based on the Allwinner H3 chip, specifically the Orange Pi "one" as well as the Orange Pi "PC" and the Orange Pi "PC Plus". I personally work with the "PC Plus" but Philip works with the "One".

Status in May of 2018

During 2017 to 2018, Philip Michael Van Every worked on this and got multicore Xinu working on the OrangePi (and earned a degree for doing so). This is at: There are peculiar issues dealing with git and branches that are discussed in the above StackOverflow link. This should be studied before checking out a branch and trying to work on it.

I see several branches:

git branch -a
* master
  remotes/origin/Ethernet-Branch
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/multicore_migration
  remotes/origin/opi_gpio_temp
In particular git checkout origin/Ethernet-Branch would work to inspect a branch, but to track it locally, I would need to git checkout Ethernet-Branch.

Marco forks a branch

Marco Warga has begun working on a fork of multicore_migration, and I want to build his work and try it on my own hardware:
git clone git@github.com:marcowarga/xinu-orangepi.git
mv xinu-orangepi xinu-orangepi-marco
cd xinu-orangepi-marco
git checkout multicore_migration
Branch multicore_migration set up to track remote branch multicore_migration from origin.
Switched to a new branch 'multicore_migration'
git branch
  master
* multicore_migration
This gives me the source code, now to build it:
cd compile
make
Surprisingly this works! It yields:
ls -lrt
...
-rw-rw-r-- 1 tom tom 132354 May 28 16:54 xinu.map
-rwxrwxr-x 1 tom tom 213882 May 28 16:54 xinu.elf
-rwxrwxr-x 1 tom tom 151552 May 28 16:54 xinu.bin
-rw-rw-r-- 1 tom tom 151616 May 28 16:54 xinu
I add an "install" target to the Makefile, do the following, and then apply power to my Orange Pi PC Plus and observe this:
make install
cp ../compile/xinu.bin /var/lib/tftpboot/orange.bin

Xinu for orangepi -- version #1  (tom)  Mon May 28 16:54:29 MST 2018

core0 sp=0x5fff7fa4 cnt64_diff=57 cnt64_ms=0 cyc_diff=0 sctlr=0xc5187f actlr=0x6040 ttbr0=0x4001c00b ttbcr=0x0 *p=0x0 cnt64_low=334597534 testreg=0x77777722
starting core 1
But I hit reset and get:

Xinu for orangepi -- version #1  (tom)  Mon May 28 16:54:29 MST 2018

core0 sp=0x5fff7fa4 cnt64_diff=58 cnt64_ms=0 cyc_diff=0 sctlr=0xc5187f actlr=0x6040 ttbr0=0x4001c00b ttbcr=0x0 *p=0x0 cnt64_low=94514538 testreg=0x77777722
starting core 1
core 1 started
starting core 2
core 2 started
starting core 3
core 3 started
 535724032 bytes of free memory.  Free list:
           [0x40050000 to 0x5FF37FFF]
    102808 bytes of Xinu code.
           [0x40000000 to 0x40019197]
    210727 bytes of data.
           [0x4001C000 to 0x4004F726]



------------------------------------------
   __    __   _____    _   _    _    _    
   \ \  / /  |__ __|  | \ | |  | |  | |   
    \ \/ /     | |    |  \| |  | |  | |   
    / /\ \    _| |_   | \   |  | |  | |   
   / /  \ \  |     |  | | \ |  \  --  /   
   --    --   -----    -   -     ----     
------------------------------------------


Welcome to Xinu!


xsh $ 
On 10 trials (by using my reset button), I get 6 successes and 4 hangs.


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org