2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
6 #include <aros/asmcall.h>
7 #include <aros/debug.h>
8 #include <exec/resident.h>
9 #include <libraries/expansionbase.h>
10 #include <proto/exec.h>
12 #include LC_LIBDEFS_FILE
16 extern const char ata_LibName
[];
17 extern const char ata_LibID
[];
18 extern const int ata_End
;
20 AROS_UFP3(static APTR
, ata_Wait
,
21 AROS_UFPA(void *, dummy
, D0
),
22 AROS_UFPA(BPTR
, segList
, A0
),
23 AROS_UFPA(struct ExecBase
*, SysBase
, A6
));
25 const struct Resident ata_BootWait
=
28 (struct Resident
*)&ata_BootWait
,
33 -49, /* dosboot.resource is -50 */
40 * The purpose of this delay is to wait until device detection is done
41 * before boot sequence enters DOS bootstrap. Without this we reach the
42 * bootstrap earlier than devices are detected (and BootNodes inserted).
43 * As a result, we end up in unbootable system.
44 * Actually, i dislike this solution a bit. I think something else has
45 * to be implemented. However i do not know what. Even if we rewrite
46 * adding BootNodes, bootmenu still has to wait until all nodes are added.
47 * Making device detection synchronous is IMHO not a good option, it will
48 * increase booting time of our OS.
51 AROS_UFH3(static APTR
, ata_Wait
,
52 AROS_UFPA(void *, dummy
, D0
),
53 AROS_UFPA(BPTR
, segList
, A0
),
54 AROS_UFPA(struct ExecBase
*, SysBase
, A6
))
58 struct ataBase
*ATABase
;
60 /* We do not want to deal with IORequest and units, so just FindName() */
61 ATABase
= (struct ataBase
*)FindName(&SysBase
->DeviceList
, ata_LibName
);
64 D(bug("[ATA ] Waiting for device detection to complete...\n"));
65 ObtainSemaphore(&ATABase
->DetectionSem
);
66 ReleaseSemaphore(&ATABase
->DetectionSem
);