> Blaz, I see what MAY be an error, at least an inconsistency. I think you
> need to
> add a multiply 4 (*4) to the calculation like you did in the printf. - Larry
> Mittman
> > fprintf(stdout, "ramdisk: rounding size up to %d KB ...\n", ((size / 4) +
> 1) * 4);
> > size = size / 4 + 1;
> *******************************
> > } else {
> > size = size / 4;
> *******************************
No, actually the size passed to ioctl() is in 4 KB blocks since pages
are 4 KB wide. Output is multiplied by 4 to show size in 1 KB blocks,
not 4 KB.
Any other suggestions ? Please try it out ...
Oh, and BTw, i forgot to tell you what the bug i am encountering
actually does: when ioctl() with arg that isn't multiple of 64/4 is
called whole ioctl() finishes its job, it hangs right after printing
"about to exit(0); text (and _before_ ramdisk could output its info
about disk created). Its weird, really :-)
bye, Ab