OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:53 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Any in-depth sources on PowerPC assembly?
PostPosted: Tue Dec 29, 2020 9:39 am 
Offline

Joined: Tue Dec 29, 2020 9:26 am
Posts: 2
Recently I decided I would like to build a kernel for my PowerMac G5, just for sport.
Having primarily worked with x86 assembly, ppc assembly looks like absolute bird language to me.

Does anyone know an in-depth source on ppc assembly, that explains the rationale behind its syntax where necessary?


Top
 Profile  
 
 Post subject: Re: Any in-depth sources on PowerPC assembly?
PostPosted: Wed Dec 30, 2020 2:26 am 
Offline
Member
Member
User avatar

Joined: Tue Sep 15, 2020 8:07 am
Posts: 264
Location: London, UK
I tried to learn PPC asm back in the late ‘90s, and I found it a real struggle.

The mnemonics are obscure and the operations are very specific... It was clearly designed to be written by a compiler not a human.

It was trying to learn PPC asm which convinced me to properly learn C. :lol:

Here’s a link for you:
https://www.ibm.com/developerworks/libr ... index.html

_________________
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su


Top
 Profile  
 
 Post subject: Re: Any in-depth sources on PowerPC assembly?
PostPosted: Wed Dec 30, 2020 2:42 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
bloodline wrote:
I tried to learn PPC asm back in the late ‘90s, and I found it a real struggle.
I have no idea what you mean. I learned PPC assembly a few years ago, when I started to work for a company that uses those chips primarily. And I found it to be an absolute delight. The biggest and most obvious difference to x86 assembly is that all operations are using the three-point form. Which I just found a complete joy to work with. Next thing is that there are few implicit operands, and only in very few operations. x86 has all these weird instructions that have fixed implicit operands you cannot override, and PPC doesn't have a lot of that at all.

OK, so there are tons of mnemonics, but then, x86 has all of these different operations that all have the same mnemonics. I fail to see that as better. And the RISC principle made things very clear to me: You can either be calculating something, or you can be accessing memory, but you can't do both at the same time.

No, the struggle comes in at the system programming level. The userspace is compatible between PowerPC implementations, but the system space can be extremely different. There are implementations that have hardware-based page table walking, and some that don't. There are some with 4 BAT arrays and some with 8. There are some with 1 instruction breakpoint, and some with 2 breakpoints for instructions and data each, and they can be combined to supervise a larger area. And that is just the CPU. The rest of the hardware is so extremely different, you almost need a special OS for each platform on its own. This could in theory happen to you on x86 as well, but the PC is so well established as a platform that few go against the grain there.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Any in-depth sources on PowerPC assembly?
PostPosted: Wed Dec 30, 2020 9:37 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
The Compiler Writer's Guide: https://cr.yp.to/2005-590/powerpc-cwg.pdf is an interesting read. Also the Programming Environment Manual: https://wiki.alcf.anl.gov/images/f/fb/P ... nt_2.3.pdf

But the truth is that most coding for a kernel will be done in a higher-level language - in this case, almost certainly C.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group