I personnally am looking for the exact boot sequence used by linux and any
failure routines.

I have looked around on the net and in the usual howto's

What i think ive figured out so far....

1) lilo/loadlin/syslinux or something simmilar to get the kernel image
into memmory...

2) kernel decompress itself and runs it's own startup/init code.
(by init code im thinking of hard_coded paths/filenames etc)


3) kernel mounts it root file system useing compiled in data
(modified by rdev or command line passed to kernel when it's started)
(ie root fs may be mounted read_only or read_write etc)

4)Attempt to run          /sbin/init
    which reads           /etc/inittab
    which will run        /etc/rc.d/rc.XX depending on runlevel of system
                          these files being much like config.sys and
                          command.com in the dos world.
                          an init level of 1 does not require an inittab
                          file but will try to launch /bin/sh on
/dev/console
                          Related files
                          /sbin/init
                          /etc/inittab
                          /etc/initscript
                          /dev/console
                          /etc/ioctl.save
                          /var/run/utmp
                          /var/log/wtmp
                          /dev/initctl

Emergency mode..
In the event of not finding an /sbin/init file the system will attempt to
load and run  /bin/sh which is usually a link to /bin/bash or some other
such shell.

This action requires that /lib/ld.so
                          /lib/ld.linux.so (link to ld-linux.so.1)
                          /lib/ld.linux.so.1 (link to ld-linux.so.1.9.6)

                          ld.so        = a.out dynamic linker/loader
                          ld.linux.so  = ELF dynamic linker/loader



both search for librarys to link against at run time in...
LD_AOUT_LIBRARY_PATH or  /etc/ld.so.cache or in the default path /usr/lib
and then /lib

Lib types
       lib*.so.version     shared libraries
       lib*.sa             exported initialized library data. (static ?)

Note if ld.so and ld.linux.so are missing only a fully static programs can be
loaded as /bin/sh  Possibly of more use in embedded systems ?

This sort of looks right to me but playing with a stripped down system
sort of confirms things except that it does not seem self consistant in
emergancy mode (after i removed init and all its related files)

it would sometimes boot /bin/sh and other times it would complain about
auto: auto file not found and then hang whilst at other times it would
seem
to work.

Also when its working and loading /bin/sh which is a link to /bin/bash
on my system it needs libc and libtercap in /lib (dynamically linked bash)
so far so good but replacing bash with a static compiled copy it can still
not work. and wont work till ive had to put so much stuff back into the
system that ive lost track of whats needed by what.



This only proves that im still not very clear on linux's boot up method
and related files and dependancys.

Could you help by giveing a brief description of what goes on here.
(or ill rtfm if i can find one anywere that covers this stuff)

Span...

Reply via email to