2 Copyright © 2001-2011, The AROS Development Team. All rights reserved.
5 Desc: Partition initialization code
9 #include <aros/symbolsets.h>
10 #include <aros/debug.h>
11 #include <proto/alib.h>
13 #include "partition_intern.h"
14 #include "partition_support.h"
15 #include LC_LIBDEFS_FILE
17 static int PartitionInit(LIBBASETYPEPTR LIBBASE
)
19 /* REMOVE ONCE ABIv1 HAS STABILIZED */
20 if (!(LIBBASE
->pb_UtilityBase
= TaggedOpenLibrary(TAGGEDOPEN_UTILITY
)))
23 LIBBASE
->partbase
.tables
= (struct PartitionTableInfo
**)PartitionSupport
;
24 NewList(&LIBBASE
->bootList
);
27 * This is intentionally allowed to fail.
28 * It fill fail if we are in kickstart, partition.library is initialized
29 * long before dos.library.
31 LIBBASE
->pb_DOSBase
= OpenLibrary("dos.library", 36);
36 static int PartitionCleanup(struct PartitionBase_intern
*base
)
39 * If we are resident in kickstart, we won't have a seglist.
40 * In this case we prevent expunging, otherwise we can't come up again.
45 /* If there's something in our boot list, we can't quit without losing it */
46 if (!IsListEmpty(&base
->bootList
))
50 CloseLibrary(base
->pb_DOSBase
);
52 /* REMOVE ONCE ABIv1 HAS STABILIZED */
53 CloseLibrary(base
->pb_UtilityBase
);
58 ADD2INITLIB(PartitionInit
, 0);
59 ADD2EXPUNGELIB(PartitionCleanup
, 0);