I have an average sized kernel with about 25 C files excluding headers... Till now i was compiling the kernel with no gcc optimizations. It shouldn't make a difference but when i do compile it with any of the optimizations (-O1,2, or 3) then the kernel fails to receive interrupts and hence in a very early init stage the scheduler hangs...
I saw topics on this and came to the conclusion that i need to:
1. Use -Wall and solve all warnings
2. Use volatile wherever necessary
Hence, i am currently working on my kernel writing protorypes and declarations, and removing unused variables etc. to get rid of the warnings.
But i however fail to understand the use of volatile...
My kernel has a scheduler but currently theres only one kernel process which initiates everything...
So could any one give me the rules for using volatile or link me to a nice tutorial?
Thank you very much...
GCC optimizations
- salil_bhagurkar
- Member
- Posts: 261
- Joined: Mon Feb 19, 2007 10:40 am
- Location: India