Tiny Core Extensions > TCE Tips & Tricks
TC17 needs RAM: 71MB(CLI) or 90MB(GUI) just to run
nick65go:
News: first the two bad, then the good one.
1. advdef.tcz is weeker in TC17 64 vs. TC17 32 bits !? Can anyone else check and confirm this about advdef.tcz?
ex: I unpacked and then quickly packed back (without any change) the rootfs.gz;the final result is (test.gz vs. rootfs.gz) as 3,701,085 vs. 3,697,459.
--- Code: ---#extract roofs.gz
cd tmp && zcat ../rootfs.gz | sudo cpio -i -H newc -d
--- End code ---
--- Code: ---#re-package and compress new test.gz
cd tmp
sudo find | sudo cpio -o -H newc | sudo gzip -2 > ../test.gz
cd ../ && advdef -z4 test.gz
--- End code ---
2. I need 46 MB to boot. 45 MB will not boot even if a change (in /init) the size to 95%, or 99% or 100%, or even eliminate the if loop + just "exec /sbin/init". I tried with all combinations -accel kwm/tcg or -cpu 486/host, etc
Something is fishy here... with tmp size or inodes?
--- Code: ---> cat test.gz modules.gz > coreNEW.gz
> qemu-system-i386 -accel kvm -cpu host -machine pc -m 45M -kernel ./vmlinuz -initrd ./coreNEW.gz
> qemu-system-i386 -accel tcg -cpu 486-v1 -machine pc -m 46M -kernel ./vmlinuz -initrd ./coreNEW.gz
--- End code ---
3. Now the good news: CROM will not boot with less than 71MB, but if someone manage to "install" the core.gz + vmlinuz on HDD, then it boots with just 45 MB RAM.
--- Code: ---> cat rootfs.gz modules.gz > coreOLD.gz
> qemu-system-i386 -accel kvm -cpu host -machine pc -m 45M -kernel ./vmlinuz -initrd ./coreOLD.gz
--- End code ---
PS: another strange thing here with 45MB RAM: total memory 45M= 45*1024= 46,080, but command free shows
Mem (32,728) +swap=1,376 (4.2%) =34,154 (not 45MB!, missing 11,926 bytes); remains free=14,112 KB
nick65go:
I do not know if exist any physical machine with 41 MB RAM (but I assume there is not). Anyway, for the pleasure to promote how good a "modern" TC17 32 bits (kernel 6.18.2, wow) could be, booting and running in less than 41 MB RAM, here below are my reproducible results.
I lowered the demands WITHOUT eliminating ANY original program, but just load some of them with delay (on-demand), from the same storage as vmlinuz+core.gz, like you also load any tce/tcz. I extracted the original rootfs.gz in ./01, move out few files (listed below), re-create the new-rootfs.gz, Et voilà.
--- Code: ---sudo find | sudo cpio -o -H newc > ../x1.cpio
cd ../ && gzip -1 ./x1.cpio
./advdef -z4 ./x1.cpio.gz
cat x1.cpio.gz modules.gz > coreNEW.gz
qemu-system-i386 -accel kvm -m 41M -machine pc -kernel vmlinuz -initrd coreNEW.gz -append nozswap
# here are files size
ls -aB ./*.gz
.rw-r--r-- 3.697.459 abc 8 Mär 15:22 ./rootfs.gz
.rw-r--r-- 2.203.231 abc 14 Mär 16:52 ./x1.cpio.gz
--- End code ---
--- Code: ---# files not in x1.cpio.gz (4.3MB), allow booting with 41MB (instead of 45MB)
du -h 01
540K 01/sbin
100K 01/usr/sbin
100K 01/usr/lib/gconv
3,2M 01/usr/lib
3,3M 01/usr
444K 01/lib
4,3M 01
sudo find ./01 -type f -printf '%s %p\n' | sort -nr
2988956 ./01/usr/lib/libstdc++.so.6.0.34
414192 ./01/lib/libext2fs.so.2.4
310688 ./01/sbin/e2fsck
226880 ./01/usr/lib/libgcc_s.so.1
129536 ./01/sbin/mke2fs
104800 ./01/sbin/tune2fs
80904 ./01/usr/sbin/visudo
31456 ./01/lib/libe2p.so.2.3
25988 ./01/usr/lib/gconv/ANSI_X3.110.so
13748 ./01/usr/sbin/mklost+found
13708 ./01/usr/lib/gconv/UNICODE.so
13700 ./01/usr/lib/gconv/ISO8859-2.so
13700 ./01/usr/lib/gconv/ISO8859-1.so
13700 ./01/usr/lib/gconv/ISO8859-15.so
3916 ./01/usr/lib/gconv/gconv-modules
132 ./01/usr/lib/libgcc_s.so
--- End code ---
After boot in cmd line, I had near. 12.3 MB free memory and I could load the "missing" pieces of 4.3 MB :)
Continue on the same principle (on-demand loading) I "investigate" further the module,gz, for potential 4-5 MB more from kernel/drivers/net.
But I wonder who will be happy to boot with 36 MB RAM and why?
nick65go:
I think I can summaries and close this topic with conclusion: The 37 MB RAM is the minimum to boot in qemu. (aka not from CDROM but from a USB/HDD /tmpfs).
--- Code: ---qemu-system-i386 -accel kvm -m 37M -machine pc -kernel vmlinuz -initrd x1.cpio.gz -append nozswap
--- End code ---
After booting with 37 MB RAM, using just x1.cpio.gz (without loading module,gz), memory available was 10.9 MB (=11224/1024), but a "ls -aR /" will kill me out to prompter "box login:" (=Out of memory Killed process ...sh). The aggressive kernel OOM killed the shell because no HDD swap.
It was fun. You could test it yourself and then maybe advertise the TC minim technical specifications.
nick65go:
I have great news about TC: minimal demands to CLI (text prompter) boot is 27 MB RAM, without swap (neither in RAM, nor on HDD) and not need to compile anything, all program form original core.gz are functional, etc. Here are the details:
1. As I exposed in my previous post, the initial rootfs.gz should be slimmed down; specifically to move few files in another container (tcz /tce / compressed or not, whatever you want). It can be loaded few seconds later (or on demand) from the same storage (CDROM/USB/HDD) where vmlinuz + core.gz already exist (so yes, that storage even read-only).
2. Two files should be modified - /init , where a boot parameter (ex: LowRam) can be queried, same as you check for "noembed", and if found then just change the line
--- Code: ---mount / -o remount,size=90%,nr_inodes=$inodes
--- End code ---
replacing 90% with 100%. I am not sure if this is realty need, but it worked for my test.
- /etc/init.d/tc-config, line 104 add --children-max=1, AFTER you adding test for boot parameter (ex: LowRam) just before the line.
--- Code: --- "/sbin/udevd --daemon --children-max=1 2>&1 >/dev/null
--- End code ---
I made a new x02.cpio.gz and I tested (with and without a swap partition). Attached are snapshots from qemu running this TC17.You can see this from "free" command that initial ram=27MB !
FYI: one trick was that adding temporary a HDD swap,
--- Code: ---qemu-img create ./swap100MB.raw 100M
qemu-system-i386 -accel tcg -m 31M -machine pc -kernel vmlinuz -initrd x2.cpio.gz -append "nozswap" -hdd ./swaph100MB.raw &
--- End code ---
I saw the small swap used = [988-1,824] KB, and "top" shows 3 process (each of 2,220 KB) of "/sbin/udev --daemon" still running.
nick65go:
And here are the latest results: TC17 32 bits boots in 26 MB RAM, if you allow swap on HDD.
Snapshots images from qemu are attached!
To boot in 26MB RAM the change in /init (90% => 100%) is mandatory, but optionally for 27MB RAM
--- Code: ---if ! grep -qw lowram /proc/cmdline; then
mount / -o remount,size=90%,nr_inodes=$inodes
else
mount / -o remount,size=100%
fi
--- End code ---
And in /etc/init.d/tc-config I moved "modprobe loop 2>/dev/null" just before "[ -n "$LANGUAGE" ] || LANGUAGE="C" to allow a little more memory for "hungry" udev.
PS: I have read the TC forum, when in year 2011 people struggled to boot with 32 MB RAM, having even the old TC3.x (smaller size kernel) + not-recommended "scattered" method.
Navigation
[0] Message Index
[*] Previous page
Go to full version