[U-Boot-Users] Little endian
Leon KUKOVEC
leon.kukovec at ultra.si
Fri Nov 28 10:08:31 CET 2003
Hello Ed,
On Thu, 27 Nov 2003, Ed Okerson wrote:
> What partition types are you using? I am trying to do a partition table
> with some linux and at least one FAT16 partition, but even without the FAT
> partition the system was showing a single partition as:
I have setup two partitions using fdisk on target. fdisk however shows some
warnings, but I suspect this is a bug in busybox's fdisk (I might be wrong).
Here's what I get:
------------ paste --------------
# fdisk /dev/discs/disc0/disc
/dev/ide/host0/bus0/target0/lun0: p1 p2
Command (m for help): p
Disk /dev/discs/disc0/disc: 128 MB, 128450560 bytes
8 heads, 32 sectors/track, 980 cylinders
Units = cylinders of 256 * 512 = 131072 bytes
Device Boot Start End Blocks Id System
/dev/discs/disc0/part1 1 77 9840 c Win95 FAT32
(LBA)
/dev/discs/disc0/part2 78 980 115584 83 Linux
/dev/discs/disc0/part3 1 1 0 0 Empty
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(0, 0, 0) logical=(0, 0, 1)
Partition 3 has different physical/logical endings:
phys=(0, 0, 0) logical=(16777215, 7, 32)
Partition 3 does not end on cylinder boundary.
Command (m for help):
--------- end of paste -----------
First partition is VFAT (primary), second is Linux(primary). I have not
tested extended partitions since I did not find any reason for having
them - currently.
However U-Boot ide part shows two partitions:
------------ paste --------------
WEP> ide reset
Reset IDE: SanDisk SDP 5/3 0.6
Fixed Disk Card
IDE interface
[silicon] [unique] [single] [sleep] [standby] [idle] [low power]
Bus 0: OK
Device 0: Model: SanDisk SDCFB-128 Firm: Vdg 1.25 Ser#: 1181701L00X20512
Type: Removable Hard Disk
Capacity: 122.5 MB = 0.1 GB (250880 x 512)
WEP> ide part
Partition Map for IDE device 0 -- Partition Type: DOS
Partition Start Sector Num Sectors Type
1 32 19680 c
2 19712 231168 83
WEP>
--------- end of paste -----------
I have not investigated which one is wrong/correct because I can access
primary - VFAT - partition on both systems and also on a PC. After I finish
VFAT write support in U-Boot, I might go and see which "fdisk" is wrong or
correct.
> So this morning I started going through and figuring exactly what that
> meant. It appears that the first line shows up if the boot sector of the
> compact flash card has a DOS boot signature that is what you get. So
> apparently some idiot (probably me) at some point in time formated that CF
> card in a DOS machine with the /s option and it happily copied a DOS boot
> record into the beginning of the card. Boy do I feel stupid. So I popped
> the CF into a linux machine and typed "cat /dev/zero > /dev/hdg" re-ran
> fdisk to create my partitions, and now u-boot happily reports:
>
> DbAu1x00 # ide part
>
> Partition Map for IDE device 0 -- Partition Type: DOS
>
> Partition Start Sector Num Sectors Type
> 1 32 4576 83
> 2 4608 4608 83
> 3 9216 492544 83
> DbAu1x00 #
>
> Which is what I wanted. I have been using #if defined(CONFIG_AU1X00)
> around my code mods, but it sounds like your changes and my changes are
> about the same in the end, so perhaps we should come up with another
> define for ENDIAN_CHALLENGED or something.
I think we should stick to defines that are already used. The endian issues
should be wraped with __LITTLE_ENDIAN or __BIG_ENDIAN, specific board issues
with CONFIG_AU1X00 or CONFIG_WEPEP250 in my case. I have already submitted
the patch for PCMCIA on PXA and that patch fixes the issues with
Firmware Revision, Model Number and lba_capacity wrapped with endian #ifdef.
When Wolfgang gets some time for U-Boot and examines the patch and hopefully
applies it, you will be able to distinguish between "common" patch and your
board specific one.
> It helped a lot. Thanks. I guess the moral of the story is when you are
> having problems, make sure there isn't a short between the keyboard and
> the chair first. :)
Keep up the good work!
--
Best Regards,
Leon.
More information about the U-Boot
mailing list