From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FiaDQ-00063a-RR for qemu-devel@nongnu.org; Tue, 23 May 2006 12:58:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FiaDO-00063N-2W for qemu-devel@nongnu.org; Tue, 23 May 2006 12:58:40 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FiaDN-00063K-Tz for qemu-devel@nongnu.org; Tue, 23 May 2006 12:58:37 -0400 Received: from [24.93.47.42] (helo=ms-smtp-03.texas.rr.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FiaHc-0002JU-NB for qemu-devel@nongnu.org; Tue, 23 May 2006 13:03:01 -0400 Received: from [192.168.0.11] (cpe-67-9-160-120.austin.res.rr.com [67.9.160.120]) by ms-smtp-03.texas.rr.com (8.13.6/8.13.6) with ESMTP id k4NGwXGb005826 for ; Tue, 23 May 2006 11:58:34 -0500 (CDT) Message-ID: <44733F38.3010309@austin.rr.com> Date: Tue, 23 May 2006 11:58:32 -0500 From: Lonnie Mendez MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050602020202010601050409" Subject: [Qemu-devel] [patch] disable boot signature checking for floppy disks Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------050602020202010601050409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit lo list. There was someone having problems with booting a floppy that had an invalid boot signature (!0xaa55) in the irc channel earlier today. They were however able to boot it in bochs using the option floppy_bootsig_check: disabled=1. This is something that can easily be enabled in the bios through qemu. The attached patch allows for this by passing the argument -no-fd-bootchk to qemu. --------------050602020202010601050409 Content-Type: text/plain; name="qemu-fd-no-bootchk.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-fd-no-bootchk.diff" --- qemu/qemu-doc.texi 2006-05-13 11:55:46.000000000 -0500 +++ qemu/qemu-doc.texi 2006-05-23 11:09:18.000000000 -0500 @@ -228,6 +228,9 @@ the raw disk image you use is not written back. You can however force the write back by pressing @key{C-a s} (@pxref{disk_images}). +@item -no-fd-bootchk +Disable boot signature checking for floppy disks in Bochs bios. + @item -m megs Set virtual RAM size to @var{megs} megabytes. Default is 128 MB. --- qemu/vl.h 2006-05-21 11:30:15.000000000 -0500 +++ qemu/vl.h 2006-05-23 10:46:14.000000000 -0500 @@ -880,6 +880,7 @@ /* pc.c */ extern QEMUMachine pc_machine; extern QEMUMachine isapc_machine; +extern int fd_bootchk; void ioport_set_a20(int enable); int ioport_get_a20(void); --- qemu/vl.c 2006-05-21 11:30:15.000000000 -0500 +++ qemu/vl.c 2006-05-23 11:34:43.000000000 -0500 @@ -159,6 +159,7 @@ #define MAX_CPUS 1 #endif int acpi_enabled = 1; +int fd_bootchk = 1; /***********************************************************/ /* x86 ISA bus support */ @@ -4632,6 +4668,9 @@ "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n" "-boot [a|c|d] boot on floppy (a), hard disk (c) or CD-ROM (d)\n" "-snapshot write to temporary files instead of disk image files\n" +#ifdef TARGET_I386 + "-no-fd-bootchk disable boot signature checking for floppy disks\n" +#endif "-m megs set virtual RAM size to megs MB [default=%d]\n" "-smp n set the number of CPUs to 'n' [default=1]\n" "-nographic disable graphical output and redirect serial I/Os to console\n" @@ -4763,6 +4802,9 @@ QEMU_OPTION_cdrom, QEMU_OPTION_boot, QEMU_OPTION_snapshot, +#ifdef TARGET_I386 + QEMU_OPTION_no_fd_bootchk, +#endif QEMU_OPTION_m, QEMU_OPTION_nographic, #ifdef HAS_AUDIO @@ -4826,6 +4868,9 @@ { "cdrom", HAS_ARG, QEMU_OPTION_cdrom }, { "boot", HAS_ARG, QEMU_OPTION_boot }, { "snapshot", 0, QEMU_OPTION_snapshot }, +#ifdef TARGET_I386 + { "no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk }, +#endif { "m", HAS_ARG, QEMU_OPTION_m }, { "nographic", 0, QEMU_OPTION_nographic }, { "k", HAS_ARG, QEMU_OPTION_k }, @@ -5284,6 +5329,11 @@ case QEMU_OPTION_fdb: fd_filename[1] = optarg; break; +#ifdef TARGET_I386 + case QEMU_OPTION_no_fd_bootchk: + fd_bootchk = 0; + break; +#endif case QEMU_OPTION_no_code_copy: code_copy_enabled = 0; break; --- qemu/hw/pc.c 2006-05-21 11:30:15.000000000 -0500 +++ qemu/hw/pc.c 2006-05-23 09:03:29.000000000 -0500 @@ -193,6 +193,8 @@ case 'a': case 'b': rtc_set_memory(s, 0x3d, 0x01); /* floppy boot */ + if (!fd_bootchk) + rtc_set_memory(s, 0x38, 0x01); /* disable signature check */ break; default: case 'c': --------------050602020202010601050409--