Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

NiosII about uclinux

Altera_Forum
Honored Contributor II
2,812 Views

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.gif
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
421 Views

I&#39;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&#39;re targetting.
0 Kudos
Altera_Forum
Honored Contributor II
421 Views

if it is possible I wish it is between 200K and 500K, who can tell me how to do ?

0 Kudos
Altera_Forum
Honored Contributor II
421 Views

hi maoguohua, 

 

To reduce the size of the kernel, you can re-configure the kernel and disable those features you don&#39;t want. For example, if you don&#39;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&#39;m not sure if you can get a kernel image as small as 500k. 

 

If you don&#39;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...
0 Kudos
Altera_Forum
Honored Contributor II
421 Views

Can you tell me how to compress the image?  

Thanks!
0 Kudos
Altera_Forum
Honored Contributor II
421 Views

> 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
0 Kudos
Altera_Forum
Honored Contributor II
421 Views

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 maoguohua2002@163.com 

Thank you very much!
0 Kudos
Altera_Forum
Honored Contributor II
421 Views

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
0 Kudos
Reply