<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sun, 28 Nov 2010 02:50:04
From   : ats@... (Adam Sampson)
Subject: [BeebSoc] Killing Linux - but how?

Rick Murray <heyrick.beebsoc@...> writes:

> Can you load kernel modules on-demand (as opposed to the init script)?

Yes -- "insmod foo.ko". These days they're usually loaded on the fly as
hardware is discovered.

> I'm still not certain how to dismount the active filesystems from a
> currently-running Linux.

You'll have difficulty unmounting filesystems that are in use, but you
can remount them as read-only -- "mount -o remount,ro /mountpoint".  I
don't know how much userspace intelligence your device has, but I'd
strongly recommend either taking it down to single-user mode or building
a very simple userspace that only loads your kernel module, rather than
booting into a full system -- less stuff to clean up first.

> But... how do I know the memory chunk used is contiguous?

The kernel lives in a physically-contiguous chunk of space, so when you
load a kernel module it'll automatically be contiguous. (Again, this is
on IA32, but I assume it's similar on ARM?)

If you need the image to be at a particular physical location (e.g. in
order to use the rest of RAM), you can always memmove it down once
you've disabled interrupts etc.  The OS we built didn't do this, because
at the time it had sufficiently tiny memory requirements that we could
just compile in an array for it to allocate out of.

-- 
Adam Sampson <ats@...      >                         <http://offog.org/>
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>