Nonsense removed: upper case and lower case the same time.
[AROS.git] / rom / dosboot / boot.c
blobd3c9fa5583fb82b95a170b5576db7ae64bec788a
1 /*
2 Copyright � 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Boot your operating system.
6 Lang: english
7 */
9 #define DEBUG 0
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;
33 BPTR cis = NULL;
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);
42 if (cis)
44 BPTR sseq = NULL;
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 */
54 { TAG_DONE, 0 }
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;
64 else
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.
72 if (BootLoaderBase)
74 /* TODO: create something like ExistsBootArg("enableusb") in bootloader.resource */
75 struct List *list = GetBootInfo(BL_Args);
76 BOOL enable = FALSE;
77 if (list)
79 struct Node *node;
80 ForeachNode(list, node)
82 if (stricmp(node->ln_Name, "enableusb") == 0)
84 enable = TRUE;
89 if (enable)
91 BPTR lock = CreateDir("RAM:ENV");
92 if (lock)
93 AssignLock("ENV", lock);
97 tags[5].ti_Tag = TAG_IGNORE;
100 rc = SystemTagList("", tags);
101 if (rc != -1)
103 cis = NULL;
104 sseq = NULL;
106 else
107 rc = RETURN_FAIL;
108 if (sseq != NULL)
109 Close(sseq);
110 } else
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