]>
git.saurik.com Git - apple/boot.git/blob - i386/boot1/gonext.c
4fa31aadd04495eb57837e60e348f002b672c65e
2 * Copyright (c) 1999 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@
31 int main(int argc
, char *argv
[])
42 unsigned char *p1
, *p2
, key
;
46 for (i
=1; i
<argc
; i
++)
48 if (!strcmp(argv
[i
],"-dontask")) dontAsk
=1;
49 else if (!strcmp(argv
[i
],"-soft")) softReboot
=1;
54 printf("Do you want to reboot into NEXTSTEP?\n");
55 printf(" (This will immediately terminate all processes!)\n");
57 if (!(key
=='y' || key
=='Y'))
59 printf("Cancelled\n");
64 result
= biosdisk(CMD
,DRIVE
,HEAD
,TRACK
,SECT
,NSECT
,bufold
);
66 { printf("Couldn't read bootsectorread\n");
74 printf("GONEXT can only work if NeXT's BOOT0 bootsector"
82 { p2
= p1
+ (i
*16) + 4;
90 { printf("No NEXTSTEP partition installed\n");
94 /* now do the proper CMOS write! */
97 outportb(0x70,6); /* select */
100 outportb(0x70,6); /* select */
103 if (softReboot
) geninterrupt(0x19);
106 printf("'Scuse me while I kiss the sky!\n");
107 reset
= MK_FP(0xf000,0xfff0);
109 geninterrupt(0x19); /* try again - shouldn't get here */
112 printf("Reboot failed\n");
113 return -1; /* you never get here */