Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Can andyone solve this program problem?

2006-05-02 by Dave Hylands

> typedef struct _tagMBR {
>
>              uint8_t bootcode[0x1be];              // boot sector
>
>              PTINFO ptable[4];                         // four partition table structures
>
>              uint8_t sig_55;                               // 0x55 signature byte
>
>              uint8_t sig_aa;                               // 0xaa signature byte
>
> } MBR, *PMBR;

It's probably a packing issue.

Structures are generally aligned on 32 bit boundaries, so you'll
probably find 2 bytes of pad are being inserted between bootcode and
ptable.

You'll need to use the appropriate directoves for your compiler to
select 8-bit or 16-bit packing.


--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.