2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id: boot.c 21768 2004-06-17 21:59:56Z hkiel $
5 Desc: Boot your operating system.
9 #include <exec/types.h>
10 #include <exec/alerts.h>
11 #include <exec/libraries.h>
12 #include <exec/devices.h>
13 #include <exec/execbase.h>
14 #include <aros/libcall.h>
15 #include <aros/asmcall.h>
16 #include <dos/dosextens.h>
17 #include <dos/filesystem.h>
18 #include <libraries/expansionbase.h>
19 #include <utility/tagitem.h>
20 #include <aros/debug.h>
22 #include <proto/exec.h>
23 #include <proto/dos.h>
25 void boot(struct ExecBase
*SysBase
, BOOL hidds_ok
)
27 LONG rc
= RETURN_FAIL
;
30 /* We have been created as a process by DOS, we should now
31 try and boot the system. */
33 struct DosLibrary
*DOSBase
;
35 DOSBase
= (struct DosLibrary
*)OpenLibrary("dos.library", 0);
38 /* BootStrap couldn't open dos.library */
39 Alert(AT_DeadEnd
| AN_BootStrap
| AG_OpenLib
| AO_DOSLib
);
43 cis
= Open("CON:20/20///Boot Shell/AUTO", FMF_READ
);
45 kprintf("Failed to load system HIDDs\n");
48 struct ExpansionBase
*ExpansionBase
;
52 struct TagItem tags
[] =
54 { SYS_Asynch
, TRUE
}, /* 0 */
55 { SYS_Background
, FALSE
}, /* 1 */
56 { SYS_Input
, (IPTR
)cis
}, /* 2 */
57 { SYS_Output
, (IPTR
)NULL
}, /* 3 */
58 { SYS_Error
, (IPTR
)NULL
}, /* 4 */
59 { SYS_ScriptInput
, (IPTR
)NULL
}, /* 5 */
63 if ((ExpansionBase
= (struct ExpansionBase
*)OpenLibrary("expansion.library", 0)) != NULL
)
65 opensseq
= !(ExpansionBase
->Flags
& EBF_DOSFLAG
);
66 CloseLibrary(ExpansionBase
);
69 D(bug("[SubMain] Open Startup Sequence = %d\n", opensseq
));
73 sseq
= Open("S:Startup-Sequence", FMF_READ
);
74 tags
[5].ti_Data
= (IPTR
)sseq
;
77 rc
= SystemTagList("", tags
);
88 kprintf("Cannot open boot console\n");
90 /* We get here when the Boot Shell Window is left with EndShell/EndCli.
91 There's no RemTask() here, otherwise the process cleanup routines
92 are not called. And that would for example mean, that the
93 Boot Process (having a CLI) is not removed from the rootnode.
94 --> Dead stuff in there -> Crash