Samsung company Uboot Mode change partition (EMMC) size fdisk command

Source: Internet
Author: User
Tags printf strcmp

Samsung company Uboot Mode change partition (EMMC) size fdisk command

First, partition

The Samsung platform generally divides it into four zones:

(1), FAT partition, used as SD card;

(2), system partition, equivalent to computer C disk, used to install Android system;

(3), UserData Division;

(4), cache partition.

Second, partition change operation process

1. Change the code in Uboot/common/cmd_mmc_fdisk.c

in this file we can see the definition of four partition sizes:

#define		block_size
#define		block_end			0xFFFFFFFF
#define		_10mb				(10*1024* 1024x768)
#define		_100mb				(100*1024*1024)
#define		_300mb				(300*1024*1024)
#define		_8_4GB				(1023*254*63)
#define		_1GB				(1024*1024*1024)
#define		disk_start			RAW_AREA_SIZE//MJ (16*1024*1024)// Same as raw area size

#define		system_part_size		_1gb//_300mb
#define		user_data_part_size		_1GB//_300mb//_1gb
#define		cache_part_size			_300mb

#define		chs_mode			0
#define		Lba_mode			! ( Chs_mode)
2. Repartition fdisk-c 0 Command

3. Partition Format method

3.1. Enter the following command Fatformat MMC 0:1


3.2. Enter the following command Fatformat MMC 0:2


3.3. Enter the following command Fatformat MMC 0:3


3.4. Enter the following command Fatformat MMC 0:4


3.5 Enter "FastBoot" in HyperTerminal


4, the whole system to re-burn

Running files in "Usb_fastboot_tool"--"Platform-tools" folder on PC
"Cmd.exe" (the Cmd.exe executable is a command-line tool that comes with Windows, and the CD-ROM is Win7 under
, if the prompt version is incompatible, use the Cmd.exe tool inside your own system)
[HTML] view plain copy fastboot.exe Flash bootloader u-boot-itop-4412.bin fastboot.exe flash kernel zimage fast Boot.exe Flash ramdisk ramdisk-uboot.img fastboot.exe Flash system system.img
Three, fdisk command analysis

Int do_fdisk (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])     {       if  ( argc == 3 | |  argc ==6 )        {            if  ( strcmp (argv[1],  "-C")  == 0 )                 return create_mmc_fdisk (ARGC,&NBSP;ARGV);   //formatted partition           else if  ( strcmp (argv[1],  "-p ")  == 0 )               return  print_mmc_part_info (ARGC,&NBSP;ARGV)  //print out partition information        }       else //if the argc condition is not met, print out help information        {           printf ("usage:\nfdisk <-p> <device_num>\n");            printf ("Fdisk <-c> <device_num> [<sys. part size (MB) > <user data part size> <cache part size>]\n ");       }       return 0;  } 

2. Implementation function of Do_fdisk

We usually use the Fdisk-c 0 format inand, fdisk-p 0 View the partition information, here you can see the resolution of the two commands:[CPP]  View Plain  copy int do_fdisk (CMD_TBL_T&NBSP;*CMDTP,&NBSP;INT&NBSP;FLAG,&NBSP;INT&NBSP;ARGC,  char *argv[])    {       if  ( argc == 3  | |  argc ==6 )        {            if  ( strcmp (argv[1],  "-C")  == 0 )                 return create_mmc_fdisk (ARGC,&NBSP;ARGV);   //Formatting Partitions            else if  ( strcmp (argv[1],  "-P")  == 0 )                 return print_mmc_part_info (ARGC,&NBSP;ARGV)  //print out partition information         }       else //If the argc condition is not met, print out help information         { &nBsp         printf ("usage:\nfdisk <-p> <device_num>\ n ");           printf (" Fdisk <-c> <device_ Num> [<sys. part size (MB) > <user data part size> < cache part size>]\n ");       }        return 0;  } 

3, if it is fdisk-c 0 in, enter Create_mmc_fdisk, we will analyze the function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.