Page 1 of 1

partition table

Posted: Wed Feb 24, 2016 1:55 pm
by swadallail
(i have one problem in the code )
_____________________________________________________________
PT1_Status db 0x80 ;Drive number/Bootable flag
PT1_First_Head db 0x01 ;First Head
PT1_First_Sector db 0x01 ;Bits 0-5:First Sector|Bits 6-7 High bits of First Cylinder
PT1_First_Cylinder db 0x00 ;Bits 0-7 Low bits of First Cylinder
PT1_Part_Type db 0x0C ;Partition Type
PT1_Last_Head db 0xFF ;Last Head
PT1_Last_Sector db 0xFF ;Bits 0-5:Last Sector|Bits 6-7 High bits of Last Cylinder
PT1_Last_Cylinder db 0xCD ;Bits 0-7 Low bits of Last Cylinder
PT1_First_LBA dd 0x0000003F ;Starting LBA of Partition
PT1_Total_Sectors dd 0x00EE8000 ;Total Sectors in Partition
____________________________________________________________________
i am used fdisk in linux give me that
247 heads,62 sectors/track , 1020 cylinders, total 15630336 sectors
____________________________________________________________________
and used testdisk in windows give me that
CHS 973 255 63 total 15630336 sectors
____________________________________________________________________
i am used flash 8 GB
note :used fat32
i am fill code above but here error any people can help me

Re: partition table

Posted: Wed Feb 24, 2016 3:13 pm
by Octocontrabass
In CHS addressing, the cylinder and head are 0-indexed. Any value indicating the first or last cylinder (or head) must be less than the total number of cylinders (or heads).

The total sectors in the partition must be less than the total sectors on the disk.

If you are trying to make the disk bootable, you will get the best results by obeying the following limitations:
  • There must be 63 sectors per track.
  • There must be 255 (not 256!) heads.
  • CHS addresses must be rounded down to the last whole cylinder.
  • Except for the previous point, LBA and CHS addresses must match.
Since the disk has 15630336 sectors, the CHS addresses range from 0,0,1 to 972,240,36 inclusive. Since cylinder 972 is a partial cylinder, the highest CHS address you can use is 971,254,63.

Re: partition table

Posted: Thu Feb 25, 2016 2:46 am
by swadallail
thanks Octocontrabass for reply
i am very happy for help me
but i have difficulty for fill in that code in above
are you can help me for that

Re: partition table

Posted: Thu Feb 25, 2016 3:15 am
by Octocontrabass
First, you need to answer these three questions:
  • What is the LBA of the first sector in your partition?
  • What is the LBA of the last sector in your partition?
  • How many sectors are in your partition?

Re: partition table

Posted: Thu Feb 25, 2016 3:53 am
by swadallail
ok how give you information about that
are you know any commands for that
note:i am using flash memory 8GB emulation HDD
name「SanDisk」,ind format by fat32

Re: partition table

Posted: Thu Feb 25, 2016 4:28 am
by Octocontrabass
You choose where the partition will go. Where do you want it to start and end? How big do you want it to be?

Re: partition table

Posted: Thu Feb 25, 2016 4:57 am
by swadallail
no problem i need start and end anything now
i need that for put my bootloader in sector 63

what the LBA of the first sector in your partition?( 63) for put bootloader
what the LBA of the last sector in your partition ? any thing
How many sectors are in your partition? total 15630336 sectors or here any thing from total no problem
now i need any thing working with my flash memory

Re: partition table

Posted: Thu Feb 25, 2016 5:25 am
by Octocontrabass
swadallail wrote:what the LBA of the first sector in your partition?( 63) for put bootloader
Okay. Convert LBA 63 to CHS. Use 255 heads and 63 sectors per track.
swadallail wrote:what the LBA of the last sector in your partition ? any thing
Okay, let's use LBA 15630335 (the last sector of the disk). Convert LBA 15630335 to CHS. Use 255 heads and 63 sectors per track.
swadallail wrote:How many sectors are in your partition? total 15630336 sectors or here any thing from total no problem
The first sector of the partition is LBA 63. The last sector of the partition is LBA 15630335. How many sectors is that?

Re: partition table

Posted: Thu Feb 25, 2016 6:18 pm
by swadallail
thanks
one question, am i can use fdisk without code mbr