mirror of
https://github.com/vivier/EMILE.git
synced 2024-09-07 13:54:29 +00:00
Correct a major memroy usage mismatch
This commit is contained in:
parent
b29182eabc
commit
3111a9a2e6
@ -104,7 +104,9 @@ int start(emile_l2_header_t* info)
|
|||||||
|
|
||||||
printf("Available Memory: %ld kB\n", bank_mem_avail() / 1024);
|
printf("Available Memory: %ld kB\n", bank_mem_avail() / 1024);
|
||||||
|
|
||||||
if (info->kernel_image_size != 0)
|
if (info->kernel_image_size == 0)
|
||||||
|
error("Kernel is missing !!!!\n");
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (info->kernel_size == 0)
|
if (info->kernel_size == 0)
|
||||||
info->kernel_size = info->kernel_image_size * 3;
|
info->kernel_size = info->kernel_image_size * 3;
|
||||||
@ -128,29 +130,23 @@ int start(emile_l2_header_t* info)
|
|||||||
uncompressed_size = uncompress(kernel, (char*)kernel_image_start);
|
uncompressed_size = uncompress(kernel, (char*)kernel_image_start);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
if (!check_full_in_bank((unsigned long)kernel, uncompressed_size))
|
/* free kernel image */
|
||||||
error("Kernel between two banks, send a mail to LaurentVivier@wanadoo.fr for support\n");
|
|
||||||
|
|
||||||
/* copy enter_kernel at end of kernel */
|
free((void*)kernel_image_start);
|
||||||
|
|
||||||
memcpy((char*)kernel_image_start + uncompressed_size
|
|
||||||
+ BI_ALLOC_SIZE,
|
|
||||||
(char*)enter_kernel, end_enter_kernel - enter_kernel);
|
|
||||||
|
|
||||||
end_enter_kernel = kernel_image_start + uncompressed_size
|
|
||||||
+ BI_ALLOC_SIZE +
|
|
||||||
(end_enter_kernel - enter_kernel);
|
|
||||||
enter_kernel = kernel_image_start + + BI_ALLOC_SIZE
|
|
||||||
+ uncompressed_size;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
error("Kernel is missing !!!!\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free kernel image */
|
if (!check_full_in_bank((unsigned long)kernel, uncompressed_size))
|
||||||
|
error("Kernel between two banks, contact maintainer\n");
|
||||||
|
|
||||||
free((void*)kernel_image_start);
|
/* copy enter_kernel at end of kernel */
|
||||||
|
|
||||||
|
memcpy((char*)kernel + uncompressed_size + BI_ALLOC_SIZE,
|
||||||
|
(char*)enter_kernel, end_enter_kernel - enter_kernel);
|
||||||
|
|
||||||
|
end_enter_kernel = (unsigned long)kernel + uncompressed_size
|
||||||
|
+ BI_ALLOC_SIZE + (end_enter_kernel - enter_kernel);
|
||||||
|
enter_kernel = (unsigned long)kernel + BI_ALLOC_SIZE
|
||||||
|
+ uncompressed_size;
|
||||||
|
|
||||||
/* load ramdisk if needed */
|
/* load ramdisk if needed */
|
||||||
|
|
||||||
@ -163,7 +159,7 @@ int start(emile_l2_header_t* info)
|
|||||||
printf("RAMDISK loaded at 0x%lx\n", ramdisk_start);
|
printf("RAMDISK loaded at 0x%lx\n", ramdisk_start);
|
||||||
printf("RAMDISK size is %d Bytes\n", info->ramdisk_size);
|
printf("RAMDISK size is %d Bytes\n", info->ramdisk_size);
|
||||||
if (!check_full_in_bank(ramdisk_start, info->ramdisk_size))
|
if (!check_full_in_bank(ramdisk_start, info->ramdisk_size))
|
||||||
error("ramdisk between two banks, send a mail to LaurentVivier@wanadoo.fr for support\n");
|
error("ramdisk between two banks, contact maintainer\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user