On 14/09/2020 18:49, Scott Alfter wrote:
> In article ,
> ray carter wrote:
>> On Thu, 10 Sep 2020 12:47:40 +0100, The Natural Philosopher wrote:
>>> I just want to run one high priority daemon and one lower priority
>>> demon, with shared memory between them...is there something simpler than
>>> Linux? More like e.g. DOS?
>>
>> You could also do LFS (Linux From Scratch) - you'd build up from nothing
>> instead of try to remove. Absolutely nothing in there that you don't want.
>
> There's also Gentoo Linux, which you could think of as a more automated LFS.
> You can even get a proper 64-bit userland under Gentoo on the RPi 3 & 4;
> it's been around for probably at least a year now while Raspbian is just now
> getting around to a 64-bit beta.
>
> It's also systemd-free, unless you select otherwise.
I've been looking at all the options and trying to understand the boot
process and the kernel threads.
First of all thank you everyone, because ist been an interesting
extensions of the knowledge base.
It seems that the pi boots (via the GPU) some stock boot loader that
tarts around with the hardware using instructions found in config.txt
and then boots a default kernel (on my Pi zero its simply kernel.img) -
or one specified in config.txt in the FAT formatted boot partition. A
few parameters may be passed to that: device drivers are specified in
config.txt and cmdline.txt has a few more boot options like where to
find the root filesystem.
Now this is the bit that I am not sure about - the kernel having booted
from the FAT partition then invokes - I assume - /sbin/init, which in my
case is linked to systemd.
I understand that in some sort of way it needn't be, or it could be
specified to NOT be /sbin/init....(where?)
So effectively one can intercept the boot process before systemd gets is
ugly evil claws into the nice shiny Linux, and run something else -
busybox?
So in principle one would lose all the daemons spun up by systemd as
default - logging, hotplugging and so on would all simply never get
started ... and start only those required - network layer perhaps.
I wonder what apache needs to start it? Never mind. Don't need it, just
need a very simple web server for control purposes, could even write one
that lived in user space so didn't pre-empt valuable real time
background task cycles.
And that brings me to the next question.
Assuming I am just running a kernel, plus networking of some sort, I
still have all the kernel threads which don't seem to take up CPU time,
or do they?
Under systemd on my system (it uses NFS, hence the related daemons,
these would not be needed in the system I want to build) I have..
ps -eadf | grep "1 0" | awk '{print $8}'
/lib/systemd/systemd-journald
/usr/sbin/blkmapd
/lib/systemd/systemd-udevd
/lib/systemd/systemd-timesyncd
/usr/sbin/rpc.idmapd
/usr/bin/dbus-daemon
/usr/sbin/cron
/usr/sbin/rsyslogd
/lib/systemd/systemd-logind
/usr/lib/rtkit/rtkit-daemon
avahi-daemon:
/sbin/wpa_supplicant
/usr/sbin/thd
wpa_supplicant
/sbin/dhcpcd
/sbin/rpcbind
/usr/sbin/sshd
/usr/sbin/rpc.mountd
/sbin/agetty
/sbin/agetty
/usr/sbin/apache2
/usr/sbin/exim4
/usr/lib/policykit-1/polkitd
/lib/systemd/systemd
grep
The ONLY one of those I might need (this is a pi zero W) is
wpa-supplicant and children. Or the equivalent on an ethernet equipped Pi...
So my next questions are:
1/. How much latency do the kernel thread processes conceivably
introduce? There are an awful lot of them. If these are insurmountable
that really rules out Linux altogether.
2/. How interruptible are they by interrupts coming from the Pi's GPIO
pins? I want my handler to have top priority for its run - whose length
is a bit indeterminate till I know how fast the pi executes floating point.
3/. What have I forgotten that systemD does that I might actually need?
For the purposes of setting the context for the last question, the Pi
would be sitting there waiting for a low priority webserver request,
executing low priority foreground code in an interruptible loop, and
responding to time critical interrupts on a GPIO pin.
Disk access would not be involved in the initial prototype.
By using suitable buffering I might be able to cope with 50ms max time
spent by the pi doing housekeeping.
--
New Socialism consists essentially in being seen to have your heart in
the right place whilst your head is in the clouds and your hand is in
someone else's pocket.
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|