kiran_14
Posts: 1
Joined: Sat Jan 03, 2015 1:51 pm

raspberry pi and systemd

Sat Jan 03, 2015 2:06 pm

Hello,

My project is to design an embedded system which can be used to communicate through TCP/IP socket programming.

is it possible to design my raspberry pi to work with Linux kernel without using any operating system. Recently i heard systemd is used to load user programs in to RAM instead of OS.

And also i collected information about how raspberry pi is working.

When the Raspberry Pi is first turned on, the ARM core is off, and the GPU core is on. At this point the SDRAM is disabled.
1. The GPU starts executing the first stage bootloader, which is stored in ROM on the SoC. The first stage bootloader reads the SD card, and loads the second stage bootloader (bootcode.bin) into the L2 cache, and runs it.
2. bootcode.bin enables SDRAM, and reads the third stage bootloader (loader.bin) from the SD card into RAM, and runs it.
3. loader.bin reads the GPU firmware (start.elf).
4. start.elf reads config.txt, cmdline.txt and kernel.img

What happens after kernel.img is loaded?
after loading kernel.img, how should i run my applications instead of running OS?

fruitoftheloom
Posts: 21593
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: raspberry pi and systemd

Sat Jan 03, 2015 6:22 pm

Retired disgracefully.....
......to a more gentile life !

ghans
Posts: 7881
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: raspberry pi and systemd

Sat Jan 03, 2015 6:26 pm

The Linux kernel is really the defining part of a Linux-based operating system , hence the name. Saying that software running on top of
it is running "without an OS" is a bit off.

That said just learn how the Linux Kernel works and how to write an init replacement. init is the very first program run by the kernel. (The first so-called
"userland" program).

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

fruitoftheloom
Posts: 21593
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: raspberry pi and systemd

Sun Jan 04, 2015 1:26 am

Retired disgracefully.....
......to a more gentile life !

ronyoung1
Posts: 6
Joined: Fri Oct 11, 2013 6:37 am

Re: raspberry pi and systemd

Tue Jan 06, 2015 8:23 pm

I second ghans's recommendation... Just replace the /sbin/init system program with your code. There are several things that you may want to keep in mind: you may want to use static linking to simplify what libraries you need. You will probably have to work on configuring your network directly and remember that you will be running as root. One other thing, you will need to look into "reaping" zombie processes.
Some processes that abort that don't have a parent get inherited by /sbin/init...

/sbin/init is the program that starts all of the other system services so the system will look different
than normal... you may want to start with a simple init replacement that just forks an interactive shell that you can use to explore with...

-ron

dwelch67
Posts: 961
Joined: Sat May 26, 2012 5:32 pm

Re: raspberry pi and systemd

Wed Jan 07, 2015 3:07 pm

this is a baremetal forum, I imagine there are some other forums that might have more folks to help, C programmers, etc...

Return to “Bare metal, Assembly language”