[Coco] NitrOS-9 boot module common code

Gene Heskett gene.heskett at verizon.net
Wed May 12 04:58:05 EDT 2010


On Tuesday 11 May 2010, Roger Taylor wrote:
>At 10:01 PM 5/11/2010, you wrote:
>>AFAIK, you can request as much free memory as the system might have in
>>contiguous blocks at that instant.  So 512 bytes basically means you must
>> use an int sized register for the pointer into it, byte sized stuff won't
>> work. You would probably need another 16 bytes to hold the pointers and
>> such that access that 512 byte buffer.  Actually, 2 of them so you can
>> keep reads and writes properly segregated.  In any event, I would not do
>> it with a stack pointer adjustment, there be sharks in those waters.
>
>Some of the NitrOS-9 boot modules just do an leas -256,s for L2 and
>it seems to work fine.  I was just wondering if I can do an -512,s
>without running into something.
>If it was proper to request the memory formerly, then I'd think it
>would be done this way in all the NitrOS-9 boot modules, or the
>boot_common code, that is.
>
The C language does this, often keeping small stuff on the stack.  it also 
does its own housekeeping so you don't have to, at least as long as the 
original c.prep has been replaced with c.prep19 so can write programs bigger 
than about 10k of src.

An F$RegDump at that point, just once I believe, would tell you how much room 
there is on the stack.  The point is that when you allocate memory by that 
method, there is only the housekeeping that you do to clean up the mess, and 
since the system has no knowledge of the shortcut allocation, it may, for 
some other program, allocate memory from what you thought was your own 
private pool, and that can lead to 'interesting' results.  I wouldn't think 
that it would be a problem as long as the system ram stays above a kilobyte 
or more free.  F$RegDump can tell you that at that particular point.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Don't despise your poor relations, they may become suddenly rich one day.
		-- Josh Billings



More information about the Coco mailing list