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#include <bootargs.h> 17 18# 19# BTX C startup code (ELF). 20# 21 22# 23# Globals. 24# 25 .global _start 26# 27# Client entry point. 28# 29_start: cld 30 pushl %eax 31 movl $_edata,%edi 32 movl $_end,%ecx 33 subl %edi, %ecx 34 xorb %al, %al 35 rep 36 stosb 37 popl __base 38 movl %esp,%eax # Set 39 addl $ARGADJ,%eax # argument 40 movl %eax,__args # pointer 41 call main # Invoke client main() 42 call exit # Invoke client exit() 43# 44# Data. 45# 46 .comm __base,4 # Client base address 47 .comm __args,4 # Client arguments 48