Page 1 of 2
getting started with PowerPC
Posted: Sun Nov 17, 2013 5:44 pm
by feare56
I just decided to get back into OSDev and since my last project I have switched to PowerPC Macs, I have a PowerMac g5 dual core 2.3ghz with 10.5.8 and an iBook g4 1.2ghz with 10.4.11. When I ended I had a 64-bit Intel laptop, what I am asking is should I switch one of the mac operating systems with a PowerPC compatible Linux or is it just as easy to create an OS on Mac? Will I need to relearn assembly for the PowerPC architecture? What tools are recommended that work on either mac or Linux that is PowerPC compatible (compiler, virtual machine, etc.)? Lastly if I were to stick with mac software will xcode work for assembly and c?
Re: getting started with PowerPC
Posted: Mon Nov 18, 2013 12:29 am
by bwat
feare56 wrote:I just decided to get back into OSDev and since my last project I have switched to PowerPC Macs, I have a PowerMac g5 dual core 2.3ghz with 10.5.8 and an iBook g4 1.2ghz with 10.4.11. When I ended I had a 64-bit Intel laptop, what I am asking is should I switch one of the mac operating systems with a PowerPC compatible Linux or is it just as easy to create an OS on Mac? Will I need to relearn assembly for the PowerPC architecture? What tools are recommended that work on either mac or Linux that is PowerPC compatible (compiler, virtual machine, etc.)? Lastly if I were to stick with mac software will xcode work for assembly and c?
I've done over a decade of PowerPC OS development for telecom infrastructure products. Most of the time it was the GCC toolchain hosted on either Sun workstations or PCs running Linux. You don't need to install Linux. Yes you will have to learn assembly language, but it's not hard.
Re: getting started with PowerPC
Posted: Mon Nov 18, 2013 6:23 am
by feare56
I already learned assembly but the question was what would be different from developing on Intel and PowerPC architectures? Is virtualpc 7 a good program to test an operating system made for the PowerPC platform?
Re: getting started with PowerPC
Posted: Mon Nov 18, 2013 6:34 am
by bwat
feare56 wrote:I already learned assembly but the question was what would be different from developing on Intel and PowerPC architectures? Is virtualpc 7 a good program to test an operating system made for the PowerPC platform?
They are two different instruction sets. PowerPC assembly is very different to Intel. It is however very RISCy so it's pretty easy to learn.
The only simulator/emulator I've used was
very expensive and chosen by the client. I've forgotten the name of it. Before that came along we tested on real hardware.
Re: getting started with PowerPC
Posted: Mon Nov 18, 2013 9:25 am
by feare56
bwat wrote:feare56 wrote:I already learned assembly but the question was what would be different from developing on Intel and PowerPC architectures? Is virtualpc 7 a good program to test an operating system made for the PowerPC platform?
They are two different instruction sets. PowerPC assembly is very different to Intel. It is however very RISCy so it's pretty easy to learn.
The only simulator/emulator I've used was
very expensive and chosen by the client. I've forgotten the name of it. Before that came along we tested on real hardware.
Thank you, any good resources about PowerPC assembly? I created a boot loader that worked on my Intel laptop with assembly and c, will that boot loader work on the PowerPC architecture?
Re: getting started with PowerPC
Posted: Mon Nov 18, 2013 9:58 am
by bwat
feare56 wrote:
Thank you, any good resources about PowerPC assembly? I created a boot loader that worked on my Intel laptop with assembly and c, will that boot loader work on the PowerPC architecture?
Try
http://www.power.org for generic info and google for the chip you're using, e.g., ppc750 or whatever your machine has.
Your bootstrap loader will most definitely need to be rewritten.
Re: getting started with PowerPC
Posted: Mon Nov 18, 2013 2:37 pm
by qw
Re: getting started with PowerPC
Posted: Mon Nov 18, 2013 6:08 pm
by feare56
Thank you guys, I will get those checked out. In order to create an operating system for macintosh systems how would you go about accessing the bios? Would it be the same way as any other computer? All I have really researched as of now is that Apple uses Open Firmware for the bios, what I would like to know is if coding for the Open Firmware bios is different than any other bios?
Re: getting started with PowerPC
Posted: Mon Nov 18, 2013 11:40 pm
by bwat
I remember poking around the source code of OpenBSD for the details on how to communicate with the firmware. It's just a forth interpreter .
Re: getting started with PowerPC
Posted: Tue Nov 19, 2013 1:18 am
by iansjack
Apple Open Firmware is very different from PC BIOS. But, in both cases, you only need it to load your OS kernel. This is easy enough:
http://mac.linux.be/content/guide-open- ... ple-bios-0 . I suspect that your major problem, as with any non-PC hardware, will be to find documentation on the hardware in your Mac. As bwat suggests, the PPC FreeBSD source will provide some help, as will the PPC Linux source. You might also read
Mac OS X Internals by Singh.
Re: getting started with PowerPC
Posted: Tue Nov 19, 2013 6:24 am
by feare56
Thank you, that should get me started
Re: getting started with PowerPC
Posted: Tue Nov 19, 2013 6:28 am
by bwat
Remember to tell us how you got on. OSDev is very Intel heavy so the information you gather on your travels will be new to many of us. I'll be particularly interested in your development environment.
Re: getting started with PowerPC
Posted: Tue Nov 19, 2013 7:16 am
by feare56
bwat wrote:Remember to tell us how you got on. OSDev is very Intel heavy so the information you gather on your travels will be new to many of us. I'll be particularly interested in your development environment.
I've noticed that OSDev is very Intel heavy, the only thing PowerPC I saw was that one article under non-x86. I'll keep you guys posted on the development process and share the latest files that work so if you guys would like to emulate or the source code for PowerPC architecture.
Re: getting started with PowerPC
Posted: Wed Nov 20, 2013 9:13 am
by feare56
Ok, I was doing research on what language I could use and I noticed that NASM works with intel and PowerPC. So for those of you who are using NASM and are looking to expand the architectures their OS is supported on you won't have to learn a different assembly language.
Re: getting started with PowerPC
Posted: Wed Nov 20, 2013 10:09 am
by nerdguy
This is an interesting discussion, I have never programmed anything for PPC, The only time I ever programmed on my Mac was to make glorified versions of a hello world program. Good to see people thinking out of x86.