Skip to Content.
Sympa Menu

baslinux - Re: [BL] 2.4 kernel with loop BL3 read-only

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: baslinux AT lists.ibiblio.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] 2.4 kernel with loop BL3 read-only
  • Date: Wed, 7 May 2008 04:15:45 +0000 (UTC)

On Wed, 7 May 2008, baslinux AT lists.ibiblio.org wrote:

Message from Steven
===================
Sindi wrote:

Total-Available Kernel code Reserved Data
p2 BL3 kernel 66488K 704K 416K 5368K

I posted the difference between total and available and this number
should read '6488' (6.4MB) used by the p2 BL3 kernel and 8.15MB used by my laptop kernel. (type). 1.6MB more used by my kernel.

"total minus available"

Some of those numbers change significantly when
you have less (or more) memory. For example on
the two systems I have sitting on my desk:
-----------------------------------------------
Desktop (p2) 262144 704 416 2776
Laptop (p1) 24768 704 416 420

Sindi's (p2) (66488) 704 416 5368
actually 517000 889 7032 228
---------------------------------------------
586 not p2

Available memory is about 504MB out of 512MB.
I can try this again with mem=16M or 24M while booting.

My laptop kernel (the small one) is 586 not p2.

It is clear from this that the BL3 kernel takes
1120 kb plus a variable amount of space for data
(depending on how much RAM is available).

704 plus 416 - 1120

BTW are you sure your 66466K figure is correct?
It's really just 64mb? From your Data figure
I would guess you really have ten times that
much RAM.

512MB.


----------

This time I booted with mem=16M
(difference)
p2 2.2.26 14880/16384k (1504K) 704k 412k 344k 44k
la 2.4.31 14552/16384k (1832K) 889k 1548k 228k 64k

(Much less memory is reserved for the kernel than with 512MB, where it was 7MB reserved instead of 1.5MB, but 2.5 still reserves 4X as much as 2.2 - is there some way to change this?).

Available memory for the la kernel is 328K less if I read this right.
Of which 185K is actual used by the kernel.

The 44k and 64k get freed later.

Kernel code is 185K more, a lot more is used for reserved, and less for data. Why does 2.4 kernel reserve more and use less for data?

A 2.6 kernel according to wikipedia, with 72MB RAM, can use 1903k kernel code (double my kernel), 3644k reserved (more than double), and 728K data (quadruple). I ran across the TinyLinux (Linux-Tiny) project, designed to make a smaller 2.6 kernel that will boot on as little as 2MB RAM with console, disk and network support (not X). The project is a collection of patches to make the 2.6 kernel tiny, such as removing all the error messages to save 300K. Another patch changes how memory is allocated.

There are also patches for 2.4 and busybox (if I understand right).

You can turn off SysFs and boot by passing major and minor device numbers in hex. root=0x0301 ro instead of root=/dev/hda1 (where hda1 has device numbers 3 and 1). Or use SLOB instead of SLAB. You can eliminate code that produces ELF core dumps. Set max swap files from 5 to 1.


A patch set is about 500K and can save 412K 'in the image'. (smaller kernel?). They got kernel code down from 2179K to 1749K. (BL3 kernel is 704K). And reserved memory down by 700K, to save about 1MB. Booting in 8MB memory. Further stripping got kernel code to 1526K. They left in unnecessary drivers from a standard kernel.

Would any of these patches help BL3 and older kernels? You can select just the features you want to disable (which cannot be configured when compiling the kernel otherwise). You get an option for small systems after doing the patched, select that, and you then get extra choices.

35K less if you remove error messages, more for ELF file dumps, something to do with SLAB/SLOB that is appropriate for 'small systems', remove mempools (introduced in 2.5 and not needed for small systems).

Someone made a 197K compressed kernel 2.6.

Reserved INCLUDES the kernel code memory, it says. (412K includes 704K?)

Patches are for kernel 2.6.0 to 2.6.21 not 2.4.

I would not use a 2.4 kernel in 8MB RAM, but with 16MB I think it is worth not having to go buy a different wireless card, or being able to use USB storage in linux instead of DOS (which does not work with my SM reader), with our 100MHz Toshiba that has USB port. It might swap out slightly more.

I would not use a wireless card or graphical browser in 8MB RAM (a 486).




Archive powered by MHonArc 2.6.24.

Top of Page