mknote.c 896 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (C) Cort Dougan 1999.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. *
  9. * Generate a note section as per the CHRP specification.
  10. *
  11. */
  12. #include <stdio.h>
  13. #include <string.h>
  14. #define PL(x) printf("%c%c%c%c", ((x)>>24)&0xff, ((x)>>16)&0xff, ((x)>>8)&0xff, (x)&0xff );
  15. int main(void)
  16. {
  17. /* header */
  18. /* namesz */
  19. PL(strlen("PowerPC")+1);
  20. /* descrsz */
  21. PL(6*4);
  22. /* type */
  23. PL(0x1275);
  24. /* name */
  25. printf("PowerPC"); printf("%c", 0);
  26. /* descriptor */
  27. /* real-mode */
  28. PL(0xffffffff);
  29. /* real-base */
  30. PL(0x00c00000);
  31. /* real-size */
  32. PL(0xffffffff);
  33. /* virt-base */
  34. PL(0xffffffff);
  35. /* virt-size */
  36. PL(0xffffffff);
  37. /* load-base */
  38. PL(0x4000);
  39. return 0;
  40. }