1# Copyright (c) KATO Takenori, 1999, 2000, 2007.
2#
3# All rights reserved.  Unpublished rights reserved under the copyright
4# laws of Japan.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9#
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer as
12#    the first lines of this file unmodified.
13# 2. Redistributions in binary form must reproduce the above copyright
14#    notice, this list of conditions and the following disclaimer in the
15#    documentation and/or other materials provided with the distribution.
16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28# $FreeBSD: stable/11/stand/pc98/boot0.5/start.s 168457 2007-04-07 08:37:04Z kato $
29#
30	.global	start
31	.code16
32
33	.text
34start:
35	jmp	start1
36
37	# Magic
38	.org	0x053, 0x20
39	.byte	0x4e, 0x45, 0x43
40
41	.org	0x8f
42	.byte	0x32, 0x2e, 0x37, 0x30
43
44	.org	0x2d4
45start1:
46	# The instruction 'call 0x9ab' can be here.  See also selector.s.
47	nop
48	nop
49	nop
50	cli
51	movw	%cs, %ax
52	movw	%ax, %ds
53	movw	%ss, iniss
54	movw	%sp, inisp
55	movw	%ax, %ss
56	movw	$0xfffe, %sp
57	sti
58	xorw	%ax, %ax
59	movw	%ax, %es
60	call	main
61
62	cli
63	movw	%cs:iniss, %ss
64	movw	%cs:inisp, %sp
65	sti
66	int	$0x1e
67	# NOTREACHED
68	lret
69
70	.data
71	.global	iniss, inisp
72iniss:	.word	0
73inisp:	.word	0
74