Skip to contentSkip to conversation

Patch: let qemu work with latest bochsbios

Qemu-devel Bernhard Kauer 3 participants 4 messages Aug 1, 2007 – Aug 17, 2007

lore
Share & tools
lore
#0 lore raw

The boot_device is not communicated to the bochsbios through the CMOS. The following patch allows to boot via network on the newest bochsbios.

Bernhard Kauer

Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.323

vl.c +1 -1
diff -u -r1.323 vl.c
@@ -7828,7 +7828,7 @@
 	    fprintf(stderr, "No valid PXE rom found for network device\n");
 	    exit(1);
 	}
-	boot_device = 'c'; /* to prevent confusion by the BIOS */
+	//boot_device = 'c'; /* to prevent confusion by the BIOS */
     }
 #endif
 

Index: hw/pc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pc.c,v
retrieving revision 1.81

pc.c +3 -0
diff -u -r1.81 pc.c
@@ -197,6 +197,9 @@
     case 'd':
         rtc_set_memory(s, 0x3d, 0x03); /* CD-ROM boot */
         break;
+    case 'n':
+        rtc_set_memory(s, 0x3d, 0x04); /* Network boot */
+        break;	
     }
 
     /* floppy type */
#1 lore raw
Quoted 16 lines · Bernhard Kauer

The boot_device is not communicated to the bochsbios
through the CMOS. The following patch allows to boot via network on the newest bochsbios.

Bernhard Kauer

------------------------------------------------------------------------

Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.323
diff -u -r1.323 vl.c

vl.c line 7833

Quoted 7 lines
vl.c +1 -1
@@ -7828,7 +7828,7 @@
 	    fprintf(stderr, "No valid PXE rom found for network device\n");
 	    exit(1);
 	}
-	boot_device = 'c'; /* to prevent confusion by the BIOS */
+	//boot_device = 'c'; /* to prevent confusion by the BIOS */
     }
 

Please don't comment out code. Just delete it.

Regards,

Anthony Liguori

Quoted 20 lines
vl.c +0 -0
 #endif

Index: hw/pc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pc.c,v
retrieving revision 1.81
diff -u -r1.81 pc.c

pc.c +3 -0
@@ -197,6 +197,9 @@
     case 'd':
         rtc_set_memory(s, 0x3d, 0x03); /* CD-ROM boot */
         break;
+    case 'n':
+        rtc_set_memory(s, 0x3d, 0x04); /* Network boot */
+        break;	
     }
 
     /* floppy type */
#2 lore raw
Quoted 7 lines · Anthony Liguori

Review

Quoted 4 lines · Bernhard Kauer
(quoted diff) +1 -1
-	boot_device = 'c'; /* to prevent confusion by the BIOS */
+	//boot_device = 'c'; /* to prevent confusion by the BIOS */
     }

Please don't comment out code. Just delete it.

You are right. At the time i changed it I just wondered what the comment means...

Bernhard

Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.323

vl.c +0 -1
diff -u -r1.323 vl.c
@@ -7828,7 +7828,6 @@
 	    fprintf(stderr, "No valid PXE rom found for network device\n");
 	    exit(1);
 	}
-	boot_device = 'c'; /* to prevent confusion by the BIOS */
     }
 #endif
 

Index: hw/pc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pc.c,v
retrieving revision 1.81

pc.c +3 -0
diff -u -r1.81 pc.c
@@ -197,6 +197,9 @@
     case 'd':
         rtc_set_memory(s, 0x3d, 0x03); /* CD-ROM boot */
         break;
+    case 'n':
+        rtc_set_memory(s, 0x3d, 0x04); /* Network boot */
+        break;	
     }
 
     /* floppy type */
#3 lore raw
In reply to Bernhard Kauer

Has somebody besides me tested the patch?

Bernhard Kauer

Quoted 3 lines · Bernhard Kauer

The boot_device is not communicated to the bochsbios through the CMOS. The following patch allows to boot via network on the newest bochsbios.