Oh, yes I forgot that it won't do any write caching like desktops do :/
Is there enough memory available in the camera to actually copy the useful sensor info there, and then just write it at once on the card?
On cameras with two raw buffers, you could use the second buffer.
This would require a lot of change to the DNG code - the RAW buffer has to be byte swapped when saving to the DNG file. You would have to change the byte swapping code to work on image lines, instead of blocks. This could be slower since you will be calling the function many more times. It still has to synch with the file writing code so that enough lines have been swapped before starting to write.
On cameras with only one raw buffer it would be very hard (see below).
Also, is the RAW buffer read only? If not, can't the information be placed in the same buffer, and then written at once as before?
Not easily. As I said above, the memory has to be byte swapped before saving to the DNG file. If there is only one raw buffer it is swapped in place, then swapped back once the DNG file is done. This is needed because the camera has not generated the JPEG image yet.
If you change the layout of the raw buffer, then you have to be able to undo any changes so that the JPEG image generation can happen.
Phil.