Configuring for bare hw ia32 PC's
Luke A. Guest
laguest@archeia.com
Mon May 12 16:46:00 GMT 2008
On Sun, 2008-05-11 at 18:38 -0400, duane ellis wrote:
> A while back - (April) Jonathan Shapiro was asking about something like
> this for his Cayotie (spelling?) Operating system
CoyotOS
> I whipped up a simple example for x86 and sent it to him, You might want
> to take a look at this as starting point/example.
OK
> (0) My assumption is you load your kernel with something like uboot or grub, or
> and that thing can load an "elf" file - because that is what this
> generates.
>
For PC it will be GRUB2, I intend to also get it going on other
architectures.
> Basically all you need to do is:
>
> (1) figure out your desired memory map - and thus your linker script.
>
> (2) Add appropriate startup code to set registers - establish the stack etc.
>
> Deal with other 'machine specific stuff'
>
> (3) The attached example - has an example "fake_syscalls.c"
>
> These functions could make 'bios' calls.
> That is your job, you need to write that.
>
> ================
> Two things to note:
> (A) This might be a starting point for you.
> And
> (B) it might not, NEWLIB is more of an application standard C library.
> Not really a "kernel standard c library"
Well, not strictly. It seems that NewLib is actually what I want, a libc
that can provide the basics, even dummy functions.
> It's a matter of personal preference. I believe kernels should have a
> stripped down or reduced standard c library Apps - need the full
> thing. My reasoning centers around 'syscalls' and the problem of
> kernel code calling functions like 'fopen()' etc.... And - the fact that
> the kernel uses a single language, and does not require things like
> "locale" - the APP does - but not the kernel.
>
> If you look at the makefile - it builds GCC in 2 stages stage 1 - is
> just a straight up C compiler, nothing else. No standard library. That
> should be enough to build your kernel as I describe.
Not quite, I want to get a cross Ada compiler (GNAT) and runtime going
for this, therefore I need a libc, this includes (unfortunately the file
I/O).
Thanks,
Luke.
More information about the Newlib
mailing list