9

Is there a way to use the Raspberry Pi like an Arduino? That is, without an operating system?

Just connect it to the USB of your computer and download code onto it, and the next time the Raspberry Pi boots, it runs that program (infinitely). Just as an Arduino would.

When I googled how to use the Raspberry Pi like an Arduino, all I get is using the Raspberry Pi's GPIO and not something what I'am looking for.

What I finally want to do is develop my own bootloader and a bare bones OS using assembly language, C and ARMGCC. So I need a way of burning the code onto my board.

How can I do this?

Peter Mortensen
  • 2,004
  • 2
  • 15
  • 18
deepak
  • 581
  • 1
  • 6
  • 8

2 Answers2

9

Look at the lesson Baking Pi – Operating Systems Development. It's an ARM-only lesson, but it uses pieces of C for the USB driver.

Peter Mortensen
  • 2,004
  • 2
  • 15
  • 18
chriga
  • 106
  • 1
  • where is the link for the USB driver part, i could not find it!! but thanks for the answer, solves most of my problem. but is there a way to boot without a sd card?? – deepak Mar 03 '13 at 15:40
  • No, there is not any way to boot without an sd card installed as the card firmware is resident on the card – Eineki Mar 04 '13 at 01:28
  • @deepak : you can find it on the author's Github : https://github.com/Chadderz121/csud – chriga Mar 04 '13 at 19:33
  • @deepak You can boot a Pi 3 without an SD card, but all other Pis to this point, including the Zero W, need to read bootcode.bin from an SD card. (Everything after that can come off another device if you are using new enough software.) – cjs Apr 16 '17 at 18:04
4

Raspberry Pi ARM based bare metal examples is another good reference. First you'll need to learn how the Raspberry Pi operates, how it boots, what's needed to get your code running without an existing operating system and so on - the README gives you a lot of information.

Peter Mortensen
  • 2,004
  • 2
  • 15
  • 18
nos
  • 1,106
  • 2
  • 10
  • 14