This is the mail archive of the
mailing list for the GCC project.
Some success (was "Re: How do I use GNAT to develop an OS kernel?")
- From: "Luke A. Guest" <laguest at archeia dot com>
- To: GCC-Help ML <gcc-help at gcc dot gnu dot org>
- Date: Sat, 24 Nov 2007 12:46:27 +0000
- Subject: Some success (was "Re: How do I use GNAT to develop an OS kernel?")
- References: <1195836102.7323.12.camel@rogue>
So, I got my old source to build and boot under grub. I now have my old
hello world style Ada kernel.
I had to remove the "pragma Restrictions(No_Elaboration_Code);" lines
from all the source files that I had and also the "pragma
Suppress_Initialization" lines I had in there (I honestly can't even
remember why I had that in there at all).
I included the following in a new gnat.adc file:
-- Basic stuff.
-- Memory management.
-- Make sure we don't have tasking or any of it's features enabled.
pragma Restrictions(Max_Tasks => 0);
I'm sure there are more restrictions I can use here.
So far the kernel is around 4-5KB in size when stripped, I definitely
think there's more stuff to get rid of from the linker script and the
My kernel will require some basic console/serial IO but I haven't
decided whether to port across the IO or add in No_IO as well.
I still have a number of questions regarding this feat:
1) If I use the Max_Tasks = 0, does this imply that all other tasking
restrictions are also set or do I have to do this manually? i.e. I have
"No_Protected_Types" enabled up there, is this done for me when
Max_Tasks = 0?
2) Can anybody think of any further restrictions I can use to make sure
that my kernel builds with the minimum of RT?
3) On bare hardware can I reasonably assume that System.Address = access
type or do I still require the use of
4) Can I reasonably use tagged types for this project? Will it require
any RT packages? If so, which ones?
5) Is elaboration order still an issue for a kernel? Should my entry
point be the "main" that gnatbind creates for me? But, won't that
include arg[cv] (which I don't need for a kernel)?