Forum Discussion
Altera_Forum
Honored Contributor
22 years agoNiosII about uclinux
Hello everybody:
The kernel of uclinux is about 1.6M bytes, it is too big for me, who can tell me how to make it enough small, thanks! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/rolleyes.gif7 Replies
- Altera_Forum
Honored Contributor
I've never used an OS in a NIOS before so the answer will not come from me.
But if it is possible we would probably like to know what size you're targetting. - Altera_Forum
Honored Contributor
if it is possible I wish it is between 200K and 500K, who can tell me how to do ?
- Altera_Forum
Honored Contributor
hi maoguohua,
To reduce the size of the kernel, you can re-configure the kernel and disable those features you don't want. For example, if you don't want TCP/IP stack, I am sure you can reduce the size of resulting kernel a lot. Some filesytem, device drivers can be configured off. But I'm not sure if you can get a kernel image as small as 500k. If you don't have enough flash space to put the kernel, you can try compressing the image, like a Linux desktop. A compressed image can be easily smaller than 500k, but you need some booting code to uncompress the kernel... - Altera_Forum
Honored Contributor
Can you tell me how to compress the image?
Thanks! - Altera_Forum
Honored Contributor
> Can you tell me how to compress the image?
You can use gzip. For example, $ gzip --best linux.bin This will replace linux.bin with linux.bin.gz. To recover the original: $ gzip -d linux.bin.gz This of course will require a bootloader that can decompress. The u-boot boot loader supports gzip decompression. However, the current u-boot port for Nios-II requires an update to fully support the linux boot command (bootm). A update should be available within the next few weeks. Regards, --Scott - Altera_Forum
Honored Contributor
Thanks for you tell me how to compress the image!
If you have an update to fully support the linux boot command (bootm) ,can you Email to me? My Email is [email protected] Thank you very much! - Altera_Forum
Honored Contributor
u-boot has been updated to support kernel booting.
I tested by booting a gzipped Microtronix linux kernel on the Altera 1C20 devkit board: vmlinux.bin: 1.6 MB (original binary) vmlinux.img: 678 KB (gzipped u-boot image). Regards, --Scott