added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / x86_64-pc / dos / aros.c
blobc195677c56fa8d3af23a3d969789e81d380ecca5
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id: aros.c 15352 2002-09-13 13:40:36Z sheutlin $
5 Desc: This is the "boot code" of AROS when it runs as an emulation.
6 Lang: english
7 */
8 #include <dos/dostags.h>
9 #include <dos/dos.h>
10 #include <dos/dosextens.h>
11 #include <dos/filesystem.h>
12 #include <libraries/bootmenu.h>
13 #include <proto/dos.h>
14 #include <proto/intuition.h>
15 #include <proto/exec.h>
17 #define CANNOT_LOAD_SHELL "Unable to load C:shell\n"
18 #define CANNOT_OPEN_CON "Cannot open boot console\n"
20 int main(struct ExecBase * SysBase, struct DosLibrary * DOSBase)
22 LONG rc = RETURN_FAIL;
24 BPTR cis = Open("CON:20/20///Boot Shell/AUTO", FMF_READ);
26 if (cis)
28 struct BootMenuBase *bootmenubase;
29 BOOL opensseq = TRUE;
30 BPTR sseq = NULL;
31 struct TagItem tags[] =
33 { SYS_Asynch, TRUE }, /* 0 */
34 { SYS_Background, FALSE }, /* 1 */
35 { SYS_Input, (IPTR)cis }, /* 2 */
36 { SYS_Output, (IPTR)NULL }, /* 3 */
37 { SYS_Error, (IPTR)NULL }, /* 4 */
38 { SYS_ScriptInput, (IPTR)NULL }, /* 5 */
39 { TAG_DONE, 0 }
41 bootmenubase = (struct BootMenuBase *)OpenLibrary("bootmenu.library", 41);
42 if (bootmenubase != NULL)
44 opensseq = bootmenubase->bcfg.startup_sequence;
45 CloseLibrary((struct Library *)bootmenubase);
47 if (opensseq)
49 sseq = Open("S:Startup-Sequence", FMF_READ);
50 tags[5].ti_Data = (IPTR)sseq;
52 rc = SystemTagList("", tags);
53 if (rc != -1)
55 cis = NULL;
56 sseq = NULL;
58 else
59 rc = RETURN_FAIL;
60 if (sseq != NULL)
61 Close(sseq);
63 else
65 PutStr(CANNOT_OPEN_CON);
68 Close(cis);
70 return rc;