199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Copyright (c) 1998 Robert Nordier
199767f8919635c4928607450d9e0abb932109ceToomas Soome# All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Redistribution and use in source and binary forms are freely
199767f8919635c4928607450d9e0abb932109ceToomas Soome# permitted provided that the above copyright notice and this
199767f8919635c4928607450d9e0abb932109ceToomas Soome# paragraph and the following disclaimer are duplicated in all
199767f8919635c4928607450d9e0abb932109ceToomas Soome# such forms.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# This software is provided "AS IS" and without any express or
199767f8919635c4928607450d9e0abb932109ceToomas Soome# implied warranties, including, without limitation, the implied
199767f8919635c4928607450d9e0abb932109ceToomas Soome# warranties of merchantability and fitness for a particular
199767f8919635c4928607450d9e0abb932109ceToomas Soome# purpose.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome# $FreeBSD$
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <bootargs.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# BTX C startup code (ELF).
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Globals.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome .global _start
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Client entry point.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome_start: cld
199767f8919635c4928607450d9e0abb932109ceToomas Soome pushl %eax
199767f8919635c4928607450d9e0abb932109ceToomas Soome movl $_edata,%edi
199767f8919635c4928607450d9e0abb932109ceToomas Soome movl $_end,%ecx
199767f8919635c4928607450d9e0abb932109ceToomas Soome subl %edi, %ecx
199767f8919635c4928607450d9e0abb932109ceToomas Soome xorb %al, %al
199767f8919635c4928607450d9e0abb932109ceToomas Soome rep
199767f8919635c4928607450d9e0abb932109ceToomas Soome stosb
199767f8919635c4928607450d9e0abb932109ceToomas Soome popl __base
199767f8919635c4928607450d9e0abb932109ceToomas Soome movl %esp,%eax # Set
199767f8919635c4928607450d9e0abb932109ceToomas Soome addl $ARGADJ,%eax # argument
199767f8919635c4928607450d9e0abb932109ceToomas Soome movl %eax,__args # pointer
199767f8919635c4928607450d9e0abb932109ceToomas Soome call main # Invoke client main()
199767f8919635c4928607450d9e0abb932109ceToomas Soome call exit # Invoke client exit()
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Data.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome .comm __base,4 # Client base address
199767f8919635c4928607450d9e0abb932109ceToomas Soome .comm __args,4 # Client arguments