]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - sys/boot/i386/btx/lib/btxcsu.S
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / sys / boot / i386 / btx / lib / btxcsu.S
1 #
2 # Copyright (c) 1998 Robert Nordier
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms are freely
6 # permitted provided that the above copyright notice and this
7 # paragraph and the following disclaimer are duplicated in all
8 # such forms.
9 #
10 # This software is provided "AS IS" and without any express or
11 # implied warranties, including, without limitation, the implied
12 # warranties of merchantability and fitness for a particular
13 # purpose.
14 #
15
16 # $FreeBSD$
17
18 #include <bootargs.h>
19
20 #
21 # BTX C startup code (ELF).
22 #
23
24 #
25 # Globals.
26 #
27                 .global _start
28 #
29 # Client entry point.
30 #
31 _start:         cld
32                 pushl %eax
33                 movl $_edata,%edi 
34                 movl $_end,%ecx 
35                 subl %edi, %ecx
36                 xorb %al, %al
37                 rep
38                 stosb
39                 popl __base
40                 movl %esp,%eax                  # Set
41                 addl $ARGADJ,%eax               #  argument
42                 movl %eax,__args                #  pointer
43                 call main                       # Invoke client main()
44                 call exit                       # Invoke client exit()
45 #
46 # Data.
47 #
48                 .comm __base,4                  # Client base address
49                 .comm __args,4                  # Client arguments