@CHIP-RTOS C Library V2.06 - BIOS API
BIOS_Set_Memory_Gap
Set the memory gap used between the loaded
DOS programs. int BIOS_Set_Memory_Gap ( unsigned int paragraphs ); Parameters
paragraphs
- Size of memory gap in 16 byte paragraphs:
range [0 .. 2048]
Return Value
- 0: Successful
-1: Failure, invalid value in paragraphs
Comments
- This function sets the size of the memory gap that will be used between
subsequently loaded DOS programs. This gap serves as a memory reserve.
Some programs compiled with Borland C 5.02 try to increase the
size of their program memory block at runtime before, for
example, opening a file with Borland C-Library function fopen.
(The programs calls int21h
0x4A.
This happens down inside the
C-Library fopen function and is not directly visible to the application programmer.)
This memory resize call fails if another program has been loaded after
the one making the call due to now there is no memory space
left for increasing the memory size of the first program. The program
returns from fopen with an error.
The global program variable errno is set to value 8 (not enough memory).
To prevent this error the size of a memory gap between two loaded programs can
be controlled.
The value is defined in terms of memory paragraphs (1 paragraph = 16 bytes).
This value can also defined in the
CHIP.INI file.
This strategy could fail in the cases where programs are terminated and
are started again.
It is usually not necessary to set this entry, if the application does not show
the described error. Only if a C-Library function call sets errno to 8,
should this value be defined. We recommend in
case of this error, a memory gap value of 128 paragraphs (2048 Bytes).
RTOS API
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
documentation
for more details.
Supported since or modified in @CHIP-RTOS version-
SC12 | SC13 | SC11 | SC1x3 |
-
V1.02 | V1.00 | V1.00 | V0.90 |
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|