120253Sjoerg#
220302Sjoerg# Copyright (c) 1998 Robert Nordier
320302Sjoerg# All rights reserved.
420253Sjoerg#
520253Sjoerg# Redistribution and use in source and binary forms are freely
620253Sjoerg# permitted provided that the above copyright notice and this
720253Sjoerg# paragraph and the following disclaimer are duplicated in all
820253Sjoerg# such forms.
920302Sjoerg#
1020253Sjoerg# This software is provided "AS IS" and without any express or
1120253Sjoerg# implied warranties, including, without limitation, the implied
1220253Sjoerg# warranties of merchantability and fitness for a particular
1320253Sjoerg# purpose.
1420302Sjoerg#
1520253Sjoerg
1620253Sjoerg# $FreeBSD$
1720302Sjoerg
1820253Sjoerg#include <bootargs.h>
1920253Sjoerg
2020253Sjoerg#
2120253Sjoerg# BTX C startup code (ELF).
2220253Sjoerg#
2320253Sjoerg
2420253Sjoerg#
2520253Sjoerg# Globals.
2620302Sjoerg#
2720253Sjoerg		.global _start
2820253Sjoerg#
2920253Sjoerg# Client entry point.
3020253Sjoerg#
3120253Sjoerg_start: 	cld
3220253Sjoerg		pushl %eax
3320253Sjoerg		movl $_edata,%edi
3420253Sjoerg		movl $_end,%ecx
3520253Sjoerg		subl %edi, %ecx
3620253Sjoerg		xorb %al, %al
3720253Sjoerg		rep
3820253Sjoerg		stosb
3920253Sjoerg		popl __base
4020253Sjoerg		movl %esp,%eax			# Set
4120253Sjoerg		addl $ARGADJ,%eax		#  argument
4220253Sjoerg		movl %eax,__args		#  pointer
4320253Sjoerg		call main			# Invoke client main()
4420253Sjoerg		call exit			# Invoke client exit()
4520253Sjoerg#
4620253Sjoerg# Data.
4720253Sjoerg#
4820253Sjoerg		.comm __base,4			# Client base address
4920253Sjoerg		.comm __args,4			# Client arguments
5020253Sjoerg