2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Add a DOS device to the system.
8 #include "expansion_intern.h"
10 #include <dos/filesystem.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
14 /*****************************************************************************
17 #include <dos/filehandler.h>
18 #include <dos/dosextens.h>
19 #include <libraries/expansion.h>
20 #include <proto/expansion.h>
22 AROS_LH3(BOOL
, AddDosNode
,
25 AROS_LHA(LONG
, bootPri
, D0
),
26 AROS_LHA(ULONG
, flags
, D1
),
27 AROS_LHA(struct DeviceNode
*, deviceNode
, A0
),
30 struct ExpansionBase
*, ExpansionBase
, 25, Expansion
)
33 This is the old function for adding devices to the system. It
34 is recommended that you use the AddBootNode() function.
36 Unlike AddBootNode() you will have to add a BootNode to the
40 bootPri - The priority of the device (-128 --> 127).
41 flags - Flags (ADNF_STARTPROC etc)
42 deviceNode - The device to add to the system.
45 non-zero if everything succeeded, zero on failure.
48 It is much better to use AddBootNode() as it will also
49 construct the BootNode structure, and add it to the system.
52 // Add a bootable disk to the system. This will start a
53 // file handler process immediately.
55 if( AddDosNode( 0, ADNF_STARTPROC, MakeDosNode( paramPacket )))
63 AddBootNode(), MakeDosNode()
68 19-05-07 sonic Rewritten to use dos.library for starting up
70 27-11-96 digulla automatically created from
71 expansion_lib.fd and clib/expansion_protos.h
73 *****************************************************************************/
77 struct DosLibrary
*DOSBase
;
80 DOSBase
= (struct DosLibrary
*)OpenLibrary("dos.library", 0);
82 /* Aha, DOS is up and running... */
85 /* We should add the filesystem to the DOS device list. It will
86 be usable from this point onwards.
88 The DeviceNode structure that was passed to us can be added
89 to the DOS list as it is, and we will let DOS start the
90 filesystem task if it is necessary to do so.
93 ok
= AddDosEntry((struct DosList
*)deviceNode
);
94 /* Have we been asked to start a filesystem, and there is none already */
95 if (flags
& ADNF_STARTPROC
)
99 DeviceProc() will see that dn_Device for this node is NULL
100 and start up the handler. */
101 DeviceProc((struct Device
*)deviceNode
);
104 CloseLibrary((struct Library
*)DOSBase
);