electronictechnician.wordpress.com has published a library for use SD cards in SPI completely written in C.
It’s a library for use SD cards in SPI mode with uControllers, entirely written in C. This library can work with SD cards and also has the possibility to emulate the behavior in a PC file (GNU/Linux) using the macro _M_IX86. It’s for debugging purposes. The data transfer is oriented to 512 byte size, remember this.
ulibSD – a library for use SD cards in SPI mode with uControllers – [Link]