Init control word to zero, cdrom-handler reads this and will crash if it is non-zero...
[AROS.git] / rom / partition / partition_init.c
blob2a0b462e562956f8dad6f33603ac34021f89d2fd
1 /*
2 Copyright © 2001-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Partition initialization code
6 Lang: English
7 */
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)))
21 return FALSE;
23 LIBBASE->partbase.tables = (struct PartitionTableInfo **)PartitionSupport;
24 NewList(&LIBBASE->bootList);
25 InitSemaphore(&LIBBASE->bootSem);
28 * This is intentionally allowed to fail.
29 * It fill fail if we are in kickstart, partition.library is initialized
30 * long before dos.library.
32 LIBBASE->pb_DOSBase = OpenLibrary("dos.library", 36);
34 return TRUE;
37 static int PartitionCleanup(struct PartitionBase_intern *base)
39 /* If there's something in our boot list, we can't quit without losing it */
40 if (!IsListEmpty(&base->bootList))
41 return FALSE;
43 if (base->pb_DOSBase)
44 CloseLibrary(base->pb_DOSBase);
46 /* REMOVE ONCE ABIv1 HAS STABILIZED */
47 if (base->pb_UtilityBase)
48 CloseLibrary(base->pb_UtilityBase);
50 return TRUE;
53 ADD2INITLIB(PartitionInit, 0);
54 ADD2EXPUNGELIB(PartitionCleanup, 0);