From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IpruT-0001Nc-9B for mharc-grub-devel@gnu.org; Wed, 07 Nov 2007 15:54:01 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IpruQ-0001Kw-KQ for grub-devel@gnu.org; Wed, 07 Nov 2007 15:53:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IpruP-0001Ja-LV for grub-devel@gnu.org; Wed, 07 Nov 2007 15:53:57 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IpruP-0001JB-9n for grub-devel@gnu.org; Wed, 07 Nov 2007 15:53:57 -0500 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IpruO-0004b1-MT for grub-devel@gnu.org; Wed, 07 Nov 2007 15:53:57 -0500 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1IpruK-0006Tq-Sm for grub-devel@gnu.org; Wed, 07 Nov 2007 21:53:53 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1Ipru8-0004La-NA for grub-devel@gnu.org; Wed, 07 Nov 2007 21:53:40 +0100 Date: Wed, 7 Nov 2007 21:53:40 +0100 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20071107205340.GA16687@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline Organization: free as in freedom X-Message-Flag: Microsoft discourages use of Outlook. X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] fix serial console on LinuxBIOS X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2007 20:53:58 -0000 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This patch fixes serial console on LinuxBIOS. I'd appreciate comments (specially on the addition). -- Robert Millan I know my rights; I want my phone call! What use is a phone call, if you are unable to speak? (as seen on /.) --0F1p//8PRICkK4MW Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="serial_lb.diff" * include/grub/i386/efi/machine.h: New file. * include/grub/i386/linuxbios/machine.h: Likewise. * include/grub/i386/pc/machine.h: Likewise. * include/grub/powerpc/ieee1275/machine.h: Likewise. * include/grub/sparc64/ieee1275/machine.h: Likewise. * term/i386/pc/serial.c: Include . (serial_hw_io_addr): New variable. (serial_hw_get_port): Obtain port address from `serial_hw_io_addr' instead of `(unsigned short *) 0x400'. diff -Nurp grub2/include/grub/i386/efi/machine.h grub2.serial/include/grub/i386/efi/machine.h --- grub2/include/grub/i386/efi/machine.h 1970-01-01 01:00:00.000000000 +0100 +++ grub2.serial/include/grub/i386/efi/machine.h 2007-11-07 21:46:10.000000000 +0100 @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_MACHINE_HEADER +#define GRUB_MACHINE_MACHINE_HEADER 1 + +#define GRUB_MACHINE_EFI 1 + +#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff -Nurp grub2/include/grub/i386/linuxbios/machine.h grub2.serial/include/grub/i386/linuxbios/machine.h --- grub2/include/grub/i386/linuxbios/machine.h 1970-01-01 01:00:00.000000000 +0100 +++ grub2.serial/include/grub/i386/linuxbios/machine.h 2007-11-07 21:46:20.000000000 +0100 @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_MACHINE_HEADER +#define GRUB_MACHINE_MACHINE_HEADER 1 + +#define GRUB_MACHINE_LINUXBIOS 1 + +#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff -Nurp grub2/include/grub/i386/pc/machine.h grub2.serial/include/grub/i386/pc/machine.h --- grub2/include/grub/i386/pc/machine.h 1970-01-01 01:00:00.000000000 +0100 +++ grub2.serial/include/grub/i386/pc/machine.h 2007-11-07 21:45:53.000000000 +0100 @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_MACHINE_HEADER +#define GRUB_MACHINE_MACHINE_HEADER 1 + +#define GRUB_MACHINE_PCBIOS 1 + +#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff -Nurp grub2/include/grub/powerpc/ieee1275/machine.h grub2.serial/include/grub/powerpc/ieee1275/machine.h --- grub2/include/grub/powerpc/ieee1275/machine.h 1970-01-01 01:00:00.000000000 +0100 +++ grub2.serial/include/grub/powerpc/ieee1275/machine.h 2007-11-07 21:46:45.000000000 +0100 @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_MACHINE_HEADER +#define GRUB_MACHINE_MACHINE_HEADER 1 + +#define GRUB_MACHINE_IEEE1275 1 + +#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff -Nurp grub2/include/grub/sparc64/ieee1275/machine.h grub2.serial/include/grub/sparc64/ieee1275/machine.h --- grub2/include/grub/sparc64/ieee1275/machine.h 1970-01-01 01:00:00.000000000 +0100 +++ grub2.serial/include/grub/sparc64/ieee1275/machine.h 2007-11-07 21:47:00.000000000 +0100 @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_MACHINE_HEADER +#define GRUB_MACHINE_MACHINE_HEADER 1 + +#define GRUB_MACHINE_IEEE1275 1 + +#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff -Nurp grub2/term/i386/pc/serial.c grub2.serial/term/i386/pc/serial.c --- grub2/term/i386/pc/serial.c 2007-11-07 21:39:04.000000000 +0100 +++ grub2.serial/term/i386/pc/serial.c 2007-11-07 21:44:22.000000000 +0100 @@ -16,6 +16,7 @@ * along with GRUB. If not, see . */ +#include #include #include #include @@ -63,13 +64,18 @@ struct serial_port /* Serial port settings. */ static struct serial_port serial_settings; +#ifdef GRUB_MACHINE_PCBIOS +/* The BIOS data area. */ +static const unsigned short *serial_hw_io_addr = (const unsigned short *) 0x0400; +#else +static const unsigned short serial_hw_io_addr[] = { 0x3f8, 0x2f8 }; +#endif + /* Return the port number for the UNITth serial device. */ static inline unsigned short serial_hw_get_port (const unsigned short unit) { - /* The BIOS data area. */ - const unsigned short *addr = (const unsigned short *) 0x0400; - return addr[unit]; + return serial_hw_io_addr[unit]; } /* Fetch a key. */ --0F1p//8PRICkK4MW--