12

I am new to kernel and embedded Linux. I have recently bought a Raspberry Pi and booted it using the Raspbian. I was fascinated by the Pi, to learn more on Embedded I have decided to make an home automation system. I wanted to use my own kernel, and stack. ie I don't want to use any of the OS.

For that I have download Kernel, target_fs, firmware, and tool-chain from the official github. I have compiled the kernel using the tool-chain.

Now I don't know how to put this to a new sdcard (formatted for a fresh start). What all things I have to take care before booting my stack? Since I have not put ssh or telnet server/Client, how can i know the boot was successful. Where can I get a ssh/telnet daemon for the pi? My aim is to boot only the kernel(or bare minimum) in the Raspberry Pi.

2
  • 2
    This is a herculean task and I don't think you have enough experience yet. Considered just adjusting an existing distribution and save 99% of the time? Jan 9, 2014 at 7:16
  • 1
    I realize this is a bit old, however I recently learned about MLL, which is another way to build a minimal Linux os. As a Linux neophite myself I found MLL instrumental in learning the process. I am currently researching the process by which to include the Raspberry Pi drivers in the build. MLL minimal.linux-bg.org/#home Best of luck!
    – Rob
    Feb 18, 2018 at 2:25

3 Answers 3

10

The kernel expects two things: a root filesystem, and an init daemon that resides on it. The init included with raspbian is a sysV style system. You are not tied to that -- other init systems commonly used with linux (remember: the kernel is linux) are systemd and upstart -- but you do need an init system of some sort.

You can also put init in an initramfs and have it built into the kernel, in which case you could get away without a root filesystem, but that seems pointless in this case.

init is the only userland application started by the kernel. Normally, it then starts processes which open ttys with a login, and then other services that may start a display manager, sshd, etc. You may not need the login, but you probably want the tty; you could also just start sshd directly instead.

Where can i get a ssh/telnet daemon for the pi?

Get it from the same place raspbian did, the upstream source. None of this stuff was written specifically for the pi. Or at least, very very little of it. It's been used on a huge variety of different systems.

If you want one pre-compiled for the pi...well, that's raspbian, etc.1

i don't know how to put this to a new sdcard

You'll have to use the pi-specific bootloader which is in the /boot partition of the raspbian image.


1. To be brutally honest, I think you are on a massively quixotic quest that, based on the knowledge implied by your question, you have virtually no hope of accomplishing this year unless you quit your job and devote yourself to learning full time, and even then your chance of failure is very high and it will take you months to reach a point where you have any chance of success. It is not simple. It is not easy. That said, even if you do fail, you will probably learn some useful things along the way. However, the time might be better spent learning to understand an existing distribution (such as raspbian) and how to use it to create your home automation system.

1
  • 1
    quixotic? You're one of the only people I know who routinely challenge my vocabulary. +1 for that alone.
    – Jacobm001
    Jan 14, 2016 at 4:48
7

For just getting started, I think you have the wrong concept of using embedded computers (especially at the Raspberry Pi level). If you really want to build a custom OS I suggest you start at Linux from Scratch, LFS, http://www.linuxfromscratch.org/ but if you want to understand embedded computing start by Googling "embedded systems", Wikipedia, or Embedded Linux Wiki http://elinux.org/Main_Page.

1
  • 1
    +1 for LFS. I'd want to do that in a cross-compile setting though!
    – goldilocks
    Jan 8, 2014 at 16:23
-1

I had the same problem. I created a collection of shell scripts, for exactly that purpose.

http://www.dettus.net/detLFS

1
  • Welcome to Raspberry Pi! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Aug 7, 2016 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.