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

==============================================================
Never cross a dragon - for you are crunchy and taste delicious!
My major interests are:
Amateur {Ham} Radio - N8MGU | Opera-Jazz-Musical Theater | Sailing | Judaica

----- Original Message -----
From: Blaz Antonic <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 07, 1999 3:53 PM
Subject: Re: new rrd.c ?


> > I got the code, and merged it into CVS, but did not have time to test
it. I
> > am deeply involved in lots of other code at the moment. Please try
mailing
> > it to the list and see if you get someone there to test it. CVS is not
>
> I have attached newest versions of ramdisk driver. In few words, driver
> should be able to support variable size disks now and disk, larger than
> one segment (64 KB). There were few bugs too that prevented the old
> version to compile under 0.0.77.
>
> I really _need_ people to test it out as i can't find one stupid bug
> somwehere inthere. Creating/removing disks with sizes that are multiples
> of 64 KB seems to work just fine while using other sizes (10 KB, 70 KB,
> ... for example) crashes the kernel at unexpected point (no crash with
> stack info or anything). So what i need people to do is to test it out,
> maybe it works on someone else's box .. You need some basic C skills to
> do that though and understanding of kernel source is required too in
> order to be able to follow source execution.
>
> If you don't want to see all the messages from kernel and just want to
> try it out for yourself #undef DEBUG in rd.c (but you won't be able to
> debug it then either).
>
> Put rd.c in arch/i86/drivers/block/rd.c, rd.h in include/linuxmt/rd.h,
> ramdisk.c in elkscmd/disk_utils/ramdisk.c, recompile, update your root
> disk and test it out.
>
> BTW: is there some way to actually debug (step by step mode with fulkl
> registers dump) ELKS ?? Afaik pcemu was able to do something like that,
> anyone has any clues on that ??
>
> bye, Ab
>

.......[snip]........
>
> if ((size < 1) || (size > MAX_SIZE)) {
> fprintf(stderr, "ramdisk: invalid size; use integer in range of 1 .. %d,
ramdisk will round it up to nearest multiple of 4 KB\n", MAX_SIZE);
> exit(1);
> }
> if (( fd = open(argv[1], 0) ) == -1) {
> perror("ramdisk");
> exit(1);
> }
> if (strcmp(argv[2],"make") == 0) {
> /* recalculate size to # of 4 KB pages */
> if ((size % 4) != 0) {
> fprintf(stdout, "ramdisk: rounding size up to %d KB ...\n", ((size / 4) +
1) * 4);
> size = size / 4 + 1;
*******************************
> } else {
> size = size / 4;
*******************************
> }
>
> if (ioctl(fd, RDCREATE, size)) {
> perror("ramdisk");
> exit(1);
> }
> fprintf(stdout,"ramdisk: %d KB ramdisk created on %s\n", size * 4,
argv[1]);
> exit(0);
> }
> if (strcmp(argv[2],"kill") == 0) {
> if (ioctl(fd, RDDESTROY, 0)) {
> perror("ramdisk");
> exit(1);
> }
> fprintf(stdout,"ramdisk destroyed on %s\n", argv[1]);
> exit(0);
> }
> }
>

Reply via email to