您的位置:首页 > 其它

How to port cupcake to TI zoom2 platform (4)

2009-10-09 15:47 176 查看


Zoom2 (Beta) Hardware and

SoftwareSetup

-------By Fendy_Dai

Appendix A

Booting Introduction

The OMAP processor follows a 2 stage boot process. The first stage is loaded into the internal static ram by the ROM code. Because the internal static ram is very small (64k), the first stage loader is needed to initialize memory and enough of the peripheral devices to access and load the second stage loader into main memory. It is the job of the second stage loader to initialize the remaining hardware and prepare the system for kernel boot.

SD Card Boot

Assuming there was no answer from the host during serial boot, the ROM looks for an SD Card on the first MMC controller. If a card is found, the ROM then looks for the first FAT32 partition within the partition table. Once the partition is found, the root directory is scanned for a special signed file called "MLO". Assuming all is well with the file, it is transfered into the internal sram and control is passed to it. The SDCard x-loader looks for a FAT32 partition on the first MMC controller and scans the top level directory for a file named "u-boot.bin". It then transfers the file into main memory and transfers control to it.

Preparing the SD Card

Since putting a Linux file system on a FAT32 partition is problematic, it is recommended to create 2 partitions. The first partition is a boot partition between 64-128 Megabytes and the second partition is a Linux partition consuming the rest of the card.

Plug your SD card (1GB card assumed unless mentioned) into your Linux box - do not mount it. For this example, we will assume the card shows up as /dev/sdc - substitute this for the real device on your specific machine.

Fdisk the drive and print the partition information

fdisk /dev/sdc

Command (m for help): p

Disk /dev/sdc: 1018 MB, 1018691584 bytes

...<more>...

Look for the size in bytes of the device and calculate the number of cylinders, dropping factions, if we have 255 heads and 63 sectors.

new_cylinders = Size / 8225280 (for this example we will have 993001472 / 8225280 which equals 120.725 or 120 cylinders)

Since we are changing the underlying geometry of the disk, we must clear the partition table before doing it. So

delete all partitions
using the fdisk 'd' command - yes, you will lose all data on the card. Once that is done, we can set the new geometry in expert mode. We will set the # of heads to 255, # of sectors to 63, and # of cylinders to new_cylinders.

Command (m for help): x

Expert command (m for help): h

Number of heads (1-256, default 30): 255

Expert command (m for help): s

Number of sectors (1-63, default 29): 63

Warning: setting sector offset for DOS compatiblity

Expert command (m for help): c

Number of cylinders (1-1048576, default 2286): 120
(for 2 GB cards, the Number of cylinders is 240)

Now we return to the main menu and create our 2 partitions as needed - 1 boot partition of 64MB and the rest a linux partition.

Expert command (m for help): r

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-123, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-123, default 123): +64M

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 2

First cylinder (10-123, default 10):

Using default value 10

Last cylinder or +size or +sizeM or +sizeK (10-123, default 123):

Using default value 123

(use 240 in case of 2 GB card)

Set the partition type of the first partition to FAT32 and make it active.

Command (m for help): t

Partition number (1-4): 1

Hex code (type L to list codes): c

Changed system type of partition 1 to c (W95 FAT32 (LBA))

* You have to format 1st partitions with vfat32 filesystem.

Command (m for help): a

Partition number (1-4): 1

The partition table should look something like the following. Notice the heads, sectors, and cylinders. Make sure partition 1 is active and FAT32. If it looks good - write the new partition information out.

Command (m for help): p

Disk /dev/sdc: 993 MB, 993001472 bytes

255 heads, 63 sectors/track, 120 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x00000000

Device Boot Start End Blocks Id System

/dev/sdc1

*

1

972261

c

W95 FAT32 (LBA)

/dev/sdc2

10

120

891607+

83

Linux

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x

partitions, please see the fdisk manual page for additional

information.

Syncing disks.

Formating the partitions

Format the filesystems on the partitions

mkfs.vfat -F 32 -n boot /dev/sdc1

mkfs.ext3 /dev/sdc2
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: