|
@@ -0,0 +1,65 @@
|
|
1
|
+ .text
|
|
2
|
+ .arch i386
|
|
3
|
+ .section ".prefix", "ax", @progbits
|
|
4
|
+ .section ".prefix.data", "aw", @progbits
|
|
5
|
+ .code16
|
|
6
|
+ .section ".prefix"
|
|
7
|
+ .org 0
|
|
8
|
+
|
|
9
|
+nbi_header:
|
|
10
|
+
|
|
11
|
+/*****************************************************************************
|
|
12
|
+ * NBI file header
|
|
13
|
+ *****************************************************************************
|
|
14
|
+ */
|
|
15
|
+file_header:
|
|
16
|
+ .long 0x1b031336 /* Signature */
|
|
17
|
+ .byte 0x04 /* 16 bytes header, no vendor info */
|
|
18
|
+ .byte 0
|
|
19
|
+ .byte 0
|
|
20
|
+ .byte 0 /* No flags */
|
|
21
|
+ .word 0x0000, 0x07c0 /* Load header to 0x07c0:0x0000 */
|
|
22
|
+ .word entry, 0x07c0 /* Start execution at 0x07c0:entry */
|
|
23
|
+ .size file_header, . - file_header
|
|
24
|
+
|
|
25
|
+/*****************************************************************************
|
|
26
|
+ * NBI segment header
|
|
27
|
+ *****************************************************************************
|
|
28
|
+ */
|
|
29
|
+segment_header:
|
|
30
|
+ .byte 0x04 /* 16 bytes header, no vendor info */
|
|
31
|
+ .byte 0
|
|
32
|
+ .byte 0
|
|
33
|
+ .byte 0x04 /* Last segment */
|
|
34
|
+ .long 0x00007e00
|
|
35
|
+ .long _load_size - 512
|
|
36
|
+ .long _load_size - 512
|
|
37
|
+ .size segment_header, . - segment_header
|
|
38
|
+
|
|
39
|
+/*****************************************************************************
|
|
40
|
+ * NBI entry point
|
|
41
|
+ *****************************************************************************
|
|
42
|
+ */
|
|
43
|
+entry:
|
|
44
|
+ /* Install low and high memory regions */
|
|
45
|
+ call install
|
|
46
|
+
|
|
47
|
+ /* Jump to .text16 segment */
|
|
48
|
+ pushw %ax
|
|
49
|
+ pushw $1f
|
|
50
|
+ lret
|
|
51
|
+ .section ".text16", "awx", @progbits
|
|
52
|
+1:
|
|
53
|
+ pushl $main
|
|
54
|
+ pushw %cs
|
|
55
|
+ call prot_call
|
|
56
|
+ popl %eax /* discard */
|
|
57
|
+
|
|
58
|
+ /* Reboot system */
|
|
59
|
+ int $0x19
|
|
60
|
+
|
|
61
|
+ .previous
|
|
62
|
+ .size entry, . - entry
|
|
63
|
+
|
|
64
|
+nbi_header_end:
|
|
65
|
+ .org 512
|