Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Porting QNX to new architecture: any manuals/tips/must-reads?: (11 Items)
   
Porting QNX to new architecture: any manuals/tips/must-reads?  
Hi everyone,

  I'm investigating porting QNX to an in-house processor architecture. I've read through a few bird's-eye view 
architecture "how QNX works" manuals and it looks like it will be a good fit for our applications. I've also grabbed the
 source and poked aorund the various system/ker/<arch> directories, and haven't found anything too scary in there.

  So, now it's time to dig deeper. I wonder, are there any manuals walking through the basic steps required to bring QNX
 up on a new architecture? This would be great but if there's no such thing, does anyone have some suggestions on things
 to look out for before getting stuck in a port? Or the best order in which to attack things?
Re: Porting QNX to new architecture: any manuals/tips/must-reads?  
> Hi everyone,
> 
>   I'm investigating porting QNX to an in-house processor architecture. 

Wow, how many years do you plan to invest in this project?  ;-)

Are there some more details about your in-house CPU?
Does it contain a MMU?
Do you have a working GNU Toolchain for it?

The count of years will depend on some of this details.

Regards
Michael
Re: Porting QNX to new architecture: any manuals/tips/must-reads?  
> > Hi everyone,
> > 
> >   I'm investigating porting QNX to an in-house processor architecture. 
> 
> Wow, how many years do you plan to invest in this project?  ;-)

I'd hope to have _something_ going within 6 to 12 months. But that shouldn't be as crazy as it sounds, because:

> Do you have a working GNU Toolchain for it?

Yes, mostly. Since we have no OS running, obviously programs are limited in what they can do currently. But we do have C
/C++ compilers going, brk(), printf(), just enough to debug stuff without an OS. But it's starting to hurt.

> Are there some more details about your in-house CPU?

Unfortunately, there's nothing relevant to the OS side of things that has been published. If you're curious though, the 
CPU is probably going to end up being called MDGRAPE-4, it is the successor to MDGRAPE-3 you can read about here:

http://en.wikipedia.org/wiki/MDGRAPE-3

> Does it contain a MMU?

Yes, it does. It is nothing too fancy, but it has hardware support for dealing with TLB misses, and it also supports a 
number of different page sizes. (As I hope QNX does? I'd better go have a look..)
Also, since the processor is not fixed in final silicon just yet, there is still some time to tweak the MMU.

> The count of years will depend on some of this details.

Well, a lot of the toolchain is done. It can't be _too_ much of a nightmare??

That reminds me of one last point: our hardware platform is pretty "simple", in that we don't have lots of strange 
devices that need drivers to be written. It's going to be memory and CPUs on the boards and not a whole lot else.
RE: Porting QNX to new architecture: any manuals/tips/must-reads?  
Interesting. Are you also going to do 24 core SMP?

When you say "only CPU and memory", how about networking? How is data
moving between the "units"?

-xtang

-----Original Message-----
From: Duraid Madina [mailto:community-noreply@qnx.com] 
Sent: October 20, 2008 8:16 PM
To: ostech-core_os
Subject: Re: Porting QNX to new architecture: any
manuals/tips/must-reads?

> > Hi everyone,
> > 
> >   I'm investigating porting QNX to an in-house processor
architecture. 
> 
> Wow, how many years do you plan to invest in this project?  ;-)

I'd hope to have _something_ going within 6 to 12 months. But that
shouldn't be as crazy as it sounds, because:

> Do you have a working GNU Toolchain for it?

Yes, mostly. Since we have no OS running, obviously programs are limited
in what they can do currently. But we do have C/C++ compilers going,
brk(), printf(), just enough to debug stuff without an OS. But it's
starting to hurt.

> Are there some more details about your in-house CPU?

Unfortunately, there's nothing relevant to the OS side of things that
has been published. If you're curious though, the CPU is probably going
to end up being called MDGRAPE-4, it is the successor to MDGRAPE-3 you
can read about here:

http://en.wikipedia.org/wiki/MDGRAPE-3

> Does it contain a MMU?

Yes, it does. It is nothing too fancy, but it has hardware support for
dealing with TLB misses, and it also supports a number of different page
sizes. (As I hope QNX does? I'd better go have a look..)
Also, since the processor is not fixed in final silicon just yet, there
is still some time to tweak the MMU.

> The count of years will depend on some of this details.

Well, a lot of the toolchain is done. It can't be _too_ much of a
nightmare??

That reminds me of one last point: our hardware platform is pretty
"simple", in that we don't have lots of strange devices that need
drivers to be written. It's going to be memory and CPUs on the boards
and not a whole lot else.


_______________________________________________
OSTech
http://community.qnx.com/sf/go/post15288
Re: RE: Porting QNX to new architecture: any manuals/tips/must-reads?  
> Interesting. Are you also going to do 24 core SMP?
> -xtang

The chips are multicore and we need to get that going, yes. At this stage we don't have any plans for SMP beyond that. 
So boards might have more than one chip but it'll be one OS instance for each of those.
 
> When you say "only CPU and memory", how about networking? How is data
> moving between the "units"?

Other than JTAG and a memory interface, we expect the only other I/Os to be generic parallel interfaces. If we could get
 these going as /dev/blah, we'd be set. We have no particular need to set up ethernet, say.
Re: Porting QNX to new architecture: any manuals/tips/must-reads?  
On Sun, Oct 19, 2008 at 11:28:36PM -0400, Duraid Madina wrote:
> So, now it's time to dig deeper. I wonder, are there any 
> manuals walking through the basic steps required to bring QNX up on a new 
> architecture? 

The "services/system/doc/PORTING" document is about it as far as stuff
being written down.

As others have noted, you need a 32 bit CPU with a full featured MMU or
you're going to be in a world of hurt.

-- 
Brian Stecher (bstecher@qnx.com)        QNX Software Systems
phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
       +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8
Re: Porting QNX to new architecture: any manuals/tips/must-reads?  
 
> The "services/system/doc/PORTING" document is about it as far as stuff
> being written down.

Thanks! I completely missed this gem!

> As others have noted, you need a 32 bit CPU with a full featured MMU or
> you're going to be in a world of hurt.

Uh oh: by 32 bit CPU, you mean "32 bits plus", right? Because our target is 64-bit. :( Or is 64-bits an absolute 
nightmare for QNX?
Re: Porting QNX to new architecture: any manuals/tips/must-reads?  
We can run on 64bit chips, but we currently only support a 32bit model.  For example, we run on 64bit MIPS processors, 
we save/restore the full 64bit
regs, but the compiler believes that it runs in a 32bit world.

True 64bit has yet to be done... although it would be doable.

Duraid Madina wrote:
>  
>> The "services/system/doc/PORTING" document is about it as far as stuff
>> being written down.
> 
> Thanks! I completely missed this gem!
> 
>> As others have noted, you need a 32 bit CPU with a full featured MMU or
>> you're going to be in a world of hurt.
> 
> Uh oh: by 32 bit CPU, you mean "32 bits plus", right? Because our target is 64-bit. :( Or is 64-bits an absolute 
nightmare for QNX?
> 
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post15293
> 

-- 
cburgess@qnx.com
Re: Porting QNX to new architecture: any manuals/tips/must-reads?  
> We can run on 64bit chips, but we currently only support a 32bit model.  For 
> example, we run on 64bit MIPS processors, we save/restore the full 64bit
> regs, but the compiler believes that it runs in a 32bit world.

OK, that is a relief. On our side, there aren't any 32-bit toolchain issues I'm aware of, other than everyone just 
generally assuming things would be LP64 so the 32-bit side of things has gotten ignored a bit.

> True 64bit has yet to be done... although it would be doable.

Could you guess how much work might be involved? As far as 64-bit MIPS goes, is it mostly a toolchain issue, or kernel 
rework, or just patching up not-quite-64-bit-clean bits of code here and there? (Hopefully not everywhere :)
 
> Duraid Madina wrote:
> >> As others have noted, you need a 32 bit CPU with a full featured MMU or
> >> you're going to be in a world of hurt.
> > 
> > Uh oh: by 32 bit CPU, you mean "32 bits plus", right? Because our target is 
> 64-bit. :( Or is 64-bits an absolute nightmare for QNX?
> > 
> > _______________________________________________
> > OSTech
> > http://community.qnx.com/sf/go/post15293
> > 
> 
> -- 
> cburgess@qnx.com


Re: Porting QNX to new architecture: any manuals/tips/must-reads?  
On Mon, Oct 20, 2008 at 08:40:00PM -0400, Duraid Madina wrote:
> Uh oh: by 32 bit CPU, you mean "32 bits plus", right? Because our target 
is 64-bit. :( Or is 64-bits an absolute nightmare for QNX?

We've only done 32-bit so far. The code is supposed to handle 64 bits,
but until you've done it the first time, you know there are going to be
places that need tweaking. Doing a 64 bit version is something that we
plan to do eventually - it's always the next thing up until something 
more important comes along :-).

	Brian

-- 
Brian Stecher (bstecher@qnx.com)        QNX Software Systems
phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
       +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8
Re: Porting QNX to new architecture: any manuals/tips/must-reads?  
Fair enough. I guess I will just shoot for LP64, and if some enormous wall
appears I can drop back to a 32-bit world. It sounds like there's nothing
too bad hiding in there, though.


On Tue, Oct 21, 2008 at 08:31:00AM -0400, Brian Stecher wrote:
> On Mon, Oct 20, 2008 at 08:40:00PM -0400, Duraid Madina wrote:
> > Uh oh: by 32 bit CPU, you mean "32 bits plus", right? Because our target 
> is 64-bit. :( Or is 64-bits an absolute nightmare for QNX?
> 
> We've only done 32-bit so far. The code is supposed to handle 64 bits,
> but until you've done it the first time, you know there are going to be
> places that need tweaking. Doing a 64 bit version is something that we
> plan to do eventually - it's always the next thing up until something 
> more important comes along :-).
>
> 	Brian
> 
> -- 
> Brian Stecher (bstecher@qnx.com)        QNX Software Systems
> phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
>        +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8
> 
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post15310
>