freebsd-nq/sys/boot/i386/btx/lib/btxcsu.s
Alexander Kabaev 2939c8a0b9 Move boot2 BSS zeroing into btx startup code out of boot1. boot1 does not
have clear idea on boot2 BSS size and leaves portion of it not zeroed out.
btxcsu.s is in much better position for this job.

Obtained from: DragonflyBSD (with minor adjustments)
2004-08-05 06:00:05 +00:00

52 lines
1016 B
ArmAsm

#
# 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.
#
# $FreeBSD$
#
# BTX C startup code (ELF).
#
#
# Globals.
#
.global _start
#
# Constants.
#
.set ARGADJ,0xfa0 # Argument adjustment
#
# 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