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.
10 #include <aros/debug.h>
12 #include <exec/types.h>
13 #include <exec/alerts.h>
14 #include <exec/libraries.h>
15 #include <exec/devices.h>
16 #include <exec/execbase.h>
17 #include <aros/libcall.h>
18 #include <aros/asmcall.h>
19 #include <dos/dosextens.h>
20 #include <dos/filesystem.h>
21 #include <libraries/expansionbase.h>
22 #include <utility/tagitem.h>
24 #include <proto/exec.h>
25 #include <proto/dos.h>
27 void __dosboot_Boot(struct ExecBase
*SysBase
, BOOL hidds_ok
)
29 LONG rc
= RETURN_FAIL
;
32 /* We have been created as a process by DOS, we should now
33 try and boot the system. */
35 struct DosLibrary
*DOSBase
;
36 D(bug("[DOSBoot] __dosboot_Boot()\n"));
38 DOSBase
= (struct DosLibrary
*)OpenLibrary("dos.library", 0);
41 /* BootStrap couldn't open dos.library */
42 Alert(AT_DeadEnd
| AN_BootStrap
| AG_OpenLib
| AO_DOSLib
);
46 cis
= Open("CON:20/20///Boot Shell/AUTO", FMF_READ
);
48 kprintf("Failed to load system HIDDs\n");
51 struct ExpansionBase
*ExpansionBase
;
55 struct TagItem tags
[] =
57 { SYS_Asynch
, TRUE
}, /* 0 */
58 { SYS_Background
, FALSE
}, /* 1 */
59 { SYS_Input
, (IPTR
)cis
}, /* 2 */
60 { SYS_Output
, (IPTR
)NULL
}, /* 3 */
61 { SYS_Error
, (IPTR
)NULL
}, /* 4 */
62 { SYS_ScriptInput
, (IPTR
)NULL
}, /* 5 */
66 if ((ExpansionBase
= (struct ExpansionBase
*)OpenLibrary("expansion.library", 0)) != NULL
)
68 opensseq
= !(ExpansionBase
->Flags
& EBF_DOSFLAG
);
69 CloseLibrary(ExpansionBase
);
72 D(bug("[DOSBoot] __dosboot_Boot: Open Startup Sequence = %d\n", opensseq
));
76 sseq
= Open("S:Startup-Sequence", FMF_READ
);
77 tags
[5].ti_Data
= (IPTR
)sseq
;
81 tags
[5].ti_Tag
= TAG_IGNORE
;
84 rc
= SystemTagList("", tags
);
95 kprintf("Cannot open boot console\n");
97 /* We get here when the Boot Shell Window is left with EndShell/EndCli.
98 There's no RemTask() here, otherwise the process cleanup routines
99 are not called. And that would for example mean, that the
100 Boot Process (having a CLI) is not removed from the rootnode.
101 --> Dead stuff in there -> Crash