On Apr 15, 6:54am, Thor Lancelot Simon wrote: } On Wed, Nov 23, 2011 at 12:06:26PM +0100, Christoph Egger wrote: } > On 11/23/11 11:47, Thor Lancelot Simon wrote: } > >Module Name: src } > >Committed By: tls } > >Date: Wed Nov 23 10:47:50 UTC 2011 } > > } > >Modified Files: } > > src/distrib/sets/lists/etc: mi } > > src/etc/defaults: rc.conf } > > src/etc/rc.d: Makefile } > > src/sbin/rndctl: rndctl.8 rndctl.c } > > src/sys/dev: rnd.c } > > src/sys/secmodel/securelevel: secmodel_securelevel.c } > > src/sys/secmodel/suser: secmodel_suser.c } > > src/sys/sys: kauth.h rnd.h } > >Added Files: } > > src/etc/rc.d: random_seed } > > } > >Log Message: } > >Load entropy at system boot (only works at securelevel< 1); save } > >at system shutdown. Disable with random_seed=NO in rc.conf if desired. } > > } > >Goes to some trouble to never load or save to network filesystems. } > > } > >Entropy should really be loaded by the boot loader but I am still } > >sorting out how to pass it to the kernel. } > } > How about passing it as a module similar to the multiboot technique?
We can't load modules when doing multiboot. } Can't make one of those without an ELF toolchain, right? The basic } idea's about right, but I actually need something less sophisticated in its } packaging -- a way to just give the kernel the address of blob-of-stuff } the bootloader's dropped into place for it, so the entropy pool code } can just take it and prime itself. Currently, a kmod is an ELF binary. However, I had a look at the code and I think without too much effort we can achieve what you want. My suggestion is that you create a blob that looks like: - header; could be just the string "DATAMODULE" - modinfo_t using a new MODULE_CLASS_DATA (see <sys/module.h>) - any header that you require - your data A new function will be added: const *module_data(const *name, size_t *datalen); name will be the name of your module. It will return NULL if the module isn't found; otherwise, it will return a pointer to your header and datalen will be the length of your header plus data. When the system is presented with this blob, it will load it into memory and store it without doing anything with it. It will work from boot for those platforms that can do it (i386 and amd64) or via modload(8). A good chunk of the code needed to do this is similar to code that I need for one of my projects. I intend to work on that project during December (I've already done a significant chunk of it), and could probably do this alongside. I designed this to make it generic to any kind of data one might want to load in this manner. }-- End of excerpt from Thor Lancelot Simon