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