]> git.saurik.com Git - apple/boot.git/blame - i386/tests/bootHelper.c
boot-80.1.tar.gz
[apple/boot.git] / i386 / tests / bootHelper.c
CommitLineData
14c7c974
A
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
12 * this file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
20 * under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24/* Boot helper */
25
26#import <mach-o/loader.h>
27
28sa_rld(
29char *basefile_name, // base file name
30struct mach_header *basefile_addr, // mach header of the base file
31
32char *object_name, // name of the object to load
33char *object_addr, // addr of the object in memory to load
34unsigned long object_size, // size of the object in memory to load
35
36char *workmem_addr, // address of working memory
37unsigned long *workmem_size, // size of working memory (in/out)
38
39char *error_buf_addr, // address of error message buffer
40unsigned long error_buf_size, // size of error message buffer
41
42char *malloc_addr, // address to use for initializing malloc
43unsigned long malloc_len // length to use for same
44)
45{
46 static int firstTime = 0;
47 char helloString[] = "BootHelper here!";
48
49 sprintf(error_buf_addr, "OK, here I am.\n");
50 error_buf_addr += strlen(error_buf_addr);
51 if (firstTime == 0) {
52 //zinit(malloc_addr, malloc_len);
53 bzero(malloc_addr, malloc_len);
54 firstTime = 1;
55 sprintf(error_buf_addr, "I initialized the malloc arena.\n");
56 error_buf_addr += strlen(error_buf_addr);
57 }
58}