2 Copyright � 1995-2010, The AROS Development Team. All rights reserved.
5 Desc: Boot your operating system.
10 #include <aros/debug.h>
12 #include <aros/bootloader.h>
13 #include <exec/types.h>
14 #include <exec/alerts.h>
15 #include <exec/libraries.h>
16 #include <exec/devices.h>
17 #include <exec/execbase.h>
18 #include <aros/libcall.h>
19 #include <aros/asmcall.h>
20 #include <dos/dosextens.h>
21 #include <dos/filesystem.h>
22 #include <utility/tagitem.h>
24 #include <proto/bootloader.h>
25 #include <proto/exec.h>
26 #include <proto/dos.h>
28 #include "dosboot_intern.h"
30 void __dosboot_Boot(APTR BootLoaderBase
, struct DosLibrary
*DOSBase
, ULONG Flags
)
32 LONG rc
= RETURN_FAIL
;
35 /* We have been created as a process by DOS, we should now
36 try and boot the system. */
39 D(bug("[DOSBoot] __dosboot_Boot()\n"));
41 cis
= Open("CON:20/20///Boot Shell/AUTO", FMF_READ
);
46 struct TagItem tags
[] =
48 { SYS_Asynch
, TRUE
}, /* 0 */
49 { SYS_Background
, FALSE
}, /* 1 */
50 { SYS_Input
, (IPTR
)cis
}, /* 2 */
51 { SYS_Output
, (IPTR
)NULL
}, /* 3 */
52 { SYS_Error
, (IPTR
)NULL
}, /* 4 */
53 { SYS_ScriptInput
, (IPTR
)NULL
}, /* 5 */
57 D(bug("[DOSBoot] __dosboot_Boot: Open Startup Sequence = %d\n", opensseq
));
59 if (!(Flags
& BF_NO_STARTUP_SEQUENCE
))
61 sseq
= Open("S:Startup-Sequence", FMF_READ
);
62 tags
[5].ti_Data
= (IPTR
)sseq
;
66 /* If poseidon is enabled, ensure that ENV: exists to avoid missing volume requester.
67 * You could think we should check for this in bootmenu.resource because there we
68 * select to boot without startup sequence but there might be other places to do this
69 * selection in the future.
74 /* TODO: create something like ExistsBootArg("enableusb") in bootloader.resource */
75 struct List
*list
= GetBootInfo(BL_Args
);
80 ForeachNode(list
, node
)
82 if (stricmp(node
->ln_Name
, "enableusb") == 0)
91 BPTR lock
= CreateDir("RAM:ENV");
93 AssignLock("ENV", lock
);
97 tags
[5].ti_Tag
= TAG_IGNORE
;
100 rc
= SystemTagList("", tags
);
111 kprintf("Cannot open boot console\n");
113 /* We get here when the Boot Shell Window is left with EndShell/EndCli.
114 There's no RemTask() here, otherwise the process cleanup routines
115 are not called. And that would for example mean, that the
116 Boot Process (having a CLI) is not removed from the rootnode.
117 --> Dead stuff in there -> Crash