Booting from SD/zh tw

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(NOR in GTA02 history)
(NOR in GTA02 history)
Line 3: Line 3:
  
 
{{Editing|[[User:Coolcat|coolcat]]|30, Dec, 2008|本網頁目前正在加強內容編輯中}}
 
{{Editing|[[User:Coolcat|coolcat]]|30, Dec, 2008|本網頁目前正在加強內容編輯中}}
 +
 +
 +
 +
== How it Works ==
 +
 +
On the Neo, [[u-boot]] performs a similar role to the 'grub' bootloader on a PC. U-boot loads a kernel image into memory and then passes a list of parameters to the kernel. These parameters specify, among other things, the device on which the root filesystem is located.
 +
 +
As the kernel boots, it initializes the hardware and then mounts the root filesystem. The kernel then runs "/sbin/init", which handles the rest of the boot-up sequence (such as displaying the splash screen and progress bar).
 +
 +
This sequence is the same whether the device is booting from built-in Flash or from the SD card. The differences are how the kernel is loaded, and which device is mounted as the root filesystem.
 +
 +
The following sections provide additional details.
 +
 +
 +
Openmoko GTA02 支援雙系統開機。除了將映像檔燒錄到您的NAND外,你也可以利用將其它套件放在SD卡的方法,使用SD卡開機,載入另一個套件系統。
  
  

Revision as of 08:14, 12 January 2009


Editing: (30, Dec, 2008) This page is being edited by coolcat: 本網頁目前正在加強內容編輯中

If this note persists without edits in the history, feel free to remove the Editing template from the page.



How it Works

On the Neo, u-boot performs a similar role to the 'grub' bootloader on a PC. U-boot loads a kernel image into memory and then passes a list of parameters to the kernel. These parameters specify, among other things, the device on which the root filesystem is located.

As the kernel boots, it initializes the hardware and then mounts the root filesystem. The kernel then runs "/sbin/init", which handles the rest of the boot-up sequence (such as displaying the splash screen and progress bar).

This sequence is the same whether the device is booting from built-in Flash or from the SD card. The differences are how the kernel is loaded, and which device is mounted as the root filesystem.

The following sections provide additional details.


Openmoko GTA02 支援雙系統開機。除了將映像檔燒錄到您的NAND外,你也可以利用將其它套件放在SD卡的方法,使用SD卡開機,載入另一個套件系統。


NOR in GTA02 history

GTA 02搭載了2MB的NOR flash。在DVT4 units (2008 April arrived Taipei)之前,GTA02 NOR 在硬體上並沒有做NOR 保護控制。在dvt4之後的軟體元件,及量產的產品,都包含了硬體的NOR保護。你必須使用debug board v3 或之後的版本,來停用NOR 寫入元件,停用保護,之後就可以在gta02上更新NOR。

DVT4 單元及PVT1元件都會使用 "uImage"做為它的kernel image 檔名,而不是使用"uImage.bin" 。你可以在啟動畫面上找到它的日期,暸解你的硬體裝置上所使用的版本。

  • 你可以在以下的位置找到啟動NOR寫入功能的元件:

停用NOR寫入保護


歷史版本

  • 20080226 初版
  • 20080305 修復DFU,並且移除NOR版本,使用NAND功能
  • 20080312 修復自SD記憶卡啟動功能 (從使用uImage 改為使用uImage.bin)
  • 20080320 修復u-boot direct drawing 500mA 、智慧充電、量產版本。

製作可開機的SD Card (GTA02)

以下為自SD中啟動系統的操作步驟指引。它使用ubuntu 及一張乾淨的512 MB Sandisk microSD 卡(FAT16 分割區格式的SD card):

  • Step 1, 缷載磁碟:
  sudo umount /media/disk-1
NOTE: 由於個人使用的作業環境之不同, 所使用的磁碟代號將有所不同,建議您使用df指令查看您的磁碟代號



接著將磁碟分為二個分割區,第一個分割區使用vfat,預留 8MB空間給 uImage.bin,第二個磁區 (其餘的磁碟空間) 使用ext2 格式,提供給rootfs 檔案及目錄使用。二個分割區都使用primary partition 類型。

  • Step 2, fdisk:
  sudo fdisk /dev/mmcblk0
  Command (m for help): d
  Selected partition 1
  Command (m for help): n
  Command action
     e   extended
     p   primary partition (1-4)
  p
  Partition number (1-4): 1
  First cylinder (1-983, default 1):
  Using default value 1
  Last cylinder or +size or +sizeM or +sizeK (1-983, default 983): +8M
  Command (m for help): n
  Command action
     e   extended
     p   primary partition (1-4)
  p
  Partition number (1-4): 2
  First cylinder (18-983, default 18):
  Using default value 18
  Last cylinder or +size or +sizeM or +sizeK (18-983, default 983):
  Using default value 983
  Command (m for help): w
  The partition table has been altered!
  Calling ioctl() to re-read partition table.
  Syncing disks.
NOTE: 由於個人使用的作業環境之不同, 所使用的代號將有所不同,建議您使用df指令查看您的磁碟代號


  • Step 3 Format:

Format 2 volume with vfat (uImage.bin) and ext2 (rootfs files)

  mkfs -t vfat /dev/mmcblk0p1
  mkfs -t ext2 /dev/mmcblk0p2


  • Step 4 Copy kernel and rootfs files into 2 volume:

uImage.bin 為量產所使用的映像檔。uImage則為較早期所使用的元件(DVT4/PVT1)。你必須壓縮 xvzf rootfs.tar.gz 以取得所有的檔案。

  sudo cp -r /home/tony/Desktop/kernel/uImage.bin /media/disk-1
  sudo cp -r /home/tony/Desktop/root_files/. /media/disk-2
  sync
  • Step 5 自Neo的選單中,選擇 boot from SD (在正確的 u-boot_env 內容下)

開機環境 (GTA02)

在GTA02 NAND下有六個分割區。

  • 1. u-boot.bin
  • 2. u-boot_env
  • 3. kernel (uImage.bin)
  • 4. splash.gz (splash screen)
  • 5. Factory (BT/WLAN/Serial...etc)
  • 6. rootfs

預設的GTA02 env 檔案最原始的版本(2008/7)可以在下面的位址找到 預設env檔

你可以使用下面的 env.new 檔案,在開機畫面中加入 boot from sd 功能選項。 u-boot environment.

  • ./dfu-util -a u-boot_env -R -D env.new

自NOR (GTA02)下開機

如果你想要自NOR下開機,並且從SD卡中使用NOR,請使用下列的操作步驟。

  • 按下AUX key
  • 再按住Power,啟動GTA02
  • 約一秒後放開AUX

接著,你可以進入預設的NOR開機選單,你可以:

  • 使用NOR開機,使用DFU
  • 使用NOR開機畫面自SD卡開機

自NAND下開機 (GTA02)

Personal tools


Editing: (30, Dec, 2008) This page is being edited by coolcat: 本網頁目前正在加強內容編輯中

If this note persists without edits in the history, feel free to remove the Editing template from the page.



NOR in GTA02 history

GTA 02搭載了2MB的NOR flash。在DVT4 units (2008 April arrived Taipei)之前,GTA02 NOR 在硬體上並沒有做NOR 保護控制。在dvt4之後的軟體元件,及量產的產品,都包含了硬體的NOR保護。你必須使用debug board v3 或之後的版本,來停用NOR 寫入元件,停用保護,之後就可以在gta02上更新NOR。

DVT4 單元及PVT1元件都會使用 "uImage"做為它的kernel image 檔名,而不是使用"uImage.bin" 。你可以在啟動畫面上找到它的日期,暸解你的硬體裝置上所使用的版本。

  • 你可以在以下的位置找到啟動NOR寫入功能的元件:

停用NOR寫入保護


歷史版本

  • 20080226 初版
  • 20080305 修復DFU,並且移除NOR版本,使用NAND功能
  • 20080312 修復自SD記憶卡啟動功能 (從使用uImage 改為使用uImage.bin)
  • 20080320 修復u-boot direct drawing 500mA 、智慧充電、量產版本。

製作可開機的SD Card (GTA02)

以下為自SD中啟動系統的操作步驟指引。它使用ubuntu 及一張乾淨的512 MB Sandisk microSD 卡(FAT16 分割區格式的SD card):

  • Step 1, 缷載磁碟:
  sudo umount /media/disk-1
NOTE: 由於個人使用的作業環境之不同, 所使用的磁碟代號將有所不同,建議您使用df指令查看您的磁碟代號



接著將磁碟分為二個分割區,第一個分割區使用vfat,預留 8MB空間給 uImage.bin,第二個磁區 (其餘的磁碟空間) 使用ext2 格式,提供給rootfs 檔案及目錄使用。二個分割區都使用primary partition 類型。

  • Step 2, fdisk:
  sudo fdisk /dev/mmcblk0
  Command (m for help): d
  Selected partition 1
  Command (m for help): n
  Command action
     e   extended
     p   primary partition (1-4)
  p
  Partition number (1-4): 1
  First cylinder (1-983, default 1):
  Using default value 1
  Last cylinder or +size or +sizeM or +sizeK (1-983, default 983): +8M
  Command (m for help): n
  Command action
     e   extended
     p   primary partition (1-4)
  p
  Partition number (1-4): 2
  First cylinder (18-983, default 18):
  Using default value 18
  Last cylinder or +size or +sizeM or +sizeK (18-983, default 983):
  Using default value 983
  Command (m for help): w
  The partition table has been altered!
  Calling ioctl() to re-read partition table.
  Syncing disks.
NOTE: 由於個人使用的作業環境之不同, 所使用的代號將有所不同,建議您使用df指令查看您的磁碟代號


  • Step 3 Format:

Format 2 volume with vfat (uImage.bin) and ext2 (rootfs files)

  mkfs -t vfat /dev/mmcblk0p1
  mkfs -t ext2 /dev/mmcblk0p2


  • Step 4 Copy kernel and rootfs files into 2 volume:

uImage.bin 為量產所使用的映像檔。uImage則為較早期所使用的元件(DVT4/PVT1)。你必須壓縮 xvzf rootfs.tar.gz 以取得所有的檔案。

  sudo cp -r /home/tony/Desktop/kernel/uImage.bin /media/disk-1
  sudo cp -r /home/tony/Desktop/root_files/. /media/disk-2
  sync
  • Step 5 自Neo的選單中,選擇 boot from SD (在正確的 u-boot_env 內容下)

開機環境 (GTA02)

在GTA02 NAND下有六個分割區。

  • 1. u-boot.bin
  • 2. u-boot_env
  • 3. kernel (uImage.bin)
  • 4. splash.gz (splash screen)
  • 5. Factory (BT/WLAN/Serial...etc)
  • 6. rootfs

預設的GTA02 env 檔案最原始的版本(2008/7)可以在下面的位址找到 預設env檔

你可以使用下面的 env.new 檔案,在開機畫面中加入 boot from sd 功能選項。 u-boot environment.

  • ./dfu-util -a u-boot_env -R -D env.new

自NOR (GTA02)下開機

如果你想要自NOR下開機,並且從SD卡中使用NOR,請使用下列的操作步驟。

  • 按下AUX key
  • 再按住Power,啟動GTA02
  • 約一秒後放開AUX

接著,你可以進入預設的NOR開機選單,你可以:

  • 使用NOR開機,使用DFU
  • 使用NOR開機畫面自SD卡開機

自NAND下開機 (GTA02)