From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KyCfN-0002hZ-39 for qemu-devel@nongnu.org; Thu, 06 Nov 2008 16:45:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KyCfI-0002fr-Vl for qemu-devel@nongnu.org; Thu, 06 Nov 2008 16:45:24 -0500 Received: from [199.232.76.173] (port=51035 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KyCfI-0002fb-Mu for qemu-devel@nongnu.org; Thu, 06 Nov 2008 16:45:20 -0500 Received: from mail.gmx.net ([213.165.64.20]:50001) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KyCfH-0001Vr-57 for qemu-devel@nongnu.org; Thu, 06 Nov 2008 16:45:19 -0500 Message-ID: <3B0D553ED9934AFFA7DE8A0C9558D652@FSCPC> From: "Sebastian Herbszt" References: <20081103092620.8058.91416.stgit@dhcp-1-237.local> <20081103092625.8058.52045.stgit@dhcp-1-237.local> In-Reply-To: <20081103092625.8058.52045.stgit@dhcp-1-237.local> Date: Thu, 6 Nov 2008 22:42:38 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [Bochs-developers] [PATCH v2 1/6] Move PIC initialization out ofline to save space in post code area. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov , bochs-developers@lists.sourceforge.net Cc: qemu-devel@nongnu.org Gleb Natapov wrote: > There are only a couple of bytes left in post area. > > Signed-off-by: Gleb Natapov > --- > > bios/rombios.c | 48 ++++++++++++++++++++++++++---------------------- > 1 files changed, 26 insertions(+), 22 deletions(-) > > diff --git a/bios/rombios.c b/bios/rombios.c > index 3366ad9..88eac04 100644 > --- a/bios/rombios.c > +++ b/bios/rombios.c > @@ -10256,6 +10256,31 @@ rom_scan_increment: > mov ds, ax > ret > > +post_init_pic: > + mov al, #0x11 ; send initialisation commands > + out 0x20, al > + out 0xa0, al > + mov al, #0x08 > + out 0x21, al > + mov al, #0x70 > + out 0xa1, al > + mov al, #0x04 > + out 0x21, al > + mov al, #0x02 > + out 0xa1, al > + mov al, #0x01 > + out 0x21, al > + out 0xa1, al > + mov al, #0xb8 > + out 0x21, AL ;master pic: unmask IRQ 0, 1, 2, 6 > +#if BX_USE_PS2_MOUSE > + mov al, #0x8f > +#else > + mov al, #0x9f > +#endif > + out 0xa1, AL ;slave pic: unmask IRQ 12, 13, 14 > + ret > + > ;; the following area can be used to write dynamically generated tables > .align 16 > bios_table_area_start: > @@ -10516,28 +10541,7 @@ post_default_ints: > SET_INT_VECTOR(0x10, #0xF000, #int10_handler) > > ;; PIC > - mov al, #0x11 ; send initialisation commands > - out 0x20, al > - out 0xa0, al > - mov al, #0x08 > - out 0x21, al > - mov al, #0x70 > - out 0xa1, al > - mov al, #0x04 > - out 0x21, al > - mov al, #0x02 > - out 0xa1, al > - mov al, #0x01 > - out 0x21, al > - out 0xa1, al > - mov al, #0xb8 > - out 0x21, AL ;master pic: unmask IRQ 0, 1, 2, 6 > -#if BX_USE_PS2_MOUSE > - mov al, #0x8f > -#else > - mov al, #0x9f > -#endif > - out 0xa1, AL ;slave pic: unmask IRQ 12, 13, 14 > + call post_init_pic > > mov cx, #0xc000 ;; init vga bios > mov ax, #0xc780 Looks good. Similar patch is already in the VirtualBox tree [1]. [1] http://www.virtualbox.org/changeset/12494 - Sebastian