|
@@ -0,0 +1,42 @@
|
|
1
|
+#include <stdint.h>
|
|
2
|
+#include <vsprintf.h>
|
|
3
|
+#include <console.h>
|
|
4
|
+#include <gpxe/netdevice.h>
|
|
5
|
+#include <gpxe/aoe.h>
|
|
6
|
+#include <int13.h>
|
|
7
|
+
|
|
8
|
+static struct aoe_device test_aoedev = {
|
|
9
|
+ .aoe = {
|
|
10
|
+ .major = 0,
|
|
11
|
+ .minor = 0,
|
|
12
|
+ },
|
|
13
|
+};
|
|
14
|
+
|
|
15
|
+int test_aoeboot ( struct net_device *netdev ) {
|
|
16
|
+ struct int13_drive drive;
|
|
17
|
+ int rc;
|
|
18
|
+
|
|
19
|
+ test_aoedev.aoe.netdev = netdev;
|
|
20
|
+ printf ( "Initialising AoE device e%d.%d\n",
|
|
21
|
+ test_aoedev.aoe.major, test_aoedev.aoe.minor );
|
|
22
|
+ if ( ( rc = init_aoedev ( &test_aoedev ) ) != 0 ) {
|
|
23
|
+ printf ( "Could not reach AoE device e%d.%d\n",
|
|
24
|
+ test_aoedev.aoe.major, test_aoedev.aoe.minor );
|
|
25
|
+ return rc;
|
|
26
|
+ }
|
|
27
|
+
|
|
28
|
+ memset ( &drive, 0, sizeof ( drive ) );
|
|
29
|
+ drive.blockdev = &test_aoedev.ata.blockdev;
|
|
30
|
+ register_int13_drive ( &drive );
|
|
31
|
+ printf ( "Registered AoE device e%d.%d as BIOS drive %#02x\n",
|
|
32
|
+ test_aoedev.aoe.major, test_aoedev.aoe.minor, drive.drive );
|
|
33
|
+
|
|
34
|
+ printf ( "Booting from BIOS drive %#02x\n", drive.drive );
|
|
35
|
+ rc = int13_boot ( drive.drive );
|
|
36
|
+ printf ( "Boot failed\n" );
|
|
37
|
+
|
|
38
|
+ printf ( "Unregistering BIOS drive %#02x\n", drive.drive );
|
|
39
|
+ unregister_int13_drive ( &drive );
|
|
40
|
+
|
|
41
|
+ return rc;
|
|
42
|
+}
|