Through the serial port. It turns out that if you really dig into the 1541 docs, it’s possibly to push assembly code into RAM using existing 1541 commands over the serial port. And the 1541 has a command buffer. So I pushed assembly to perform parallel calculations to it, and then pushed two commands into the buffer, one to execute the code and the next one to resume normal serial ops after it ret’urned. The data from the calculations was placed into the data buffer prior to returning, and the 1541 just sent it out the port as a regular data packet, just as if it had been read off a floppy. Or so I recall; this was in 1986. My memory’s a little fuzzy.
It worked with N drives, too, although the C64 sort of had to act as the bus master to avoid serial packet conflicts.
That was a long time ago and I’ve certainly forgotten many of the details. But it won me a trip to the International Science Fair (this was before Intel started sponsoring it).