2 Copyright 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Filesystem that accesses an underlying host OS filesystem.
9 /*********************************************************************************************/
13 #include <aros/debug.h>
14 #include <aros/symbolsets.h>
15 #include <libraries/expansion.h>
16 #include <resources/filesysres.h>
17 #include <proto/arossupport.h>
18 #include <proto/dos.h>
19 #include <proto/exec.h>
20 #include <proto/expansion.h>
22 #include "emul_intern.h"
23 #include LC_LIBDEFS_FILE
29 static LONG
startup(struct emulbase
*emulbase
)
33 D(bug("[Emulhandler] startup\n"));
35 HostLibBase
= OpenResource("hostlib.resource");
36 D(bug("[EmulHandler] got hostlib.resource %p\n", HostLibBase
));
40 KernelBase
= OpenResource("kernel.resource");
41 D(bug("[EmulHandler] KernelBase = %p\n", KernelBase
));
45 emulbase
->mempool
= CreatePool(MEMF_ANY
|MEMF_SEM_PROTECTED
, 4096, 2000);
46 if (!emulbase
->mempool
)
49 /* Create a BootNode so we can boot from this device */
50 if ((ExpansionBase
= OpenLibrary("expansion.library", 0)))
52 struct DeviceNode
*dn
;
53 IPTR pp
[4 + sizeof(struct DosEnvec
)/sizeof(IPTR
)] = {};
58 pp
[DE_TABLESIZE
+ 4] = DE_DOSTYPE
;
60 pp
[DE_BUFMEMTYPE
+ 4] = MEMF_PUBLIC
;
62 pp
[DE_BOOTPRI
+ 4] = 0;
63 pp
[DE_DOSTYPE
+ 4] = AROS_MAKE_ID('E', 'M', 'U', 0);
68 dn
->dn_SegList
= CreateSegList(EmulHandlerMain
);
69 dn
->dn_Handler
= AROS_CONST_BSTR("emul-handler");
70 dn
->dn_StackSize
= 16384;
71 dn
->dn_GlobalVec
= (BPTR
)-1;
73 AddDosNode(0, ADNF_STARTPROC
, dn
);
76 CloseLibrary(ExpansionBase
);
82 ADD2INITLIB(startup
, -10)
84 /*********************************************************************************************/
86 static LONG
cleanup(struct emulbase
*emulbase
)
88 if (emulbase
->mempool
)
89 DeletePool(emulbase
->mempool
);
94 ADD2EXPUNGELIB(cleanup
, 10);