Explorar el Código

Added the AoE boot information table as used by Vampyre's AoE

initiator.  This table needs to be replaced by something similar to
iBFT (i.e. scanned for and identified by signature, rather than being
at a fixed address), but it works for now.
tags/v0.9.3
Michael Brown hace 17 años
padre
commit
d0abffc2f6
Se han modificado 1 ficheros con 33 adiciones y 0 borrados
  1. 33
    0
      src/usr/aoeboot.c

+ 33
- 0
src/usr/aoeboot.c Ver fichero

@@ -8,6 +8,26 @@
8 8
 #include <int13.h>
9 9
 #include <usr/aoeboot.h>
10 10
 
11
+/**
12
+ * AoE boot information block
13
+ *
14
+ * Must be placed at 40:f0.
15
+ *
16
+ * This structure needs to be replaced by an ACPI table or similar.
17
+ */
18
+struct aoe_boot_info {
19
+	/** Must be 0x01 */
20
+	uint8_t one;
21
+	/** Client MAC address */
22
+	uint8_t client[ETH_ALEN];
23
+	/** Server MAC address */
24
+	uint8_t server[ETH_ALEN];
25
+	/** Shelf number */
26
+	uint16_t shelf;
27
+	/** Slot number */
28
+	uint8_t slot;
29
+} __attribute__ (( packed ));
30
+
11 31
 /**
12 32
  * Guess boot network device
13 33
  *
@@ -48,6 +68,19 @@ int aoeboot ( const char *root_path ) {
48 68
 		goto error_init;
49 69
 	}
50 70
 
71
+	/* FIXME: ugly, ugly hack */
72
+	struct aoe_session *aoe =
73
+		container_of ( ata.backend, struct aoe_session, refcnt );
74
+	struct aoe_boot_info boot_info;
75
+	boot_info.one = 0x01;
76
+	memcpy ( boot_info.client, netdev->ll_addr,
77
+		 sizeof ( boot_info.client ) );
78
+	memcpy ( boot_info.server, aoe->target,
79
+		 sizeof ( boot_info.server ) );
80
+	boot_info.shelf = aoe->major;
81
+	boot_info.slot = aoe->minor;
82
+	copy_to_real ( 0x40, 0xf0, &boot_info, sizeof ( boot_info ) );
83
+
51 84
 	drive.drive = find_global_dhcp_num_option ( DHCP_EB_BIOS_DRIVE );
52 85
 	drive.blockdev = &ata.blockdev;
53 86
 

Loading…
Cancelar
Guardar