2 Copyright © 2011, The AROS Development Team. All rights reserved.
10 #include <aros/debug.h>
12 #include <exec/resident.h>
13 #include <proto/exec.h>
14 #include <proto/dos.h>
16 #include <aros/symbolsets.h>
17 #include <aros/shcommands.h>
19 THIS_PROGRAM_HANDLES_SYMBOLSET(SHCOMMANDS
)
22 #include LC_LIBDEFS_FILE
26 extern void ShellStart(void);
29 /* Under AOS, the "CLI" segment has a BCPL entry,
30 * while the "Shell" segment has a C entry point.
32 * This small stub 'thunks' from BCPL to C,
35 extern void Shell_CLISeg(void);
38 " .global Shell_CLISeg\n"
39 " .long ((Shell_CLI_end - Shell_CLI_start) / 4)+1\n"
41 " .long 0\n" /* No next BCPL segment */
42 " .long ((Shell_CLI_end - Shell_CLI_start) / 4)+1\n"
44 " movem.l %a0-%a1/%a6, %sp@-\n"
48 " movem.l %sp@+,%a0-%a1/%a6\n"
52 " .long 0\n" /* End of setup data */
53 " .long 1\n" /* Update BCPL Entry (GV #1) */
54 " .long 4\n" /* Offset of CLI start */
55 " .long 2\n" /* Need a minimum of 2 GV slots */
60 static int GM_UNIQUENAME(Init
)(LIBBASETYPEPTR LIBBASE
)
65 D(bug("[Shell] Init\n"));
67 DOSBase
= OpenLibrary("dos.library", 0);
68 if ( DOSBase
== NULL
) {
69 D(bug("[Shell] What? No dos.library?\n"));
73 seg
= CreateSegList(ShellStart
);
75 AddSegment("shell", seg
, CMD_SYSTEM
);
77 AddSegment("CLI", MKBADDR(Shell_CLISeg
), CMD_SYSTEM
);
79 AddSegment("CLI", seg
, CMD_SYSTEM
);
83 CloseLibrary(DOSBase
);
88 ADD2INITLIB(GM_UNIQUENAME(Init
), 0);