bootexec.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. struct coffsect
  10. {
  11. char name[8];
  12. uint32_t phys;
  13. uint32_t virt;
  14. uint32_t size;
  15. uint32_t fptr;
  16. uint32_t fptrreloc;
  17. uint32_t fptrlineno;
  18. uint32_t nrelocnlineno;
  19. uint32_t flags;
  20. };
  21. /*
  22. * proprietary exec headers, needed to bootstrap various machines
  23. */
  24. struct mipsexec
  25. {
  26. int16_t mmagic; /* (0x160) mips magic number */
  27. int16_t nscns; /* (unused) number of sections */
  28. int32_t timdat; /* (unused) time & date stamp */
  29. int32_t symptr; /* offset to symbol table */
  30. int32_t nsyms; /* size of symbol table */
  31. int16_t opthdr; /* (0x38) sizeof(optional hdr) */
  32. int16_t pcszs; /* flags */
  33. int16_t amagic; /* see above */
  34. int16_t vstamp; /* version stamp */
  35. int32_t tsize; /* text size in bytes */
  36. int32_t dsize; /* initialized data */
  37. int32_t bsize; /* uninitialized data */
  38. int32_t mentry; /* entry pt. */
  39. int32_t text_start; /* base of text used for this file */
  40. int32_t data_start; /* base of data used for this file */
  41. int32_t bss_start; /* base of bss used for this file */
  42. int32_t gprmask; /* general purpose register mask */
  43. union{
  44. int32_t cprmask[4]; /* co-processor register masks */
  45. int32_t pcsize;
  46. };
  47. int32_t gp_value; /* the gp value used for this object */
  48. };
  49. struct mips4kexec
  50. {
  51. struct mipsexec h;
  52. struct coffsect itexts;
  53. struct coffsect idatas;
  54. struct coffsect ibsss;
  55. };
  56. struct sparcexec
  57. {
  58. int16_t sjunk; /* dynamic bit and version number */
  59. int16_t smagic; /* 0407 */
  60. uint32_t stext;
  61. uint32_t sdata;
  62. uint32_t sbss;
  63. uint32_t ssyms;
  64. uint32_t sentry;
  65. uint32_t strsize;
  66. uint32_t sdrsize;
  67. };
  68. struct nextexec
  69. {
  70. struct nexthdr{
  71. uint32_t nmagic;
  72. uint32_t ncputype;
  73. uint32_t ncpusubtype;
  74. uint32_t nfiletype;
  75. uint32_t ncmds;
  76. uint32_t nsizeofcmds;
  77. uint32_t nflags;
  78. };
  79. struct nextcmd{
  80. uint32_t cmd;
  81. uint32_t cmdsize;
  82. uint8_t segname[16];
  83. uint32_t vmaddr;
  84. uint32_t vmsize;
  85. uint32_t fileoff;
  86. uint32_t filesize;
  87. uint32_t maxprot;
  88. uint32_t initprot;
  89. uint32_t nsects;
  90. uint32_t flags;
  91. }textc;
  92. struct nextsect{
  93. char sectname[16];
  94. char segname[16];
  95. uint32_t addr;
  96. uint32_t size;
  97. uint32_t offset;
  98. uint32_t align;
  99. uint32_t reloff;
  100. uint32_t nreloc;
  101. uint32_t flags;
  102. uint32_t reserved1;
  103. uint32_t reserved2;
  104. }texts;
  105. struct nextcmd datac;
  106. struct nextsect datas;
  107. struct nextsect bsss;
  108. struct nextsym{
  109. uint32_t cmd;
  110. uint32_t cmdsize;
  111. uint32_t symoff;
  112. uint32_t nsyms;
  113. uint32_t spoff;
  114. uint32_t pcoff;
  115. }symc;
  116. };
  117. struct i386exec
  118. {
  119. struct i386coff{
  120. uint32_t isectmagic;
  121. uint32_t itime;
  122. uint32_t isyms;
  123. uint32_t insyms;
  124. uint32_t iflags;
  125. };
  126. struct i386hdr{
  127. uint32_t imagic;
  128. uint32_t itextsize;
  129. uint32_t idatasize;
  130. uint32_t ibsssize;
  131. uint32_t ientry;
  132. uint32_t itextstart;
  133. uint32_t idatastart;
  134. };
  135. struct coffsect itexts;
  136. struct coffsect idatas;
  137. struct coffsect ibsss;
  138. struct coffsect icomments;
  139. };