国产精品久久久久影院,成人午夜福利视频,国产精品久久久久高潮,国产精品 欧美 亚洲 制服,国产精品白浆无码流出

【嵌入式開發(fā)】寫入開發(fā)板Linux系統(tǒng)-模型S3C6410

發(fā)布者:fengting最新更新時間:2024-09-18 來源: cnblogs關(guān)鍵字:嵌入式開發(fā)  開發(fā)板  Linux系統(tǒng) 手機看文章 掃描二維碼
隨時隨地手機看文章

板子型號 : 三星 S3C6410 基于ARM11, 指令集基于arm6指令集;

為毛不是 Cortext A9的板子;

燒寫內(nèi)容 : BootLoader, Linux Kernel, File System;


燒寫流程 : 


-- sd卡燒寫u-boot并啟動 : 首先將 u-boot 燒寫到 sd 卡中, 使用 sd 卡的bootloader啟動; 


-- 擦出nand flash : 之后將開發(fā)板的閃存 nand flassh 擦除干凈; 


-- nand flash 燒寫 u-boot : 然后將 u-boot 燒寫到 nand flash 中;


-- 燒寫內(nèi)核 : 向nand flash 中燒寫內(nèi)核;


-- 燒寫文件系統(tǒng) : 將文件系統(tǒng)燒寫到nand flash 中; 


1. BootLoader介紹


嵌入式開發(fā)板軟件層次 : 從底層到上層 引導程序 -> Linux內(nèi)核 -> 文件系統(tǒng) -> 應用程序


-- 引導載入程序 : 分為兩部分 硬件中的固化boot代碼 和 BootLoader代碼, 當中固化的boot代碼可有可無, BootLoader是燒寫上去的;


-- Linux內(nèi)核 : 嵌入式開發(fā)板定制的內(nèi)核 和 其啟動參數(shù);


-- 文件系統(tǒng) : 即Linux中的文件系統(tǒng);


-- 應用程序 : 即用戶運行的應用程序, 應用程序 和 內(nèi)核之間可能包括嵌入式的圖形界面;


引導載入程序介紹 : 引導載入程序是系統(tǒng)上電之后運行的第一段程序;


PC機上的引導載入程序 : 


-- 組成結(jié)構(gòu) : BIOS (固件程序) 和 BootLoader(GRUB等程序);


-- 運行過程 : BIOS運行硬件檢測 和 資源分配, 之后將BootLoader讀取到內(nèi)存中, 開始運行BootLoader內(nèi)容;


-- 運行作用 : 將內(nèi)核讀取到內(nèi)存中, 跳轉(zhuǎn)到內(nèi)核的入口運行, 正式運行操作系統(tǒng)程序;


嵌入式BootLoader : BootLoader與硬件的依賴性非常強, 每一種嵌入式設(shè)備都有其相應的BootLoader引導程序, 在這里 S3C6410 板子使用的BootLoader 是 U-BOOT;


BootLoader操作模式 : 將BootLoader燒寫到 nand flash 中之后, 第一次啟動是靠交互模式啟動的, 之后就靠子啟動模式啟動;


-- 自啟動模式 : 系統(tǒng)上電之后自己主動將 BootLoader 載入到內(nèi)存, 之后自己主動開啟系統(tǒng), 整個過程全自己主動, 用戶不介入;


-- 交互模式 : BootLoader 通過串口 或者 網(wǎng)絡(luò)從服務(wù)器上下載內(nèi)核到內(nèi)存中, 能夠?qū)?nèi)核寫到磁盤, 或者直接進入系統(tǒng), 同一時候能夠從串口中接收用戶命令;


BootLoader啟動過程 : 分為兩個階段;


-- 第一階段 : 初始化基本硬件, 將BootLoader載入到內(nèi)存中, 設(shè)置堆棧指針, 清空BSS段;


-- 第二階段 : 初始化本階段用的硬件, 讀取環(huán)境變量, 啟動BootLoader(兩種啟動模式);


2. 配置網(wǎng)絡(luò)

燒寫過程須要配置 網(wǎng)絡(luò), tftp, nfs 三項, 配置完之后重新啟動服務(wù)器;


(1) 網(wǎng)絡(luò)設(shè)置


須要設(shè)置網(wǎng)絡(luò)ip地址 和 關(guān)閉防火墻; 假設(shè)是 redhat 系統(tǒng), 還須要關(guān)閉SELinux;


設(shè)置ip地址命令 : ifcofig eth0 192.168.1.27 命令;


關(guān)閉防火墻 : sudo ufw disable 命令;


重新啟動網(wǎng)絡(luò)服務(wù) :  sudo /etc/init.d/networking restart 命令;


octopus@octopus:~$ sudo ifconfig eth0 192.168.1.27

octopus@octopus:~$ sudo ufw disable

防火墻在系統(tǒng)啟動時自己主動禁用

octopus@octopus:~$ sudo /etc/init.d/networking restart

 * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces

 * Reconfiguring network interfaces... 


(2) 配置tftp


安裝tftp軟件 : 


-- 安裝tftp服務(wù)器 : sudo apt-get install tftpd 命令;


-- 安裝tftp客戶端 : sudo apt-get install tftp 命令;


-- 安裝 xinetd : sudo apt-get install xinetd 命令;


配置 tftp : 建立 /etc/xinetd.d/tftp 文件, 使用 sudo vim /etc/xinetd.d/tftp 命令, 向文件里寫入以下內(nèi)容 : 


service tftp

{

socket_type = dgram

wait = yes

disable = no

user = root

protocol = udp

server = /usr/sbin/in.tftpd

server_args = -s /tftpboot

#log_on_success += PID HOST DURATION

#log_on_failure += HOST

per_source = 11

cps =100 2

flags =IPv4

}


,

創(chuàng)建共享文件夾 : 查看 根文件夾下 有沒有 tftpboot 文件夾, 假設(shè)沒有的話就創(chuàng)建 /tftpboot 文件夾;


-- 創(chuàng)建共享文件夾 : sudo mkdir /tftpboot 命令創(chuàng)建;


-- 改動權(quán)限 : sudo chmod -R 777 /tftpboot , 加上 -R 表示 遞歸將其子文件夾子文件也進行權(quán)限改動; 


改動 /etc/xinetd.d 配置文件 : 保證配置文件與以下一致就可以;


# Simple configuration file for xinetd

#

# Some defaults, and include /etc/xinetd.d/


defaults

{


# Please note that you need a log_type line to be able to use log_on_success

# and log_on_failure. The default is the following :

# log_type = SYSLOG daemon info


}


includedir /etc/xinetd.d


改動 /etc/default/tftpd-hpa 配置文件 : 


# /etc/default/tftpd-hpa


TFTP_USERNAME='tftp'

TFTP_DIRECTORY='/tftpboot'

TFTP_ADDRESS='0.0.0.0:69'

TFTP_OPTIONS='-l -c -s'


重新啟動tftp服務(wù) : 注意依照次序?qū)⒁韵氯齻€命令依次運行 ;

-- 運行 service tftpd-hpa restart 命令 : 



octopus@octopus:~$ service tftpd-hpa restart

stop: Rejected send message, 1 matched rules; type='method_call', sender=':1.83' (uid=1000 pid=5737 comm='stop tftpd-hpa ') interface='com.ubuntu.Upstart0_6.Job' member='Stop' error name='(unset)' requested_reply='0' destination='com.ubuntu.Upstart' (uid=0 pid=1 comm='/sbin/init')

start: Rejected send message, 1 matched rules; type='method_call', sender=':1.84' (uid=1000 pid=5734 comm='start tftpd-hpa ') interface='com.ubuntu.Upstart0_6.Job' member='Start' error name='(unset)' requested_reply='0' destination='com.ubuntu.Upstart' (uid=0 pid=1 comm='/sbin/init')

-- 運行 sudo /etc/init.d/xinetd reload 命令 : 


octopus@octopus:~$ sudo /etc/init.d/xinetd reload

[sudo] password for octopus: 

Rather than invoking init scripts through /etc/init.d, use the service(8)

utility, e.g. service xinetd reload


Since the script you are attempting to invoke has been converted to an

Upstart job, you may also use the reload(8) utility, e.g. reload xinetd

-- 運行 sudo /etc/init.d/xinetd restart 命令 : 


octopus@octopus:~$ sudo /etc/init.d/xinetd restart

Rather than invoking init scripts through /etc/init.d, use the service(8)

utility, e.g. service xinetd restart


Since the script you are attempting to invoke has been converted to an

Upstart job, you may also use the stop(8) and then start(8) utilities,

e.g. stop xinetd ; start xinetd. The restart(8) utility is also available.

xinetd stop/waiting

xinetd start/running, process 5769


測試 tftp 服務(wù) : 

-- 進入tftp : 使用 tftp localhost , 進入本地的tftp服務(wù)器;


-- 下載當中的文件 : 使用 get uboot.bin 下載當中的 uboot 文件到本地文件夾, 假設(shè)文件不存在會提示 Error code 1: File not found 錯誤;



octopus@octopus:~$ tftp localhost

tftp> get aaa

Error code 1: File not found

tftp> get uboot.bin

tftp> quit

octopus@octopus:~$ ls

aaa        develop  icmp         ndk       Source Insight  x86-probe  模板  圖片  下載  桌面

arm-probe  gcc      log4c-1.2.1  programs  uboot.bin       公共的     視頻  文檔  音樂




(3) 配置 nfs 服務(wù)



安裝nfs服務(wù)器 : sudo apt-get install nfs-kernel-server 命令;




配置 nfs 服務(wù) : 使用 sudo vim /etc/exports 命令配置, 將以下的內(nèi)容加入到文件末尾 ;



/nfsroot *(rw,sync,no_root_squash)

-- 最終配置 : 



# /etc/exports: the access control list for filesystems which may be exported

# to NFS clients.  See exports(5).

#

# Example for NFSv2 and NFSv3:

# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)

#

# Example for NFSv4:

# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)

# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)


/nfsroot *(rw,sync,no_root_squash)


-- /nfsroot : 這個是 nfs 服務(wù)的共享文件夾;

-- * : 表示隨意IP都能夠訪問;


-- rw : 表示 能夠 讀 寫;


-- sync : 表示 同步;


-- no_root_squash : 表示 root 用戶登錄不做權(quán)限檢查;




創(chuàng)建共享文件夾 : sudo mkdir /nfsroot ;




重新啟動端口映射 : sudo /etc/init.d/portmap restart ;



octopus@octopus:~$ sudo /etc/init.d/portmap restart

Rather than invoking init scripts through /etc/init.d, use the service(8)

utility, e.g. service portmap restart


Since the script you are attempting to invoke has been converted to an

Upstart job, you may also use the stop(8) and then start(8) utilities,

e.g. stop portmap ; start portmap. The restart(8) utility is also available.

portmap stop/waiting

portmap start/running, process 5234


重新啟動 nfs 服務(wù) : sudo /etc/init.d/nfs-kernel-server restart ;


octopus@octopus:~$ sudo /etc/init.d/nfs-kernel-server restart

 * Stopping NFS kernel daemon                                                                                             [ OK ] 

 * Unexporting directories for NFS kernel daemon...                                                                       [ OK ] 

 * Exporting directories for NFS kernel daemon...                                                                                exportfs: /etc/exports [2]: Neither 'subtree_check' or 'no_subtree_check' specified for export '*:/nfsroot'.

  Assuming default behaviour ('no_subtree_check').

  NOTE: this default has changed since nfs-utils version 1.0.x


                                                                                                                          [ OK ]

 * Starting NFS kernel daemon                                                                                             [ OK ] 


驗證nfs服務(wù) : showmount -e, 假設(shè)出現(xiàn)共享文件夾說明 nfs 服務(wù)配置成功;


octopus@octopus:~$ showmount -e

Export list for octopus:

/nfsroot *



3. 向 SD 卡中燒寫 u-boot



燒寫位置 : 燒寫的 u-boot 位于 sd卡的末端, 假設(shè)SD卡存滿了數(shù)據(jù), 就會將最后的數(shù)據(jù)破壞掉, 燒寫的 u-boot 在文件系統(tǒng)中是看不到的;



計算位置 : 依據(jù)SD卡類型計算出 燒寫 u-boot 的初始位置;

-- SD卡 : SD 卡 最后2個文件塊 不能用于燒寫 u-boot, 因此燒寫的位置是 SD卡塊大小 減去 2 再減去 u-boot 的塊大小, 注意是 塊 大小, 一塊是 512字節(jié);

-- SDHC卡 : SDHC 卡 最后 1026 字節(jié)不能用于燒寫 u-boot, 因此燒寫的位置是 SDHC卡 塊大小 減去 1026, 再減去 u-boot 塊大小;



將SD卡裝入讀卡器, 查看設(shè)備名稱 : 使用 sudo fdisk -l /dev/sd* 查看sd卡大小, 推斷sd卡;

-- 查找sd卡 : 使用 ls /dev/sd* 命令查找sd卡;



octopus@octopus:~$ ls /dev/sd*

/dev/sda  /dev/sda1  /dev/sda2  /dev/sda5  /dev/sdb  /dev/sdb1

-- 查看SD卡信息 : 使用 sudo fdisk -l /dev/sdb 命令, 能夠看到 SD卡的塊大小是 512字節(jié), 總字節(jié)數(shù)為 1018691584 , 總塊數(shù)為 1989632 塊;


octopus@octopus:~$ sudo fdisk -l /dev/sdb


Disk /dev/sdb: 1018 MB, 1018691584 bytes

30 heads, 29 sectors/track, 2286 cylinders, total 1989632 sectors

Units = 扇區(qū) of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000


   設(shè)備 啟動      起點          終點     塊數(shù)   Id  系統(tǒng)

/dev/sdb1 

-- 查看 SD 卡塊大小 : 使用 cat /sys/block/sdb/size 命令;


octopus@octopus:~$ cat /sys/block/sdb/size 

1989632



計算 u-boot 大小 : 使用 ll u-boot-movi.bin 命令查看, 大小未 270336, 處以 512, 總共是 528塊;


octopus@octopus:~$ ll u-boot-movi.bin 

-rw-r--r-- 1 octopus octopus 270336  4月 20 16:59 u-boot-movi.bin

[1] [2] [3]
關(guān)鍵字:嵌入式開發(fā)  開發(fā)板  Linux系統(tǒng) 引用地址:【嵌入式開發(fā)】寫入開發(fā)板Linux系統(tǒng)-模型S3C6410

上一篇:ARM中外部中斷
下一篇:S3C6410的PWM驅(qū)動實例

小廣播
設(shè)計資源 培訓 開發(fā)板 精華推薦

最新單片機文章

 
EEWorld訂閱號

 
EEWorld服務(wù)號

 
汽車開發(fā)圈

 
機器人開發(fā)圈

電子工程世界版權(quán)所有 京ICP證060456號 京ICP備10001474號-1 電信業(yè)務(wù)審批[2006]字第258號函 京公網(wǎng)安備 11010802033920號 Copyright ? 2005-2025 EEWORLD.com.cn, Inc. All rights reserved