Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

nbiprefix.S 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
  2. #include <librm.h>
  3. .text
  4. .arch i386
  5. .code16
  6. .section ".prefix", "ax", @progbits
  7. .org 0
  8. nbi_header:
  9. /*****************************************************************************
  10. * NBI file header
  11. *****************************************************************************
  12. */
  13. file_header:
  14. .long 0x1b031336 /* Signature */
  15. .byte 0x04 /* 16 bytes header, no vendor info */
  16. .byte 0
  17. .byte 0
  18. .byte 0 /* No flags */
  19. .word 0x0000, 0x07c0 /* Load header to 0x07c0:0x0000 */
  20. .word _nbi_start, 0x07c0 /* Start execution at 0x07c0:entry */
  21. .size file_header, . - file_header
  22. /*****************************************************************************
  23. * NBI segment header
  24. *****************************************************************************
  25. */
  26. segment_header:
  27. .byte 0x04 /* 16 bytes header, no vendor info */
  28. .byte 0
  29. .byte 0
  30. .byte 0x04 /* Last segment */
  31. .long 0x00007e00
  32. imglen: .long -512
  33. memlen: .long -512
  34. .size segment_header, . - segment_header
  35. .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
  36. .ascii "ADDL"
  37. .long imglen
  38. .long 1
  39. .long 0
  40. .ascii "ADDL"
  41. .long memlen
  42. .long 1
  43. .long 0
  44. .previous
  45. /*****************************************************************************
  46. * NBI entry point
  47. *****************************************************************************
  48. */
  49. .globl _nbi_start
  50. _nbi_start:
  51. /* Install iPXE */
  52. call install
  53. /* Set up real-mode stack */
  54. movw %bx, %ss
  55. movw $_estack16, %sp
  56. /* Jump to .text16 segment */
  57. pushw %ax
  58. pushw $1f
  59. lret
  60. .section ".text16", "awx", @progbits
  61. 1:
  62. /* Run iPXE */
  63. virtcall main
  64. /* Uninstall iPXE */
  65. call uninstall
  66. /* Reboot system */
  67. int $0x19
  68. .previous
  69. .size _nbi_start, . - _nbi_start
  70. nbi_header_end:
  71. .org 512