I don’t know about Microblaze but that does not sound right at all. How are you obtaining the footprint size? That is, where are you getting the 12K number from?
Yes this is a valid way of getting the size but the 12K for the kernel is very improbable. Can you look in the map file to see which module is taking up the text, I would be very surprised if it were anything to do with the kernel.
Is you main.c using any GCC libraries? In particular anything to do with sprintf/printf/scanf? This can bring LOTS of very inefficient GCC library code into your build.
My main.c is the one included in the Demo, from which I erased the demo function calls; so I’m sure I’ve not included other GCC functions. The part of the map file dealing with text is listed below (I’ve cut some lines to don’t take up too much space). If you please can help me figure out what’s wrong, I’ll be very glad… I’m not an expert on this topic…
2888 bytes for tasks.c
2748 bytes for queue.c
268 bytes for list.c
1000 bytes for port.c
Total for the kernel is then 6.9K which is the largest I have ever seen. This must be something specific to the Microblaze architecture or instruction set inefficiencies. I should turn on the optimiser and remove unused symbols, and see what it comes down to.
You could remove quite a lot from port.c by removing the code that fills the registers with known values. You could also make functions out of some of the inline code.
In addition you have:
1548 bytes for libxil.a.
732 bytes for the USRT driver.
416 bytes for the Xilinx interrupt handler code.