Subject: patch for "supporting" DVD-+RW, DVD+R
To: None <tech-kern@netbsd.org>
From: Wojciech Puchar <wojtek@tensor.3miasto.net>
List: tech-kern
Date: 10/24/2004 17:57:23
all it does is to make default disk size (if one is unreadable - like with 
blank/unclosed discs) not 800MB but >>>4.7GB.


with that you may write to DVD+R, DVD+RW with anything that use 32kB (or 
multiply of 32kB) blocks and /dev/rcd0d

dd if=discimage of=/dev/rcd0d bs=32k

all works :)

DVD-RW works too but it must be formatted to "restricted overwrite" mode 
with dvd+rw-format first.

mostly useful for /sbin/dump , but -B must be given to match disk size and 
-b 32 to make blocks 32K (or 64K), and that's for what i use it.


after finishing writing

/sbin/scsictl /dev/rcd0d flushcache must be done, or you won't be able to 
get the disc out of drive


PS. reading real disk size from DVD recorder directly would be even 
nicer...but i have no idea/docs to do this.

--- cd.c.orig   2004-10-18 21:38:57.000000000 +0200
+++ cd.c        2004-10-18 21:38:40.000000000 +0200
@@ -1612,9 +1612,9 @@
                  * use a fake size
                  */
                 cd->params.blksize = 2048;
-               cd->params.disksize = 400000;
-               cd->params.disksize512 = 1600000;
-               return (400000);
+               cd->params.disksize= 100000000;
+               cd->params.disksize512= 400000000;
+               return (100000000);
         }

         /*
@@ -1645,7 +1645,7 @@

         size = _4btol(rdcap.addr) + 1;
         if (size < 100)
-               size = 400000;  /* ditto */
+               size = 100000000;       /* ditto */
         cd->params.disksize = size;
         cd->params.disksize512 = ((u_int64_t)cd->params.disksize * 
blksize) / DEV_BSIZE;