Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
i'm studying the linux kernel code and how to reduce code in embedded architectures. How I can see the size in memory of the running kernel in the GP32Linux? How I can calculate the boot time of the kernel?
A lot of thanks, and sorry for my English ;-)
About kernel size: the most recent is the bigger (kernel 2.6 is bigger than 2.4). Remove all unused drivers to reduce at max the kernel size, or use as many modules as possible.
During boot process, look at the log line beginning with "Memory: " to see the size of uncompressed kernel.
See also /proc/meminfo for free and used memory.
About kernel boot time, read /proc/uptime in your first user process to see how many seconds the boot process spent.
Thanks again! That information is very useful for me. The object of my study is the use of user management in embedded OS. For this reason I'm only working on user checks (like capabilities) and other things that may be "optional" in a system with less users, like the user cache that Linux implements.
About the boot time, with /proc/uptime I have two values: the time since boot (X) and the time since idle (Y). The boot time is Y-X?? I'm very confused.
Lucas C. Villa Real
Put 'cat /proc/uptime' as the last entry on your rc (bootscript) file. The first field on that file will tell you how much time was spent until now.
Since you're doing that just after other boot tasks were performed, that number alone will represent exactly the boot time.
Thanks Lucas, but I can't write this file because the Propanda filesystem is mounted read-only. There's any way to make the bootscript that Lucas says? Or it's impossible?
Lucas C. Villa Real
You'll need to mount the filesystem (I'm assuming that you're running Linux on your host machine), copy its contents into another directory, modify the files and compress that directory into another initrd file.
It's something like this:
$ mkdir /mnt/loop ~/initrd_dir
$ mount -o loop -t squashfs initrd /mnt/loop
$ cp -Rpa /mnt/* ~/initrd_dir
<edit your files on ~/initrd_dir>
$ mksquashfs initrd_dir initrd -2.0
You'll need SquashFS tools, which can be found at Google. But that's it, then just move your initrd file into gpmm/linux and you're ready.
Just forgot: you'll need a patched kernel with squashfs support enabled in order to mount the initrd on your filesystem.
Well, but I can do it in my PC with a Linux that support SquashFS and then transfer the new initrd to the GP32. It's possible?
Yes, that's what I told you on the previous posts :-)