Guest User

Untitled

a guest
Nov 24th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.98 KB | None | 0 0
  1.  
  2. #include <stdint.h>
  3.  
  4. #ifndef __BOOTHEADER__
  5. #define __BOOTHEADER__
  6.  
  7. #define CMDLINE_SIZE                        (0x400)
  8. #define PADDING1_SIZE                       (0x1200-0x610)
  9. #define BOOTSTUBSTACK_SIZE                  (0x1000)
  10.  
  11. typedef struct __attribute__ ((packed)) {
  12.     uint8_t something1[0x30]; /* FIXME figure out what it is */
  13.     uint32_t sectors;         /* number of sectors after the boot sector, 1 sector = 512 bytes */
  14.     uint8_t something2[0x4];  /* FIXME figure out what it is */
  15.     uint8_t oxff[0x180];      /* lots of 0xFF */
  16.     uint8_t zeros[0x46];      /* lots of zeros */
  17.     uint16_t bootSignature;
  18. } bootsector_t;
  19.  
  20. struct bootheader {
  21.     bootsector_t bootsector;
  22.     uint8_t cmdline[CMDLINE_SIZE];
  23.     uint32_t bzImageSize;
  24.     uint32_t initrdSize;
  25.     uint32_t SPIUARTSuppression;
  26.     uint32_t SPIType;
  27.     uint8_t padding1[PADDING1_SIZE];
  28.     uint8_t bootstubStack[BOOTSTUBSTACK_SIZE];
  29. } __attribute__((packed));
  30.  
  31. /* Sanity check for struct size */
  32. typedef char z[(sizeof(struct bootheader) == 0x2200) ? 1 : -1];
  33.  
  34. #endif
Advertisement
Add Comment
Please, Sign In to add comment