On 17/12/09 16:10, Mark Hounschell wrote:
0: 0 1: 0 2: 0 3: f6 4: 0 5: 1 6: 2 no disk change
hehe, probably a left-over of the previous "failed" test were the "raw_cmd->kernel_data = (char *) here;" line was missing. ... proving once again that the DMA controller sends whatever byte was at that location _previously_... Another thing to do now would be to repeat the "fdformat twice" test, but this time do lots of memory-intensive, but not floppy-related things between the to fdformats... fdformat -n /dev/fd0u1440 *do lots of stuff* fdformat /dev/fd0u1440 The reason for this is, AFAIK, DMA controller do _not_ have caches... So the only inconsistency that may occur is an inconsistency between the _processor's_ cache, and the main memory (where the DMA controller gets its data from). Doing lots of memory-intensive stuff would have the effect of making sure the processor's cache is appropriately written out to memory (but without affecting any hypothetical cache of the DMA controller), and might make the problem go away. Here is a small program that I sometimes use to use up lots of memory: #include <stdio.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> #include <string.h> void main(int argc, char **argv) { unsigned int max,min; int n; char *a; unsigned int i; int ctr; char maxs[40],mins[40]; if ( argc < 3 ) { printf("Trying to find maximum allocatable memory size\n"); min = 0; max = -1; } else { min=strtoul(argv[1],0,0); max=strtoul(argv[2],0,0); } n = (max >> 1) + (min >> 1) + (((min&1)+(max&1)) >> 1); printf("%08x < %08x < %08x\r",min,n,max); fflush(stdout); a=malloc(n); if (max - min >= 4 || a == 0){ if (a != 0){ sprintf(mins,"%d",n); sprintf(maxs,"%d",max); } else{ sprintf(mins,"%d",min); sprintf(maxs,"%d",n); } execlp(argv[0],argv[0],mins,maxs,0); } printf("\nok\nDirtying pages\n"); for(ctr = 0; ctr < n / 2049; ctr++) { i=random() % n; a[i]=1; if (!(ctr % 16)) { printf("%08x\r",ctr); fflush(stdout); } } printf("\n"); exit(0); } Alain