Friday, June 8, 2007

Optimizing Linux Kernel Boot times for embedded devices

Παρακολούθησα το παρκάτω podcast απο την timesys και το βρήκα πολύ ενδιαφέρον. Τα περισσότερα είναι βασικά για κάποιον που ασχολείται με embedded linux αλλά όταν τα ακους όλα μάζι είναι καλύτερα. Επίσης κάποια αν οχι όλα έχουν νόημα και σε full linux εκδόσεις.

http://lldn.timesys.com/files/Episode_011_LinuxLink_Radio.mp3

Κράτησα κάποιες σημειώσεις κατα τη διάρκεια και τις παραθέτω παρακάτω, στα Αγγλικά

Actual Boot Time Reduction
  • Remove default options from the kernel and use ONLY what is necessary
  • Use static network parameters
  • Remove usb drivers (they can be loaded later)
  • Remove component waitstates wherever applicable (kernel hacking)
  • Suppress boot messages (don't just redirect them to the serial)
  • Use busybox instead of a full SysV
  • Init can start an app directly by using "init=/" in the kernel params. Make sure the app always starts and NEVER exits cause you will get kernel panic
  • Statically link boot critical apps.
Perceived Boot Time Reduction
  • Use stage booting with initrd or initramfs in order to load "human interface drivers*" quickly. Show that something IS happening.
  • In addition to the above the app can be broken up so that it initializes in then initramfs (or initrd) and the rest of the facilities are initialized later.
(*)"human interface drivers": The term is not to be confused with USB HID. It means all the drivers that initialize and make usable those devices that can be perceived by human senses, be it LED's, beepers, screens etc.


General points
  • Initramfs can be tricky because if care is not taken when writing to disk, it can grow and eventually fill up the whole available ram.
  • Don't use runlevels
  • When using an app as an init replacement be extra careful
  • Nash is a lightweight shell for busybox.

The above does not cover the whole podcast nor is intended to do so. It's merely a personal reminder. Hope you find it useful

No comments: