64 bit powerpc

Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

64 bit powerpc

Peter J. Philipp-3
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.

Regards,

-peter

Reply | Threaded
Open this post in threaded view
|

Re: 64 bit powerpc

Theo de Raadt-2
Peter J. Philipp <[hidden email]> 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.



Reply | Threaded
Open this post in threaded view
|

Re: 64 bit powerpc

Rino Rondan
In reply to this post by Peter J. Philipp-3
Hi Peter,
I moved to Openbsd or I’m in the transition to move because Im still testing some hardware. I bought     some powermac to test.

64 bit:
Powermac11,2 dual core 2.0
Powermac8,2 Imac one core 2.0

In both case I have issues with ide disk , i tested with 6.2 , the driver is not working properly , a friend did a test reducing the velocity with jumper in a new ide disk and works, I need to do more research and documentation. With FreeBSD works fine but you do not have  binary at all, with Ubuntu works nice but I do not want Ubuntu :( .. 64 bit arch from my side need more research maybe someone can tell me their experience.
With 32 bit arch it works awesome !! I use a Mac mini 1.42ghz g4 as a desktop  with 6.3 , the unique problem is browser but I do not care about that for the moment , just only using it with classical apps to work as sysadmin and some devel. Also I tested in PowerBook g4 and same awesome result.
I’m want to say thanks to all people make all works to get working ppc in openbsd , I wish to help by some way :)

Rondan Rino

On Thu, Jul 5, 2018 at 2:08 AM, Peter J. Philipp <[hidden email]> 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. Regards, -peter
Reply | Threaded
Open this post in threaded view
|

Re: 64 bit powerpc

Peter J. Philipp-3
On Thu, Jul 05, 2018 at 07:30:28AM -0400, Rino Rondan wrote:

> Hi Peter,
> I moved to Openbsd or I???m in the transition to move because Im still testing some hardware. I bought     some powermac to test.
>
> 64 bit:
> Powermac11,2 dual core 2.0
> Powermac8,2 Imac one core 2.0
>
> In both case I have issues with ide disk , i tested with 6.2 , the driver is not working properly , a friend did a test reducing the velocity with jumper in a new ide disk and works, I need to do more research and documentation. With FreeBSD works fine but you do not have  binary at all, with Ubuntu works nice but I do not want Ubuntu :( .. 64 bit arch from my side need more research maybe someone can tell me their experience.
> With 32 bit arch it works awesome !! I use a Mac mini 1.42ghz g4 as a desktop  with 6.3 , the unique problem is browser but I do not care about that for the moment , just only using it with classical apps to work as sysadmin and some devel. Also I tested in PowerBook g4 and same awesome result.
> I???m want to say thanks to all people make all works to get working ppc in openbsd , I wish to help by some way :)
>
> Rondan Rino

Hi Rondan Rino,

I found a gem (and not just the ethernet driver) :-) it's the OpenBSD ppc
archives at https://marc.info.  One person posted their blog entry there
about netbooting on a G4 Cube.  The info was good for my G5 machine as well.
I personally thanked him with an email.  

I too want to thank all people making macppc what it is.  Having a lot of
fun with this lately.  And if you've been following bugs@ I have already
issues that I need fixed.  Much thanks to people who replied there.

Regards,
-peter

Reply | Threaded
Open this post in threaded view
|

Re: 64 bit powerpc

Peter J. Philipp-3
In reply to this post by Theo de Raadt-2
On Thu, Jul 05, 2018 at 12:12:45AM -0600, Theo de Raadt wrote:

> Peter J. Philipp <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: 64 bit powerpc

Brandon Bergren
I'm also interested in 64 bit PPC, as I have a Talos II (dual POWER9) and have a second machine coming soon for driver debugging work (Talos II Lite "special developer system" -- https://secure.raptorcs.com/content/TLSDS1/intro.html )

I'm currently spending time doing driver debugging on FreeBSD, but would prefer using OpenBSD. I don't have an actual background in driver/kernel development but I'm starting to learn.


On Fri, Jul 6, 2018, at 3:43 AM, Peter J. Philipp wrote:
> 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.

Regarding porting resources, there are several presentations listed on the events and papers page ( https://www.openbsd.org/events.html ) that describe other people's experiences in porting OpenBSD to new platforms and CPUs. Grep for "porting".

> 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
>


--
  Brandon Bergren
  Technical Generalist

Reply | Threaded
Open this post in threaded view
|

Re: 64 bit powerpc

Peter J. Philipp-3
On Fri, Jul 06, 2018 at 12:15:02PM -0500, Brandon Bergren wrote:
> I'm also interested in 64 bit PPC, as I have a Talos II (dual POWER9) and have a second machine coming soon for driver debugging work (Talos II Lite "special developer system" -- https://secure.raptorcs.com/content/TLSDS1/intro.html )
>
> I'm currently spending time doing driver debugging on FreeBSD, but would prefer using OpenBSD. I don't have an actual background in driver/kernel development but I'm starting to learn.

I've had my eyes on such a system in the past (one can only dream).  As far as
I can remember Linux is using it in Little Endian byte order, and I don't
know what FreeBSD is doing.  I think up to POWER8 or something you should only
go Big Endian byte order.  I'm sticking with Big Endian byte order for now as
that's what's in powerpc arch.

I must say I learned a whole lot today working on this.  Hopefully I won't get
confused.

Nice system you have!

-peter

Reply | Threaded
Open this post in threaded view
|

Re: 64 bit powerpc

Brandon Bergren
Actually you can do both BE and LE Linux on them, it's just that IBM is pushing development towards LE at the moment. I suppose it's a plan to make it easier for X86 developers to migrate over and/or encourage movement to POWER8+.

FreeBSD only supports BE on POWER.

POWER9 is slightly biased towards BE but has a toggle at the logical partition level for BE vs LE so it works well either way. There are only a few instructions that don't work in LE mode (load/store multiple, move-assist).

On Fri, Jul 6, 2018, at 12:25 PM, Peter J. Philipp wrote:

> On Fri, Jul 06, 2018 at 12:15:02PM -0500, Brandon Bergren wrote:
> > I'm also interested in 64 bit PPC, as I have a Talos II (dual POWER9) and have a second machine coming soon for driver debugging work (Talos II Lite "special developer system" -- https://secure.raptorcs.com/content/TLSDS1/intro.html )
> >
> > I'm currently spending time doing driver debugging on FreeBSD, but would prefer using OpenBSD. I don't have an actual background in driver/kernel development but I'm starting to learn.
>
> I've had my eyes on such a system in the past (one can only dream).  As far as
> I can remember Linux is using it in Little Endian byte order, and I don't
> know what FreeBSD is doing.  I think up to POWER8 or something you should only
> go Big Endian byte order.  I'm sticking with Big Endian byte order for now as
> that's what's in powerpc arch.
>
> I must say I learned a whole lot today working on this.  Hopefully I won't get
> confused.
>
> Nice system you have!
>
> -peter


--
  Brandon Bergren
  Technical Generalist

Reply | Threaded
Open this post in threaded view
|

Re: 64 bit powerpc

Peter J. Philipp-3
In reply to this post by Peter J. Philipp-3
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 <[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: 64 bit powerpc

Peter J. Philipp-3
On Sun, Jul 15, 2018 at 06:02:22PM +0200, Peter J. Philipp wrote:
> > > 60% of the work is in pmap.c, 20% of the work in trap.c, and 20%
> > > of the work is elsewhere.

Hi,

I've been working hard at this most of the week and I'm at a point now where
I'm sick of eyeballing the code and doing theoretical changes.  I need a
compiler to do a second look for me.  Although this is the core powerpc64
stuff, there is still the macppc stuff to port and I'll call those aim64.

For a snapshot of what I've done:

http://centroid.eu/private/powerpc64.tgz

For the CVS repo:

http://centroid.eu/cgi-bin/cvsweb/powerpc64/

And look for aim64 which will have a path such as:

http://centroid.eu/cgi-bin/cvsweb/aim64/

There is still lots of hurdles but when I finish the aim64 stuff, I'll be
looking for two things.

1) A cross-compiler with powerpc64 support
2) a 64-bit loader (like ofwboot)

If you know an easier way to get a 64 bit loader other than hacking on ofwboot
let me know.  Or if there is no easier way perhaps someone wants to help me
with this?  Working on a 64 bit loader would be awesome then I have to do less
work and we meet in the middle.

I know the code as is won't compile, but I'm willing to give it a pass and
work on fixing the errors that the compiler gives me.  Given that, booting a
first kernel will likely panic() it at boot, if it doesn't panic then I'm
extremely lucky.  Or it's gonna be really slow as I screwed up on the Segment
Lookaside Buffer or TLB cache or something.  I'd like to see the day :-).

Now I want to give everyone who worked on this code before me mad props!  The
code was pretty much almost 64 bit ready and I did a bit of cutting out, and
pulling stuff in from FreeBSD and comparing with the PEM guide from IBM.
Thanks so far!  Also thanks for FreeBSD who trailblazed my efforts and gave me
somethign to work with.

Here is a list of things that I did a visual inspection on and possibly
changes.  What's not checked needs immediate attention still.


file first pass (eyes only) second pass (compiler)
-------------------------------+-----------------------+-----------------------
powerpc64/bus_dma.c X
powerpc64/bus_space.c X
powerpc64/copystr.c X
powerpc64/cpu_subr.c X
powerpc64/fpu.c X
powerpc64/genassym.cf X
powerpc64/in_cksum.c X
powerpc64/intr.c X
powerpc64/lock_machdep.c X
powerpc64/pmap.c X
powerpc64/process_machdep.c X
powerpc64/setjmp.S
powerpc64/softintr.c X
powerpc64/sys_machdep.c X
powerpc64/trap.c
powerpc64/vm_machdep.c
powerpc64/copyinout.c X
powerpc64/slb.c X

ddb/db_disasm.c X
ddb/db_interface.c X
ddb/db_memrw.c X
ddb/db_trace.c X

include/*.h X

Best Regards,
-peter