4 #include <gpxe/iscsi.h>
8 int iscsiboot ( const char *root_path ) {
9 struct scsi_device scsi;
10 struct int13_drive drive;
13 memset ( &scsi, 0, sizeof ( scsi ) );
14 memset ( &drive, 0, sizeof ( drive ) );
16 printf ( "iSCSI booting from %s\n", root_path );
18 if ( ( rc = iscsi_attach ( &scsi, root_path ) ) != 0 ) {
19 printf ( "Could not attach iSCSI device: %s\n",
23 if ( ( rc = init_scsidev ( &scsi ) ) != 0 ) {
24 printf ( "Could not initialise iSCSI device: %s\n",
29 drive.drive = find_global_dhcp_num_option ( DHCP_EB_BIOS_DRIVE );
30 drive.blockdev = &scsi.blockdev;
32 register_int13_drive ( &drive );
33 printf ( "Registered as BIOS drive %#02x\n", drive.drive );
34 printf ( "Booting from BIOS drive %#02x\n", drive.drive );
35 rc = int13_boot ( drive.drive );
36 printf ( "Boot failed\n" );
38 printf ( "Unregistering BIOS drive %#02x\n", drive.drive );
39 unregister_int13_drive ( &drive );
42 iscsi_detach ( &scsi );