tech-embed archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Where to start...?



Hello Erik,

  EA> - A root device: if you don't have a hardrive you can use a
    >   memory disk embeded in the kernel (like in the installation-
    >   kernel) or NFS.

I'm keen to try the memory disk idea.  I plan to build a firewall soon
and would like it to have just a CD-ROM drive.  Some (which?) parts of
the filesystem need to be read/write.  If they're small enough, I can
have the rest mount read-only.

  EA> - Your own statically linked /sbin/init on the root device. This
    >   is the only userland process started by the kernel so if your
    >   system only need to run one program call it init and place it
    >   in /sbin. (Your program might have to do some of the things
    >   that the original init does, e.g. if your program wants do
    >   console io you will need a /dev/console and your init will
    >   have to open that device and dup2 fd's 0, 1 and 2 to that fd).

I think I get understand what you're saying, and where the application
is simple and space is at a premium I can see the sense in that
approach.  I'm not sure I'll try it just yet though ;-)

  EA> You can of course use the standard init and instead creat your
    > own /etc/rc.

That sounds like the direction I'll take.

  EA> If you want dynamically linked programs you will also need a
    > /usr/lib filled with the libraries your programs use (running
    > ldd on a binary will list does) and /usr/libexec/ld.elf_so is
    > also needed.

Hmm... can /usr/lib be read-only?

  EA> Some programs (like netstat) need to lookup data in the kernel
    > and for that they need the kernel symbol table. Normally the
    > symbol-table is read from /netbsd but if you use a memory disk
    > embeded in the kernel you might not want to put a kernel there

<grin>

  EA> ...If that is the case you can use kvm_mkdb (8) to create a
    > /var/db/kvm.db that will be used instead.

I'll look that one up, I can see myself using it when I get to ROM or
Flash based systems.  For the machines with CD-ROM drives, could
/netbsd be a link to the kernel on the disc?

  EA> If you use existing programs you will of course need to lookup
    > what libraries they need (if dynamically linked), what config
    > files they use, other directories (e.g. they might want to put a
    > log file in /var/log) and if they exec other programs.

It sounds as though I have plenty of homework to do!  :-)

  EA> That's all I can think of for the moment.

Thanks a lot, you've given me enough to get started and that is
appreciated.

Regards,
  - Andy Ball.



Home | Main Index | Thread Index | Old Index