Hi all
I am presently working on Bcache functions in BIOS configuration(omap3503 evm(omap3530))..
bcache functions are working fine But mallocs r giving errors..
#include<stdio.h>
#include <stdlib.h>
main()
{
int i,j=0;
char *buffer,ch;
FILE *fp1,*fp2;
printf("no of elements value i=");
scanf("%d",&i);
buffer=(char*)malloc (sizeof(i));
memset (buffer,0,i);
if((fp1=fopen("input.txt","rb"))==NULL)
printf("file is not created");
fp2=fopen("out.txt","wb");
while(!feof(fp1))
{
ch=fgetc(fp1);
buffer[j++]=ch;
}
fwrite (buffer, 20 , sizeof(buffer) , fp2 );
fclose(fp1);
fclose(fp2);
}
If we run the above sample prog in simulator its working fine. but i tried in emulator with bios configuraion scanf,malloc and memsets are not working properly,
malloc returns null .
what to do to make malloc functioning in emulator?
Please any one can tell me about above problem.
thanks and regards
sureshkumar c.v