浏览代码

.lilo and derived targets (e.g. .iso) now load properly.

tags/v0.9.3
Michael Brown 18 年前
父节点
当前提交
b04b0ddc31
共有 1 个文件被更改,包括 29 次插入23 次删除
  1. 29
    23
      src/arch/i386/prefix/liloprefix.S

+ 29
- 23
src/arch/i386/prefix/liloprefix.S 查看文件

50
 	.arch i386
50
 	.arch i386
51
 	.org	0
51
 	.org	0
52
 	.section ".prefix", "ax", @progbits
52
 	.section ".prefix", "ax", @progbits
53
-_prefix:
54
-
55
 /* 
53
 /* 
56
 	This is a minimal boot sector.	If anyone tries to execute it (e.g., if
54
 	This is a minimal boot sector.	If anyone tries to execute it (e.g., if
57
 	a .lilo file is dd'ed to a floppy), print an error message. 
55
 	a .lilo file is dd'ed to a floppy), print an error message. 
58
 */
56
 */
59
 
57
 
60
 bootsector: 
58
 bootsector: 
61
-	jmp	$BOOTSEG, $go - _prefix	/* reload cs:ip to match relocation addr */
62
-go: 
59
+	jmp	$BOOTSEG, $1f	/* reload cs:ip to match relocation addr */
60
+1:
63
 	movw	$0x2000, %di		/*  0x2000 is arbitrary value >= length
61
 	movw	$0x2000, %di		/*  0x2000 is arbitrary value >= length
64
 					    of bootsect + room for stack */
62
 					    of bootsect + room for stack */
65
 
63
 
73
 	sti
71
 	sti
74
 
72
 
75
 	movw	$why_end-why, %cx
73
 	movw	$why_end-why, %cx
76
-	movw	$why - _prefix, %si
74
+	movw	$why, %si
77
 
75
 
78
 	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
76
 	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
79
 	movb	$0x0e, %ah		/* write char, tty mode */
77
 	movb	$0x0e, %ah		/* write char, tty mode */
93
 root_flags: 
91
 root_flags: 
94
 	.word	0
92
 	.word	0
95
 syssize: 
93
 syssize: 
96
-	.word	_verbatim_size_pgh - PREFIXPGH
94
+	.word	_load_size_pgh - PREFIXPGH
97
 swap_dev: 
95
 swap_dev: 
98
 	.word	0
96
 	.word	0
99
 ram_size: 
97
 ram_size: 
105
 boot_flag: 
103
 boot_flag: 
106
 	.word	0xAA55
104
 	.word	0xAA55
107
 
105
 
106
+
107
+	.org	512
108
 /*
108
 /*
109
 	We're now at the beginning of the second sector of the image -
109
 	We're now at the beginning of the second sector of the image -
110
 	where the setup code goes.
110
 	where the setup code goes.
115
 	executing the Etherboot image that's loaded at SYSSEG:0 and
115
 	executing the Etherboot image that's loaded at SYSSEG:0 and
116
 	whose entry point is SYSSEG:0.
116
 	whose entry point is SYSSEG:0.
117
 */
117
 */
118
-setup_code: 
119
-	pushl	$0		/* No parameters to preserve for exit path */
120
-	pushw	$0		/* Use prefix exit path mechanism */
118
+setup_code:
121
 	/* Etherboot expects to be contiguous in memory once loaded.
119
 	/* Etherboot expects to be contiguous in memory once loaded.
122
 	 * LILO doesn't do this, but since we don't need any
120
 	 * LILO doesn't do this, but since we don't need any
123
 	 * information that's left in the prefix, it doesn't matter:
121
 	 * information that's left in the prefix, it doesn't matter:
124
 	 * we just have to ensure that %cs:0000 is where the start of
122
 	 * we just have to ensure that %cs:0000 is where the start of
125
 	 * the Etherboot image *would* be.
123
 	 * the Etherboot image *would* be.
126
 	 */
124
 	 */
127
-	ljmp	$(SYSSEG-(PREFIXSIZE/16)), $_start
128
-
129
-	.section ".text16", "ax", @progbits
130
-prefix_exit:
131
-	int	$0x19		/* should try to boot machine */
132
-prefix_exit_end:
133
-	.previous
134
-	
135
-	.org	(PREFIXSIZE-1)
136
-	.byte	0
137
-prefix_end:
138
-/*
139
-	That's about it.
140
-*/
125
+	ljmp	$(SYSSEG-(PREFIXSIZE/16)), $run_etherboot
126
+
141
 
127
 
128
+	.org	PREFIXSIZE
129
+/*
130
+	We're now at the beginning of the kernel proper.
131
+ */
132
+run_etherboot:
133
+	call	install
134
+
135
+	/* Jump to .text16 segment */
136
+	pushw	%ax
137
+	pushw	$1f
138
+	lret
139
+	.section ".text16", "awx", @progbits
140
+1:
141
+	pushl	$main
142
+	pushw	%cs
143
+	call	prot_call
144
+	popl	%eax /* discard */
145
+
146
+	/* Boot next device */
147
+	int $0x18

正在加载...
取消
保存