Home | History | Annotate | Download | only in prefix
      1 	.text
      2 	.arch i386
      3 	.code16
      4 	.section ".prefix", "ax", @progbits
      5 	.org 0
      6 
      7 nbi_header:
      8 
      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	entry, 0x07c0	/* Start execution at 0x07c0:entry */
     21 	.size	file_header, . - file_header
     22 
     23 /*****************************************************************************
     24  * NBI segment header
     25  *****************************************************************************
     26  */
     27 segment_header:
     28 	.byte	0x04		/* 16 bytes header, no vendor info */
     29 	.byte	0
     30 	.byte	0
     31 	.byte	0x04		/* Last segment */
     32 	.long	0x00007e00
     33 imglen:	.long	-512
     34 memlen:	.long	-512
     35 	.size	segment_header, . - segment_header
     36 
     37 	.section ".zinfo.fixup", "a", @progbits	/* Compressor fixups */
     38 	.ascii	"ADDL"
     39 	.long	imglen
     40 	.long	1
     41 	.long	0
     42 	.ascii	"ADDL"
     43 	.long	memlen
     44 	.long	1
     45 	.long	0
     46 	.previous
     47 
     48 /*****************************************************************************
     49  * NBI entry point
     50  *****************************************************************************
     51  */
     52 entry:
     53 	/* Install gPXE */
     54 	call	install
     55 
     56 	/* Jump to .text16 segment */
     57 	pushw	%ax
     58 	pushw	$1f
     59 	lret
     60 	.section ".text16", "awx", @progbits
     61 1:
     62 	pushl	$main
     63 	pushw	%cs
     64 	call	prot_call
     65 	popl	%ecx /* discard */
     66 
     67 	/* Uninstall gPXE */
     68 	call	uninstall
     69 
     70 	/* Reboot system */
     71 	int $0x19
     72 
     73 	.previous
     74 	.size	entry, . - entry
     75 
     76 nbi_header_end:
     77 	.org 512
     78