[Top][All Lists]

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

Re: Use of dynamic memory

From: Jochen Hoenicke
Subject: Re: Use of dynamic memory
Date: Mon, 30 Oct 2000 11:48:46 +0100 (MET)

On Oct 29, Volker Augustin wrote:
> Hello,

> Is there a way to allocate a huge block of memory in the high memory
> area?

The high memory is mainly used by the commands that are loading kernel
images.  There is no fixed rule who may use high memory in which way,
so you have to be careful when using it.  

It is probably a good idea to manage the whole high memory with
malloc, and change all commands that use high memory to use
malloc()/free() instead.  This is probably what Okuji intended to do
after the stable release.  But note that some kernels are
expecting to be loaded at a specific address.  So one has to move the
kernel image to this address just before booting it.

> I just wrote "malloc" and "free" to handle the use of an already
> allocated block of memory. For example, I could allocate a static
> char array of fixed size and then use "malloc" and "free" to access
> this memory area dynamically.
> But I don't know how much memory there is available to grub. I tried
> allocating a block of 10000 bytes (worked) and a block of 1000000
> bytes (failed).

Grub starts at absolute address 0x8000 and has its stack starting at
(roughly) 0x68000, so there are 384 KBytes available for code, data
and stack.

See shared.h for hints how to reserve a fixed memory area in low
memory for special purposes.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]