Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document target hardware boards #25

Open
probonopd opened this issue Feb 7, 2015 · 36 comments
Open

Document target hardware boards #25

probonopd opened this issue Feb 7, 2015 · 36 comments

Comments

@probonopd
Copy link

It would be good to know the target hardware boards one needs to get started.

@ghost
Copy link

ghost commented Feb 11, 2015

The following is a suggestion.

From http://linuxgizmos.com/linaro-launches-open-arm-sbc-spec-and-an-octa-core-sbc/

"Linaro, the ARM-backed not-for-profit engineering organization that has aimed to standardize open source Linux and Android software for Cortex-A processors, is now trying to do the same thing for hardware. ... Linaro has launched an open-source spec for ARM SBCs called “96Boards,” first available in a $129 “HiKey” SBC, featuring a Huawei octa-core Cortex-A53 SoC."

This is likely to turn into the closest thing to standard ARM hardware. These boards will ship with Linux or Android, but that doesn't mean they wouldn't run Darwin.

For more information, see https://www.96boards.org

@b-man
Copy link
Member

b-man commented Feb 12, 2015

You can get a list of supported targets by looking at the machine_configuration file. I understand that the information that is provided is ambiguous, and I'll be working on improving documentation when I get the time (school is a priority atm).

@probonopd
Copy link
Author

On http://9to5mac.com/2013/11/22/developer-ports-ios-core-to-non-apple-hardware/ some clear text names of boards are mentioned. But I am not sure whether this information is still current.

  • ARM RealView Emulation Baseboard (ARMPBA8_ALT)
  • ARM RealView Platform Baseboard for Cortex-A8 (ARMPBA8)
  • Texas Instruments OMAP3530 (BeagleBoard/BeagleBoard xM) (OMAP3530)
  • Texas Instruments OMAP3430 (Nokia N900) (OMAP3430_RX51)
  • Texas Instruments AM335x (BeagleBone/BeagleBone Black) (OMAP335X)

In any case, it would be great to see the new Raspberry Pi 2 with the Broadcom BCM2836 (quad core Cortex A7 processor at 900 MHz, ARMv7 instruction set) to be supported.

@ghost
Copy link

ghost commented Feb 14, 2015

Thank you very much!

It turns out that the hacker responsible for the port joined Apple about a year ago…

http://www.cultofmac.com/267419/ios-jailbreak-hacker-winocm-joining-apple-later-year/ http://www.cultofmac.com/267419/ios-jailbreak-hacker-winocm-joining-apple-later-year/

Her GitHub page is here: https://github.com/winocm https://github.com/winocm

And her Twitter page is here: https://twitter.com/winocm https://twitter.com/winocm

-john

On Feb 14, 2015, at 06:43, probonopd [email protected] wrote:

On http://9to5mac.com/2013/11/22/developer-ports-ios-core-to-non-apple-hardware/ http://9to5mac.com/2013/11/22/developer-ports-ios-core-to-non-apple-hardware/ some clear text names of boards are mentioned. But I am not sure whether this information is still current.

ARM RealView Emulation Baseboard (ARMPBA8_ALT)
ARM RealView Platform Baseboard for Cortex-A8 (ARMPBA8)
Texas Instruments OMAP3530 (BeagleBoard/BeagleBoard xM) (OMAP3530)
Texas Instruments OMAP3430 (Nokia N900) (OMAP3430_RX51)
Texas Instruments AM335x (BeagleBone/BeagleBone Black) (OMAP335X)
In any way, it would be great to see the new Raspberry Pi 2 with the Broadcom BCM2836 (quad core Cortex A7 processor at 900 MHz ) to be supported.


Reply to this email directly or view it on GitHub #25 (comment).

@b-man
Copy link
Member

b-man commented Feb 14, 2015

cultibot,

Indeed. After she was approached by apple she appointed me and several others to carry on the project. Unfortunately I've been the only one in recent months working on this project and now my hands are tied with school and thus progress had stalled. Hopefully by this spring I'll have more time to fix a few more problems (kxld) and work on improving documentation.

It would be awesome to get this running on an armv8 system, however current support for armv8 is very minimal and somewhat broken (if anyone is willing to work on fixing this, please do!).

probonopd,

That list looks about right. One additional board that has been added was the Raspberry Pi A/A+/B/B+ (however support for this board hasn't been tested). Luckily I've recently acquired both a Raspberry Pi B+ and 2 B so I can start debugging support for those boards. A bit more work will need to be done to support SMP but hopefully that won't be too difficult to accomplish.

@ghost
Copy link

ghost commented Feb 14, 2015

At least I’ve located the community at the intersection of Darwin and ARM, which is a huge improvement over where I was a few days ago!

-john

On Feb 14, 2015, at 11:01, Brian McKenzie [email protected] wrote:

cultibot,

Indeed. After she was approached by apple she appointed me and several others to carry on the project. Unfortunately I've been the only one in recent months working on this project and now my hands are tied with school and thus progress had stalled. Hopefully by this spring I'll have more time to fix a few more problems (kxld) and work on improving documentation.

It would be awesome to get this running on an armv8 system, however current support for armv8 is very minimal and somewhat broken (if anyone is willing to work on fixing this, please do!).

probonopd,

That list looks about right. One additional board that has been added was the Raspberry Pi A/A+/B/B+ (however support for this board hasn't been tested). Luckily I've recently acquired both a Raspberry Pi B+ and 2 B so I can start debugging support for those boards. A bit more work will need to be done to support SMP but hopefully that won't be too difficult to accomplish.


Reply to this email directly or view it on GitHub #25 (comment).

@probonopd
Copy link
Author

b-man, I also have RPi Model B and RPi 2 Model B and I am looking forward to running Darwin on them.

@probonopd
Copy link
Author

Interesting:
https://github.com/darwin-on-arm/xnu/blob/master/pexpert/arm/raspberrypi.h

So it seems there has been work on the Raspberry Pi some time ago.

@ghost
Copy link

ghost commented Feb 15, 2015

@probonopd
Copy link
Author

It's really a shame that it's entirely undocumented.

@b-man
Copy link
Member

b-man commented Feb 15, 2015

Platform expert code is a bit of a mess at the moment, I'm also planning on cleaning up bsp code and creating a more consistent set of apis (for misc. tasks such as memory read/write, barriers, ect) and in the process I'll document the code (and reformat the code to be more consistent to the style used in the rest of the kernel).

@NF3RN0
Copy link

NF3RN0 commented Mar 5, 2015

Is it possible to build for the raspberry pi B+ at this time? If so what make arguments do I need to pass?

I have tried:

make TARGET_CONFIGS="release arm RASPBERRYPI"

ld: file is universal (6 slices) but does not contain a(n) armv6 slice: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib/darwin/libclang_rt.cc_kext.a file '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib/darwin/libclang_rt.cc_kext.a' for architecture armv6

I think i am runing into a link error because I have xcode 6 and it does not support armv6. I am not sure at this point how to approach getting the right armv6 toolchain from xcode 4.4.

@b-man
Copy link
Member

b-man commented Mar 5, 2015

Unfortunately building for the Raspberry Pi A/A+/B/B+ is broken at this time and as you've guessed this is mainly due to the lack of armv6 support in the Xcode toolchain. Adding support to the Linux-based darwin-sdk shouldn't be too difficult (hopefully), but for Xcode we may need to come up with a custom toolchain bundle to properly support cross compiling armv6 in that environment.

Aside from building the kernel for armv6, we will also need to be able to build the userspace components to support armv6. Currently we don't have a method to build any userspace components in a portable way for either armv6 or armv7. One possible solution to this problem would be for us to adapt a bsd-style build system which allows us to build the entire OS in one swath. Unfortunately this means that we would likely need to abandon Apple's style of source code distribution (in the form of entirely independent source trees), but for what we need this would probably be the sanest approach.

@probonopd
Copy link
Author

Why not focus on Raspberry Pi 2 with its ARMv7 instruction set?

@ghost
Copy link

ghost commented Mar 6, 2015

While it’s obviously not my place to say this, having contributed nothing at all to the project, except a (possibly misplaced) sense of urgency, it seems to it seems to me that targeting a platform that’s at the beginning of its product cycle and has as much potential as the Raspberry Pi 2, both technologically and in market terms, since it is primed to ride the wave of popularity of earlier Raspberry Pi designs, is sure to generate more interest in this project than a successful port to older versions of that same platform.

Say it takes a year to accomplish the port, by that time Darwin on older model Raspberry Pi boards (Arduino, …) will draw a yawn, but ARMv7 will still be current.

Just saying. I understand nothing at all about the complexities of actually performing an os port.

-john

On Mar 6, 2015, at 10:40, probonopd [email protected] wrote:

Why not focus on Raspberry Pi 2 with its ARMv7 instruction set?


Reply to this email directly or view it on GitHub #25 (comment).

@ghost
Copy link

ghost commented Mar 6, 2015

To carry that logic a bit further, (perhaps beyond the breaking point), there will undoubtedly be a Raspberry Pi built on the 64-bit ARMv8-A architecture, probably within that year. So perhaps it would be better to aim directly for that. Single board computers using ARMv8-A chips are already starting to appear, so this wouldn’t have to proceed in a complete vacuum.

-john

On Mar 6, 2015, at 11:06, John Payne [email protected] wrote:

While it’s obviously not my place to say this, having contributed nothing at all to the project, except a (possibly misplaced) sense of urgency, it seems to it seems to me that targeting a platform that’s at the beginning of its product cycle and has as much potential as the Raspberry Pi 2, both technologically and in market terms, since it is primed to ride the wave of popularity of earlier Raspberry Pi designs, is sure to generate more interest in this project than a successful port to older versions of that same platform.

Say it takes a year to accomplish the port, by that time Darwin on older model Raspberry Pi boards (Arduino, …) will draw a yawn, but ARMv7 will still be current.

Just saying. I understand nothing at all about the complexities of actually performing an os port.

-john

On Mar 6, 2015, at 10:40, probonopd <[email protected] mailto:[email protected]> wrote:

Why not focus on Raspberry Pi 2 with its ARMv7 instruction set?


Reply to this email directly or view it on GitHub #25 (comment).

@b-man
Copy link
Member

b-man commented Mar 7, 2015

cultibot,

I understand what your getting at and I agree with you. I know that when winocm had started this project, she had a (perhaps overly ambitious) goal to have her kernel and OS support a range of subarchitectures and instruction sets (armv5te - armv8).

At this time the kernel currently has (untested) support for armv6, bare bones support for armv8, and (almost) full support for armv7. Given the limited time I have to work on this project, and the fact that winocm has had to move on from this project after getting her intern ship at apple, perhaps we should reevaluate our prioritization to hardware support so we don't fall behind.

  • Currently, my priority is to complete the OS port for armv7 (since it's already almost there) and begin work on armv8 when I can get access to the hardware (Unless someone wants to start working on this right now). Work on armv6 will likely be placed on the backburner unless someone wants to step up and work on what I explained earlier.
  • The raspberry pi 2 will become my primary platform of focus to support armv7. (previously this was an emulated ARM RealView PlatformBuilder A8).
  • My secondary platforms will be the BeagleBone Black and the Nokia N900 (the later due to commitments I've made with a generous fellow who donated hardware). Basic support for both of these platforms is already implemented in the kernel and both are tested. I personally haven't tested N900 support yet though, but it apparently boots.

My major plans for this project going forward will be:

  • Fix remaining bugs in the kernel, clean up pexpert, and implement armv7 SMP support.
  • Adopt one of the BSD's build systems or use DHowett's theos so we can start building Darwin's user space components (and eliminate our dependency on the binary-only ramdisk for testing).
  • Implement a proper debug environment that everyone can use right away.

Since I don't own a mac, my development environment has been primarily in Linux. Given that the OSX 10.10 port to the Surface Pro 3 has been making good progress, I may set up a dual boot environment on my machine so I can properly test builds in OSX without relying on a VM. I would also like to make darwin-sdk usable on OSX. Given that I've eliminated the need for a custom toolchain via the use of wrappers that use the host systems' clang toolchain this shouldn't be too difficult of an undertaking.

@ghost
Copy link

ghost commented Mar 7, 2015

Sounds great!

May I copy that post over to a couple of forums where it might act to drum up a little assistance from one or more others with the chops to actually contribute substantively?

-john

On Mar 7, 2015, at 11:35, Brian McKenzie [email protected] wrote:

cultibot,

I understand what your getting at and I agree with you. I know that when winocm had started this project, she had a (perhaps overly ambitious) goal to have her kernel and OS support a range of subarchitectures and instruction sets (armv5te - armv8).

At this time the kernel currently has (untested) support for armv6, bare bones support for armv8, and (almost) full support for armv7. Given the limited time I have to work on this project, and the fact that winocm has had to move on from this project after getting her intern ship at apple, perhaps we should reevaluate our prioritization to hardware support so we don't fall behind.

Currently, my priority is to complete the OS port for armv7 (since it's already almost there) and begin work on armv8 when I can get access to the hardware (Unless someone wants to start working on this right now). Work on armv6 will likely be placed on the backburner unless someone wants to step up and work on what I explained earlier.

The raspberry pi 2 will become my primary platform of focus to support armv7. (previously this was an emulated ARM RealView PlatformBuilder A8).

My secondary platforms will be the BeagleBone Black and the Nokia N900 (the later due to commitments I've made with a generous fellow who donated hardware). Basic support for both of these platforms is already implemented in the kernel and both are tested. I personally haven't tested N900 support yet though, but it apparently boots.

My major plans for this project going forward will be:

Fix remaining bugs in the kernel, clean up pexpert, and implement armv7 SMP support.

Adopt one of the BSD's build systems or use DHowett's theos so we can start building Darwin's user space components (and eliminate our dependency on the binary-only ramdisk for testing).

Implement a proper debug environment that everyone can use right away.

Since I don't own a mac, my development environment has been primarily in Linux. Given that the OSX 10.10 port to the Surface Pro 3 has been making good progress, I may set up a dual boot environment on my machine so I can properly test builds in OSX without relying on a VM. I would also like to make darwin-sdk usable on OSX. Given that I've eliminated the need for a custom toolchain via the use of wrappers that use the host systems' clang toolchain this shouldn't be too difficult of an undertaking.


Reply to this email directly or view it on GitHub #25 (comment).

@b-man
Copy link
Member

b-man commented Mar 7, 2015

Sure, that would be great! :)

@ghost
Copy link

ghost commented Mar 8, 2015

Done. I posted it in a Boulder-centric iOS developer meetup.com http://meetup.com/ group, and in the Macintosh conference on The WELL.

Spare time is a rarity these days, of course, but I’m all but certain that both of these forums include a few individuals who could pitch in if they were to decide to make it a priority. Failing that, they might help spread the word.

-john

On Mar 7, 2015, at 12:11, Brian McKenzie [email protected] wrote:

Sure, that would be great! :)


Reply to this email directly or view it on GitHub #25 (comment).

@b-man
Copy link
Member

b-man commented Mar 9, 2015

Thanks!

@Floris497
Copy link

Is this going to work an an i.MX 6Quad PoP CPU form Freescale? (UDOO Quad board) it has 4 Cortex-A9 cores.

@b-man
Copy link
Member

b-man commented May 9, 2015

Provided that you've implemented the board-specific initialization code within GenericBooter and pexpert, yes. However, SMP support hasn't been implemented yet so you won't be able to take advantage of those extra cores yet.

@Floris497
Copy link

@b-man oh, that are a lot of unknown words for me, i need to study this a little better, any idea if multi core is going to be implemented ever? or if it is hard to learn how to code that myself? thanks for the answer!

@b-man
Copy link
Member

b-man commented May 10, 2015

@Floris497 SMP (Symmetric Multi Processing aka multicore) support should be implemented eventually. There are still a few more serious memory corruption bugs that I need to resolve first (MAC label freeing - see security/mac_label.c) and some odd behavior when redirecting output to text files within the bash shell (along with quite a few other things). As for your last question, I can't say unless I know what you are experienced in. :) Implementing SMP support for xnu will require a good amount of knowledge on the ARM architecture as well as a good understanding about how xnu is designed.

@Floris497
Copy link

@b-man I think i have 0 experience whit this, I had hoped to compile a standart kernel and get it to boot, maybe whit a kernel panic or not that is not a problem, I want it to boot first. but this might be a little off topic on this issue? is that a problem? i have no idea what kind of boot loader i need/can use. but i think i need to do some reading on boot loaders and how kernels are loaded into memory.

@b-man
Copy link
Member

b-man commented May 10, 2015

@Floris497 It's hardware-related, so not a big deal. Since you are new to low-level software development, I would recommend that you read up on what is involved when writing software for the ARM architecture: (http://wiki.osdev.org/ARM_Overview). ARM also provides freely available documents and training materials for the ARM architecture on their website: http://www.arm.com/support/arm-accredited-engineer-program/accreditations/arm-accredited-engineer/aae-learning-resources.php. I would also recommend that you study the relevant documents for your development board on Freescale's website.

There are also a lot of great practical examples for low-level programming on an ARM-based system on the Raspberry Pi's bare metal subforum (although a lot of that will be specific to the BCM2835/6 SoC).

As for what will be involved to get Darwin booting on your board, as I've explained you will need to port GenericBooter and pexpert (the Platform Expert). GenericBooter is basically a chain loader that gets loaded and executed by u-boot (which normally boots Linux). GenericBooter's primary job at this time is to basically grab the kernel, device tree, and ramdisk, map them into memory, and then execute the kernel. Once the kernel is in control it initializes the rest of the hardware (system timer, interrupt controller, graphical framebuffer (optional), serial uart) through the Platform Expert (pexpert/arm).

@probonopd
Copy link
Author

It would be great indeed if there was a step-by-step description of what is needed to boot xnu on the Raspberry Pi 2. I'd be willing to test immediately, as I am sure would be many others.

@b-man
Copy link
Member

b-man commented May 11, 2015

Now that I'm done with finals and I have free time, I'll resume work for the RPi2 port this week.

@Floris497
Copy link

I have this exact problem: #26
I have no idea how to port GenericBooter, Is it only adding a new platform and adding the right dresses for UART and RAM in the config.c file?
Do I need to compile the kernel first before I can make the GenericBooter?
and do I need pexpert to see if i'm even making something that works?

Is there a kernel already supported for cortex-A9 or do i need to make changes to the kernel as well?
and how do I convert a dmg into an img3 file?

@musisat
Copy link

musisat commented Jun 1, 2015

HI b-man. Are you still planning on working on this project this summer? Are you able to boot into the login page yet? Because I just get into panic mode when I try to boot up.

@Floris497 Use Image3maker to convert dmg to img3 files.

@Floris497
Copy link

@musisat ah, thank you! first need to find time again..

@b-man
Copy link
Member

b-man commented Jun 1, 2015

Hello musisat,
I am still planning to continue to work on this project this summer. I've just been busy with other responsibilities that have ended up taking up more time than I expected. On the realview-pba8, Darwin should be able to boot to the login prompt (as with the BeagleBone black - but I haven't tested that very recently). Which board are you using? Could you paste your panic log?

@musisat
Copy link

musisat commented Jun 9, 2015

Sorry I forgot to reply to this. It was a device tree issue but I fixed it using your other suggestion.

@probonopd
Copy link
Author

To come back to the original topic, the README mentions "OMAP3530 OMAP3430_RX51 OMAP335X ARMPBA8 S5L8930X S5L8920X S5L8922X" but fails to say which boards these are for.

@x56
Copy link
Contributor

x56 commented Jun 20, 2015

To the best of my knowledge, the following hardware was tested for each configuration listed:

OMAP3530: BeagleBoard, BeagleBoard xM
OMAP3430_RX51: Nokia N900
OMAP335X: BeagleBone, BeagleBone Black
ARMPBA8: ARM RealView PB-A8
S5L8930X: Apple A4 devices (iPhone 4; iPod 4th Generation; iPad 1)
S5L8920X: iPhone 3GS
S5L8922X: iPod Touch 3rd Generation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants