---
title: "基于S3C2410的SD卡linux驱动工作原理（一）"
author: "cjc"
date: "2009-06-09T10:41:40Z"
tags: []
categories: ["移动开发"]
slug: "s3c2410-sd-linux"
draft: false
lastmod: "2009-06-09T10:41:40Z"
id: 404754
url: "https://cjc.iteye.com/blog/404754"
---

想了解SD卡的工作原理，首先需要了解的就是SD卡协议了，这个在网上可以轻松的下载到。在了解协议后，就可以看看下面的一些开发思路了。

首先看下脱离操作系统如何在S3C2410上实现SD卡的读写。过程可以分为3个大的步骤：初始化sd卡、写sd卡、读sd卡；下面的过程是我通过realview-MDK环境测试过的。

**一、初始化sd卡**

![初始化sd卡](http://www.embedu.org/Column/images/Column18-1.gif)

**二、写sd卡**

写sd卡可以分为3种方式：POLL、中断、DMA

（1）POLL写

![POLL写](http://www.embedu.org/Column/images/Column18-2.gif)

（2）中断写

![中断写](http://www.embedu.org/Column/images/Column18-3.gif)

（3）DMA写

![DMA写](http://www.embedu.org/Column/images/Column18-4.gif)

**三、读sd卡**

读sd卡也可分为3中方式：POLL、中断、DMA

（1）POLL读

![POLL读](http://www.embedu.org/Column/images/Column18-5.gif)

（2）中断读

![中断读](http://www.embedu.org/Column/images/Column18-6.gif)

（3）DMA读

![DMA读](http://www.embedu.org/Column/images/Column18-7.gif)

end