aboutsummaryrefslogtreecommitdiff
path: root/stand/i386/btx/lib/btxcsu.S
blob: 8de4ffb433007e76c2febcef9bd608ae14b76232 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Copyright (c) 1998 Robert Nordier
# All rights reserved.
#
# Redistribution and use in source and binary forms are freely
# permitted provided that the above copyright notice and this
# paragraph and the following disclaimer are duplicated in all
# such forms.
#
# This software is provided "AS IS" and without any express or
# implied warranties, including, without limitation, the implied
# warranties of merchantability and fitness for a particular
# purpose.
#

#include <bootargs.h>

#
# BTX C startup code (ELF).
#

#
# Globals.
#
		.global _start
#
# Client entry point.
#
_start: 	cld
		pushl %eax
		movl $_edata,%edi 
		movl $_end,%ecx 
		subl %edi, %ecx
		xorb %al, %al
		rep
		stosb
		popl __base
		movl %esp,%eax			# Set
		addl $ARGADJ,%eax		#  argument
		movl %eax,__args		#  pointer
		call main			# Invoke client main()
		call exit			# Invoke client exit()
#
# Data.
#
		.comm __base,4			# Client base address
		.comm __args,4			# Client arguments