]>
git.saurik.com Git - apple/boot.git/blob - i386/tests/bootHelper.c
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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
22 * @APPLE_LICENSE_HEADER_END@
26 #import <mach-o/loader.h>
29 char *basefile_name
, // base file name
30 struct mach_header
*basefile_addr
, // mach header of the base file
32 char *object_name
, // name of the object to load
33 char *object_addr
, // addr of the object in memory to load
34 unsigned long object_size
, // size of the object in memory to load
36 char *workmem_addr
, // address of working memory
37 unsigned long *workmem_size
, // size of working memory (in/out)
39 char *error_buf_addr
, // address of error message buffer
40 unsigned long error_buf_size
, // size of error message buffer
42 char *malloc_addr
, // address to use for initializing malloc
43 unsigned long malloc_len
// length to use for same
46 static int firstTime
= 0;
47 char helloString
[] = "BootHelper here!";
49 sprintf(error_buf_addr
, "OK, here I am.\n");
50 error_buf_addr
+= strlen(error_buf_addr
);
52 //zinit(malloc_addr, malloc_len);
53 bzero(malloc_addr
, malloc_len
);
55 sprintf(error_buf_addr
, "I initialized the malloc arena.\n");
56 error_buf_addr
+= strlen(error_buf_addr
);