[Prev][Next][Index][Thread]

RE: Hi!



>   I am wondering what this line means:
>
>    $(filter %.a, $(foreach DIR,$(LIBDIRS),$(wildcard $(DIR)/*)))

GNUMake is pretty well documented if you read the info pages.
This particular expression finds all the .a files in LIBDIRS.

In this case it could have been coded as:

  $(foreach DIR,$(LIBDIRS),$(wildcard $(DIR)/*.a))

instead.

>    By the way,if I only want to have the os boot, do I have
>    to call the function as oskit_clientos_init()?

It all depends on what you mean by "have the os boot".
If you mean initialise the processor, memory allocator and console, then no.
If you mean initialise the network and filesystem then (I think) yes.

[Caveat: I use Knit to build most of my OSKit kernels so my view of initialization may be a little inaccurate since Knit may
initialize things in a slightly different order from normal OSKit kernels and, in particular, doesn't require me to call
oskit_client_init.]

>    How  is the mememory allocated when booting up?

The bootloader tells the kernel how much memory is available when it boots it.
(See the multiboot documentation.)  All that memory is given to LMM very early in
the bootstrapping process.

>    I mean, where is initial code segment put when first booting up,
>    since I want to rearrange the memory later myself.

We usually build binaries with a start address of 0x100000 - so that's where the code is after the bootloader passes control to your
kernel.  But there's nothing especially magic about this address - if you want to put it somewhere else and it doesn't conflict with
the various restrictions in PC memory allocation (e.g., the first 1Mb has special status), just relink your kernel with a different
start address.

Hope this helps,

--
Alastair Reid


References: