Let’s start with tools that we need to just build the OS for ARM. First clone official inferno os repository from google code repository:
1# hg clone https://code.google.com/p/inferno-os/
What we need to move further? We need the ARM cross compiler, linker, etc. For this, let’s just compile inferno targeting mac as host (we are on mac now, so we will get hosted inferno for mac as result):
1# cd inferno-os/
2# INF_ROOT=`pwd` perl -i -pe 's/^ROOT=.*/ROOT=$ENV{INF_ROOT}/m' mkconfig
3# perl -i -pe 's/^SYSHOST=.*/SYSHOST=MacOSX/m' mkconfig
4# perl -i -pe 's/^OBJTYPE=.*/OBJTYPE=386/m' mkconfig
5# sh makemk.sh
6# PATH=`pwd`/MacOSX/386/bin:$PATH mk nuke
7# PATH=`pwd`/MacOSX/386/bin:$PATH mk install
8… waiting just few minutes …
9# ls MacOSX/386/bin/
100a 2l 8l iar ksize ms2 tc
110c 5a acid idea kstrip ndate va
120l 5c asm inm limbo qa vc
131a 5coff c2l iyacc md5sum qc vl
141c 5cv data2c ka mk ql
151l 5l data2s kc mk.save sqz
162a 8a emu kl mkext srclist
172c 8c ftl kprof mkppcimage styxtest
18#
Yes! Now we have all needed cross-platform tools for building Inferno OS for ARM, see 5c – C compiler, 5a – ARM assembler, 5l – ARM linker. Let’s check ARM asm generated:
1# export PATH=`pwd`/MacOSX/386/bin:$PATH
2# echo "int main() { return 123; }" >tmp.c && 5c -S tmp.c && rm tmp.c
3 TEXT main+0(SB),0,$0
4 MOVW $123,R0
5 RET ,
6 RET ,
7 END ,