On Fri, Jul 06, 2018 at 10:43:44AM +0200, Peter J. Philipp wrote:
> On Thu, Jul 05, 2018 at 12:12:45AM -0600, Theo de Raadt wrote:
> > Peter J. Philipp <p...@centroid.eu> wrote:
> > 
> > > Hi,
> > > 
> > > This week I bought a used G5 PowerMac7,3 with 4 GB RAM and dual
> > > PowerPC 970FX cpu's.?? I didn't buy it because I miss the macppc all
> > > that much but because I want to test the water of creating a 64 bit
> > > port that goes onward to perhaps support IBM POWER5+ CPU's.?? It seems
> > > Linux and FreeBSD are already there or on their way.
> > > 
> > > Since I'm a fan of OpenBSD I want an OpenBSD 64 bit Power(PC) port,
> > > and asking if anyone has experience to make this happen? What are
> > > hints that you can give??? Is it possible to just port over FreeBSD's
> > > low kernel routines and get OpenBSD/powerpc64 working that way?
> > > 
> > > My use of OpenBSD/powerpc goes back to 2.9/3.0 days (when the macppc
> > > port came), I had some time then and created some manpages for Dale
> > > Rahn for the macppc system (which are probably in the attic by now).??
> > > I love working with kernel code but I largely don't know what I'm
> > > doing.?? My programming experience is limited, I program a DNS
> > > authoritative server.
> > > 
> > > At my last job I was an AIX sysadmin (in training) and worked on a
> > > POWER 7 machine running AIX 7.2.?? I left that job though so I can't
> > > use that hardware to test a 64 bit port.?? It left an impression on me
> > > though.
> > 
> > 60% of the work is in pmap.c, 20% of the work in trap.c, and 20%
> > of the work is elsewhere.
> 
> Well I got started.  Since I've never done a port to any architecture, I did
> not know where to begin.  I felt the header files needed work first especially
> _types.h.  This is taking a long time and it's in the 
> "20% of the work is elsewhere" category.  I did about 6 header files 
> this morning, this morning was rare that I had time, I don't always have this 
> much time.  In order to not duplicate work of other people attempting a port 
> I put my files in my cvsweb on my vps.
> 
> We can share if you're working on this too.  And if I give up then the work is
> not in vain.  The URL to this repo is:
> 
> http://centroid.eu/cgi-bin/cvsweb/powerpc64/
> 
> The reason I decided to reuse the header files from the powerpc arch is that
> this is what FreeBSD is doing... this way I don't have to convert FreeBSD's
> stuff to OpenBSD semantics, I just change it all to 64 bit and hope it'll 
> work.
> 
> I did my best converting the ASM in atomic.h to 64 bit instructions with help
> of an IBM programmers guide and the FreeBSD repo for hints.
> 
> I'll keep going when I find more time :-).  Crontab to sync this repo to my
> vps's repo is set at hourly.
> 
> Regards,
> -peter

Hi,

It's 9 days later since my last post and I haven't gotten far, even though I've
been investing a lot of time in this (I feel).  I'm mostly still working on
pmap.c and it'll take a while yet before I'm satisfied to go on.  I believe I'll
have most of august to work on this while I wait to be accepted to a grant for 
another project of mine, maybe by the end of august I'll be ready with pmap.c,
but who knows?  I've been reading a little about pmap.c in the DAIOT44BOS, to
help guide me, and I've been reading through the FreeBSD/powerpc sources as 
well.  I took 3 files from FreeBSD already to help me, otherwise I feel that
much of the powerpc arch is already 64 bit ready and I can work with that.

If I may dream a little I'd like to call the 64 bit powerpc arch powerpc64,
the 64 bit mac arch I want to call aim64 (after AIM alliance) and if we ever
get to boot aim64, I want to work on POWER ports.. think OpenBSD/power has a 
nice look to it even though the backend is powerpc64.

To the things that I'll need for day X when I boot the kernel in 64 bit mode
is a 64 bit loader (perhaps a hack to ofwboot), and another challenge will be 
setting up the cross compiler to compile a first kernel.  So far it's just me 
doing the work, and I'm impressed by it all.  And I know so little.

So where am I with pmap.c?  FreeBSD has a slab cache implementation of the SLB
routines for the PV lookup functions, if I'm not mistaken.  I found a very 
early version of this that uses SPLAY trees and I thought that's a good 
starting point.  It can always be updated in time (perhaps after the system
runs).  I'm taking all the SR_* and sr stuff out as I believe that's 32 bit and
it won't work with the slb stuff.  I've been changing some types in functions
in pmap.c (but have to revert stuff I did this weekend) as well.  Anything with
function32() I've shamelessly removed.  I've also gotten rid of any 32 bit code
that I saw, perhaps carelessly but if I need it to reference I can look at the
powerpc sources again and copy it back.   Can't wait for day X when I compile
and it catches #error's I've sprayed around the source of it.  

Thanks!

-peter

Reply via email to