Hello!
until yesterday, I used the freedos kernel build 2024c
together with dosemu-1.0.2. With this environment, the
appended program shows that one byte in main memory allocated
by malloc() is altered as soon as a key is pressed. This byte
contains the ascii code of the pressed character. With build 2029,
the problem is gone, but others arise:
- Printing does no more work
- my application uses the dos_findfirst/findnext functions
to find files on diskette which does not work anymore
I would be happy with 2024c, but I have to fix the
problem described above. Does someone maybe know where the code
resides that is responsible for the overwriting of the
main memory?
Stephan
----------------------
#include <stdio.h>
#include <stdlib.h>
#define SEGMENTS 7
#define SIZE 65500
int *segments[SEGMENTS];
int main()
{
int i,j,k;
for(i=0;i<SEGMENTS;i++)
{
printf("malloc segment %d\n",i+1);
segments[i]=(int *)malloc(SIZE);
if(segments[i]==NULL)
{
printf("malloc error\n");
exit(1);
}
for(j=0;j<SIZE/sizeof(int);j++)
segments[i][j]=0;
}
k=1;
for(;;)
{
printf("loop: %d\n",k);
for(i=0;i<SEGMENTS;i++)
{
for(j=0;j<SIZE/sizeof(int);j++)
{
if(segments[i][j]!=0)
{
printf("segments[%d][%d]=%d\n",i,j,segments[i][j]);
}
}
}
k++;
}
return 0;
}
==^================================================================
This email was sent to: [EMAIL PROTECTED]
EASY UNSUBSCRIBE click here: http://topica.com/u/?b1ddyi.b3hwCs.YXJjaGl2
Or send an email to: [EMAIL PROTECTED]
TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
==^================================================================