You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

undiloader.S 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
  2. .text
  3. .code16
  4. .arch i386
  5. .section ".prefix", "ax", @progbits
  6. /* UNDI loader
  7. *
  8. * Called by an external program to load our PXE stack.
  9. */
  10. .globl undiloader
  11. undiloader:
  12. /* Save registers */
  13. pushl %esi
  14. pushl %edi
  15. pushl %ebp
  16. pushw %ds
  17. pushw %es
  18. pushw %bx
  19. /* ROM segment address to %ds */
  20. pushw %cs
  21. popw %ds
  22. /* UNDI loader parameter structure address into %es:%di */
  23. movw %sp, %bx
  24. movw %ss:22(%bx), %di
  25. movw %ss:24(%bx), %es
  26. /* Install to specified real-mode addresses */
  27. pushw %di
  28. movw %es:12(%di), %bx
  29. movw %es:14(%di), %ax
  30. movl image_source, %esi
  31. movl decompress_to, %edi
  32. orl $0xffffffff, %ebp /* Allow arbitrary relocation */
  33. call install_prealloc
  34. popw %di
  35. /* Call UNDI loader C code */
  36. pushl $pxe_loader_call
  37. pushw %cs
  38. pushw $1f
  39. pushw %ax
  40. pushw $prot_call
  41. lret
  42. 1: popw %bx /* discard */
  43. popw %bx /* discard */
  44. /* Restore registers and return */
  45. popw %bx
  46. popw %es
  47. popw %ds
  48. popl %ebp
  49. popl %edi
  50. popl %esi
  51. lret
  52. .size undiloader, . - undiloader