樹莓派學習

想搞搞樹莓派買了一塊都沒碰,還是要勤奮點啊。

昨天安裝好了編譯器啥的,把內核編了,比較簡單沒有碰到什麼難度很大的問題。
但是今天找bootloader的時候發現不太對頭。查了一下發現了一下
樹莓派大致的啓動步驟

看到這一段

At power-up, the CPU is offline, and a small RISC core on the GPU is responsible for booting the SoC, therefore most of the boot components are actually run on the GPU code, not the CPU.

The boot order and components are as follows:

1.First stage bootloader - This is used to mount the FAT32 boot partition on the SD card so that the second stage bootloader can be accessed. It is programmed into the SoC itself during manufacture of the RPi and cannot be reprogrammed by a user.
2.Second stage bootloader (bootcode.bin) - This is used to retrieve the GPU firmware from the SD card, program the firmware, then start the GPU.
3.GPU firmware (start.elf) - Once loaded, this allows the GPU to start up the CPU. An additional file, fixup.dat, is used to configure the SDRAM partition between the GPU and the CPU. At this point, the CPU is release from reset and execution is transferred over.
4.User code - This can be one of any number of binaries. By default, it is the Linux kernel (usually named kernel.img), but it can also be another bootloader (e.g. U-Boot), or a bare-bones application.

爲了自己方便看,翻了一下
大致意思
是上電的時候,cpu是不在線的,一個gpu傷的小系統會負責啓動soc,所以大部分的啓動都是在gpu上面完成的,而不是在cpu
啓動順序如下:
- 第一階段:這一步是用來掛載sd卡上的fat32啓動分區的,運行之後才能進行第二階段的啓動。這一步是被廠家編寫在soc中的,並且不能被用戶修改。
- 第二階段(bootcode.bin):這是用來檢索sd卡內的gpu軟件的,運行該軟件,啓動gpu
- 第三階段(start.elf):加載後,這個就允許gpu啓動cpu,一個附加的文件fixup.dat,用來設置gpu和cpu之間的sdram分區,在這個時候,cpu就開始跑了。
- 第四階段:用戶代碼:這裏就有很多選擇了,默認情況下是名爲kernel.img的linux 內核,但是也可以是另外一些bootloader,比方uboot,或者是一些裸機程序。

大概是這個意思。有錯誤請指正。
第一部分是集成的所以不需要
第二部分是bootcode.bin
第三部分是start.elf和一個附加的fixup.dat
第四部分就是自己的代碼了

那麼接下去就要去找這些東西了。

在傳說中世界最大男性同性交友網站github上輕輕鬆鬆就找到了
github上關於樹莓派啓動的文件
待會兒試試行不行

發佈了50 篇原創文章 · 獲贊 38 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章