Skip to main content
3 of 9
added 651 characters in body
Krzysztof Adamski
  • 9.6k
  • 1
  • 38
  • 53

##Some background## The most important thing you should know is that RaspberryPi is a strange beast where ARM CPU is not main CPU - it's only co-processor of VideoCore GPU. When RaspberryPi starts, GPU blob is read from SD card to L2 cache and run. This code then brings all the important peripherals (RAM, clocks etc) and starts ARM CPU. Then 2nd stage bootloader or some operating system itself can be run on ARM CPU.

GPU blob is not only a bootloader. It's actually an operating system (Video Core OS) by itself. Some important elements of the system are not directly accessible by ARM CPU and it has to communicate with GPU (using mailbox messaging system) to use them. There is some partial documentation about this available. Now Video Core OS (VCOS) is extended from time to time by Broadcom employees to enable features needed by Linux kernel, RISC OS or sometimes even some hobby OSes. There is no good documentation about this however, you would have to dig in RaspberryPi forum, github and possibly other places to find information about this. But it's there.. somewhere. And there are a few people who write they own bare metal code or even OSes on RaspberryPi to help you out. And of course a lot of open source code - RasbperryPi's Linux kernel for example.

VideoCore is proprietary, there is no official documentation and development tools. So unless you want to put a lot of effort, you can't rewrite VCOS with your own code. Another problem is USB stack which is proprietary Synopsys one and again there is no documentation for it and it seems that even with documentation it's hard to implement it reliably. But again, the code is available. Using advanced graphics capabilities of Video Core may also be hard - there is some open source code for the graphics libraries but it's only for the ARM side.

That being said, it was possible to make RISC OS port from the information available (it's not entirely clear to me if they were using only publicly accessible information, though), some people are rewriting (independently from Broadcom) Linux kernel for mainline, there is FreeBSD port, 'U-boot` and others. So it is definitively possible to write your own OS. It's just not as easy as it might possibly be.

Your goals

Number 1

As far as I know, there is no way that SoC could start in other way than described. So first stage bootloader has to be on SD card. And it has to be GPU binary, not ARM binary which is another problem. And there is no on board flash in RaspberryPi which is also a problem.

Number 2

The main problem is that there is no on board flash on RaspberryPi. You could add one and it could be activated in your bootloader (which would have to be 2nd stage bootloader already). Writing USB driver would be problematic, however.

Number 3, 4, 5

This shouldn't be much problem. Most of peripherals (at least those avaiable for ARM) are documented here. Existing bootloader makes this even easier since you get your SoC completely configured. You can look here and here for some code and documentation.

Alternatives

I don't know any other board as good as RaspberryPi so it's hard to recommend something but you may take a look at some mature projects like Beagleboard/Beaglebone/Pandaboard or you can follow development of some new boards like Cubieboard. It all depends on what exactly you want to accomplish.

Krzysztof Adamski
  • 9.6k
  • 1
  • 38
  • 53