diff options
| author | Michael Brown | 2007-03-11 01:57:26 +0100 |
|---|---|---|
| committer | Michael Brown | 2007-03-11 01:57:26 +0100 |
| commit | 37127ea90caaf607b610e18a12e69bf47542b52d (patch) | |
| tree | f4cef0becc1439283d311d2013d0fef1ef9d590f /src/arch/i386/prefix | |
| parent | Make _load_size accurately reflect the number of bytes in the actual (diff) | |
| download | ipxe-37127ea90caaf607b610e18a12e69bf47542b52d.tar.gz ipxe-37127ea90caaf607b610e18a12e69bf47542b52d.tar.xz ipxe-37127ea90caaf607b610e18a12e69bf47542b52d.zip | |
Added .nbi as a format.
Diffstat (limited to 'src/arch/i386/prefix')
| -rw-r--r-- | src/arch/i386/prefix/nbiprefix.S | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/arch/i386/prefix/nbiprefix.S b/src/arch/i386/prefix/nbiprefix.S new file mode 100644 index 000000000..79595a2c2 --- /dev/null +++ b/src/arch/i386/prefix/nbiprefix.S @@ -0,0 +1,65 @@ + .text + .arch i386 + .section ".prefix", "ax", @progbits + .section ".prefix.data", "aw", @progbits + .code16 + .section ".prefix" + .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 */ + .word entry, 0x07c0 /* Start execution at 0x07c0:entry */ + .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 + .long _load_size - 512 + .long _load_size - 512 + .size segment_header, . - segment_header + +/***************************************************************************** + * NBI entry point + ***************************************************************************** + */ +entry: + /* Install low and high memory regions */ + call install + + /* Jump to .text16 segment */ + pushw %ax + pushw $1f + lret + .section ".text16", "awx", @progbits +1: + pushl $main + pushw %cs + call prot_call + popl %eax /* discard */ + + /* Reboot system */ + int $0x19 + + .previous + .size entry, . - entry + +nbi_header_end: + .org 512 |
