2007-03-11 00:57:26 +00:00
|
|
|
.text
|
|
|
|
|
.arch i386
|
|
|
|
|
.code16
|
[i386] Add explicit flags and type on all .section declarations
Try to avoid future problems caused by implicit section flags and/or
type information by instituting a policy that all .section
declarations must explicitly state the flags and type.
Most of this change was achieved using
perl -pi \
-e 's/".text"$/".text", "ax", \@progbits/ ; ' \
-e 's/".text16"$/".text16", "ax", \@progbits/ ; ' \
-e 's/".text16.null"$/".text16.null", "ax", \@progbits/ ; ' \
-e 's/".text16.data"$/".text16.data", "aw", \@progbits/ ; ' \
-e 's/".data"$/".data", "aw", \@progbits/ ; ' \
-e 's/".data16"$/".data16", "aw", \@progbits/ ; ' \
-e 's/".bss"$/".bss", "aw", \@nobits/ ; ' \
-e 's/".bss16"$/".bss16", "aw", \@nobits/ ; ' \
-e 's/".prefix"$/".prefix", "ax", \@progbits/ ; ' \
-e 's/".prefix.lib"$/".prefix.lib", "awx", \@progbits/ ; ' \
-e 's/".prefix.data"$/".prefix.data", "aw", \@progbits/ ; ' \
-e 's/".weak"$/".weak", "a", \@nobits/ ; ' \
`git grep -l '\.section'`
2009-02-15 10:54:52 +00:00
|
|
|
.section ".prefix", "ax", @progbits
|
2007-03-11 00:57:26 +00:00
|
|
|
.org 0
|
|
|
|
|
|
|
|
|
|
nbi_header:
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
|
* NBI file header
|
|
|
|
|
*****************************************************************************
|
|
|
|
|
*/
|
|
|
|
|
file_header:
|
|
|
|
|
.long 0x1b031336 /* Signature */
|
|
|
|
|
.byte 0x04 /* 16 bytes header, no vendor info */
|
|
|
|
|
.byte 0
|
|
|
|
|
.byte 0
|
|
|
|
|
.byte 0 /* No flags */
|
|
|
|
|
.word 0x0000, 0x07c0 /* Load header to 0x07c0:0x0000 */
|
2011-02-23 21:12:56 +00:00
|
|
|
.word _nbi_start, 0x07c0 /* Start execution at 0x07c0:entry */
|
2007-03-11 00:57:26 +00:00
|
|
|
.size file_header, . - file_header
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
|
* NBI segment header
|
|
|
|
|
*****************************************************************************
|
|
|
|
|
*/
|
|
|
|
|
segment_header:
|
|
|
|
|
.byte 0x04 /* 16 bytes header, no vendor info */
|
|
|
|
|
.byte 0
|
|
|
|
|
.byte 0
|
|
|
|
|
.byte 0x04 /* Last segment */
|
|
|
|
|
.long 0x00007e00
|
2009-08-09 22:12:21 -07:00
|
|
|
imglen: .long -512
|
|
|
|
|
memlen: .long -512
|
2007-03-11 00:57:26 +00:00
|
|
|
.size segment_header, . - segment_header
|
|
|
|
|
|
2008-10-16 20:39:48 -04:00
|
|
|
.section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
|
2009-08-09 22:12:21 -07:00
|
|
|
.ascii "ADDL"
|
2007-07-16 17:17:26 +01:00
|
|
|
.long imglen
|
|
|
|
|
.long 1
|
|
|
|
|
.long 0
|
2009-08-09 22:12:21 -07:00
|
|
|
.ascii "ADDL"
|
2007-07-16 17:17:26 +01:00
|
|
|
.long memlen
|
|
|
|
|
.long 1
|
|
|
|
|
.long 0
|
|
|
|
|
.previous
|
|
|
|
|
|
2007-03-11 00:57:26 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
* NBI entry point
|
|
|
|
|
*****************************************************************************
|
|
|
|
|
*/
|
2011-02-23 21:12:56 +00:00
|
|
|
.globl _nbi_start
|
|
|
|
|
_nbi_start:
|
2010-04-19 20:16:01 +01:00
|
|
|
/* Install iPXE */
|
2007-03-11 00:57:26 +00:00
|
|
|
call install
|
|
|
|
|
|
2013-03-08 13:23:58 +00:00
|
|
|
/* Set up real-mode stack */
|
|
|
|
|
movw %bx, %ss
|
|
|
|
|
movw $_estack16, %sp
|
|
|
|
|
|
2007-03-11 00:57:26 +00:00
|
|
|
/* Jump to .text16 segment */
|
|
|
|
|
pushw %ax
|
|
|
|
|
pushw $1f
|
|
|
|
|
lret
|
|
|
|
|
.section ".text16", "awx", @progbits
|
|
|
|
|
1:
|
|
|
|
|
pushl $main
|
|
|
|
|
pushw %cs
|
|
|
|
|
call prot_call
|
2008-11-18 19:43:13 +00:00
|
|
|
popl %ecx /* discard */
|
|
|
|
|
|
2010-04-19 20:16:01 +01:00
|
|
|
/* Uninstall iPXE */
|
2008-11-18 19:43:13 +00:00
|
|
|
call uninstall
|
2007-03-11 00:57:26 +00:00
|
|
|
|
|
|
|
|
/* Reboot system */
|
|
|
|
|
int $0x19
|
|
|
|
|
|
|
|
|
|
.previous
|
2011-03-16 15:44:33 +01:00
|
|
|
.size _nbi_start, . - _nbi_start
|
2007-03-11 00:57:26 +00:00
|
|
|
|
|
|
|
|
nbi_header_end:
|
|
|
|
|
.org 512
|