148907Srnordier# 248907Srnordier# Copyright (c) 1999 Global Technology Associates, Inc. 348907Srnordier# All rights reserved. 448907Srnordier# 548907Srnordier# Redistribution and use in source and binary forms, with or without 648907Srnordier# modification, are permitted provided that the following conditions 748907Srnordier# are met: 848907Srnordier# 1. Redistributions of source code must retain the above copyright 948907Srnordier# notice, this list of conditions and the following disclaimer. 1048907Srnordier# 2. Redistributions in binary form must reproduce the above copyright 1148907Srnordier# notice, this list of conditions and the following disclaimer in the 1248907Srnordier# documentation and/or other materials provided with the distribution. 1348907Srnordier# 1448907Srnordier# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND 1548907Srnordier# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1648907Srnordier# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 1748907Srnordier# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 1848907Srnordier# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 1948907Srnordier# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 2048907Srnordier# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 2148907Srnordier# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 2248907Srnordier# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 2348907Srnordier# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 2448907Srnordier# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2548907Srnordier# 2650477Speter# $FreeBSD$ 2748907Srnordier# 2848907Srnordier 2948907Srnordier .set entry,0x10 # kgz.entry 3048907Srnordier 3148907Srnordier .globl _start 3248907Srnordier 3348907Srnordier# C startup code for kgzldr. 3448907Srnordier 3548907Srnordier_start: cld # String ops inc 3648907Srnordier movl $_edata,%edi # Start of bss 3748907Srnordier movl $_end,%ecx # Compute 3848907Srnordier subl %edi,%ecx # size 3948907Srnordier xorl %eax,%eax # Zero 4048907Srnordier rep # Clear 4148907Srnordier stosb # bss 4248907Srnordier pushl 0x4(%esp) # Pass howto flags 43103436Speter call boot # Call C code 4448907Srnordier popl %ecx # Clear stack 45103436Speter jmp *kgz+entry # To loaded code 46