]>
git.saurik.com Git - apple/boot.git/blob - i386/boot1u/boot.c
69859b29a8b6126b3ea49ae78eb7f14f3d3df5ec
2 * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
27 #include <libsa/memory.h>
28 #include <saio_types.h>
29 #include <saio_internal.h>
37 #include <io_inline.h>
41 //#define BOOT_FILE "/foo"
42 #define BOOT_FILE "/usr/standalone/i386/boot"
45 //==========================================================================
50 extern char _DATA__bss__begin
, _DATA__bss__end
;
51 extern char _DATA__common__begin
, _DATA__common__end
;
53 bzero( &_DATA__bss__begin
,
54 (&_DATA__bss__end
- &_DATA__bss__begin
) );
56 bzero( &_DATA__common__begin
,
57 (&_DATA__common__end
- &_DATA__common__begin
) );
62 extern char chainbootdev
;
64 void boot(int biosdev
, void *partPtr
)
66 struct fdisk_part part
;
71 // printf("Hello, world.\n");
73 // Enable A20 gate before accessing memory above 1Mb.
76 biosdev
= biosdev
& 0xFF;
77 chainbootdev
= biosdev
;
79 /* Don't believe the passed-in partition table */
80 cc
= findUFSPartition(biosdev
, &part
);
82 printf("No UFS partition\n");
86 initUFSBVRef(&bv
, biosdev
, &part
);
88 gFSLoadAddress
= (void *)BOOT2_ADDR
;
89 cc
= UFSLoadFile(&bv
, BOOT_FILE
);
91 printf("Could not load" BOOT_FILE
"\n");
94 // Return to execute booter