17c478bd9Sstevel@tonic-gate/*
27c478bd9Sstevel@tonic-gate *  GRUB  --  GRand Unified Bootloader
37c478bd9Sstevel@tonic-gate *  Copyright (C) 2000   Free Software Foundation, Inc.
47c478bd9Sstevel@tonic-gate *
57c478bd9Sstevel@tonic-gate *  This program is free software; you can redistribute it and/or modify
67c478bd9Sstevel@tonic-gate *  it under the terms of the GNU General Public License as published by
77c478bd9Sstevel@tonic-gate *  the Free Software Foundation; either version 2 of the License, or
87c478bd9Sstevel@tonic-gate *  (at your option) any later version.
97c478bd9Sstevel@tonic-gate *
107c478bd9Sstevel@tonic-gate *  This program is distributed in the hope that it will be useful,
117c478bd9Sstevel@tonic-gate *  but WITHOUT ANY WARRANTY; without even the implied warranty of
127c478bd9Sstevel@tonic-gate *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
137c478bd9Sstevel@tonic-gate *  GNU General Public License for more details.
147c478bd9Sstevel@tonic-gate *
157c478bd9Sstevel@tonic-gate *  You should have received a copy of the GNU General Public License
167c478bd9Sstevel@tonic-gate *  along with this program; if not, write to the Free Software
177c478bd9Sstevel@tonic-gate *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
187c478bd9Sstevel@tonic-gate */
197c478bd9Sstevel@tonic-gate
207c478bd9Sstevel@tonic-gate	.file	"pxeloader.S"
217c478bd9Sstevel@tonic-gate	.text
227c478bd9Sstevel@tonic-gate
237c478bd9Sstevel@tonic-gate	/* Start with the prehistoric environment... */
247c478bd9Sstevel@tonic-gate	.code16
257c478bd9Sstevel@tonic-gate
267c478bd9Sstevel@tonic-gate	/* Let's go */
277c478bd9Sstevel@tonic-gate.globl _start; _start:
2899ed6083Sszhou	movw	%sp, %bp
2999ed6083Sszhou	movw	%ss:4(%bp), %ax
3099ed6083Sszhou	pushw	%ax
3199ed6083Sszhou	movw	%ss:6(%bp), %ax
3299ed6083Sszhou	pushw	%ax
3399ed6083Sszhou	call	1f
3499ed6083Sszhou1:	popw	%bx
3599ed6083Sszhou
3699ed6083Sszhou	/* Save !PXE address */
3799ed6083Sszhou	popw	%ax
3899ed6083Sszhou	movw	%ax, %cs:(pxeseg-1b)(%bx)
3999ed6083Sszhou	popw	%ax
4099ed6083Sszhou	movw	%ax, %cs:(pxeoff-1b)(%bx)
4199ed6083Sszhou	movw	%ax, %bx
427c478bd9Sstevel@tonic-gate
437c478bd9Sstevel@tonic-gate	/* Jump to the real world */
447c478bd9Sstevel@tonic-gate	ljmp	$0, $0x8200
457c478bd9Sstevel@tonic-gate
4699ed6083Sszhou	. = _start + 0x7C80 - 0x7C00
4799ed6083Sszhoupxeseg:	.word	0
4899ed6083Sszhoupxeoff:	.word	0
4999ed6083Sszhou
507c478bd9Sstevel@tonic-gate	/* This region is a junk. Do you say that this is wasteful?
517c478bd9Sstevel@tonic-gate	   But I like that the memory layout of the body is consistent
527c478bd9Sstevel@tonic-gate	   among different stage2s rather than scamping just for 1.5KB. */
537c478bd9Sstevel@tonic-gate	. = _start + 0x8200 - 0x7C00 - 1
547c478bd9Sstevel@tonic-gate	.byte	0
55