6 msgFW: Errors issued while building GCC
1 msgRe: Compiler fails to find header files.
8 msgSome strict aliasing related fun
3 msgCompiler isn't finding system header files
2 msgWG: [gnu.org #342187] licensing and copyright
69 msgreduce compilation times?
1 msgRe: gcc 4.2.2, libgomp under cygwin
9 msgInstallation Problem
2 msgInheritance problem
4 msgpublic method hidden by protected one
3 msgIssue with apache compilation : memmove & b...
2 msgcompiling fortran support in 4.2.2 on solaris
1 msgbuild fails using gcc-4.2.1 (5531) on OSX 10.4....
2 msgcollect2: ld terminated with signal 11 [Segment...
1 msggcc - multilib - and specs files.
6 msgMeasuring short times
5 msgGCC Problem, 32-bit vs. 64-bit?

How do I use GNAT to develop an OS kernel?
\ Luke A. Guest (23 Nov 2007)
. \ Luke A. Guest (24 Nov 2007)
. . \ Luke A. Guest (3 Dec 2007)
. . . \ Tony Wetmore (3 Dec 2007)
. . . . \ Luke A. Guest (3 Dec 2007)

2 msgTargetting strange CPU architecture
5 msgerror installing previous gcc version
Subject:Some success (was 'Re: How do I use GNAT to develop an OS kernel?')
Group:Gcc-help
From:Luke A. Guest
Date:24 Nov 2007


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.
pragma Restrictions(No_Obsolescent_Features);
pragma Restrictions(No_Exceptions);
pragma Restrictions(No_Recursion);

-- Memory management.
pragma Restrictions(No_Allocators);
pragma Restrictions(No_Local_Allocators);
pragma Restrictions(No_Unchecked_Deallocation);
--pragma Restrictions(No_);

-- Make sure we don't have tasking or any of it's features enabled.
pragma Restrictions(Max_Tasks => 0);
pragma Restrictions(No_Protected_Types);
pragma Restrictions(No_Delay);
pragma Restrictions(No_Task_Hierarchy);
pragma Restrictions(No_Abort_Statements);
pragma Restrictions(No_Implicit_Heap_Allocations);
pragma Restrictions(No_Asynchronous_Control);

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
gnat.adc file.

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
System.Address_To_Access_Conversions?

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)?

Thanks,
Luke.




© 2004-2008 readlist.com