mbchk.c revision 1
1N/A/* mbchk - a simple checker for the format of a Multiboot kernel */ 1N/A * Copyright (C) 1999,2001,2002 Free Software Foundation, Inc. 1N/A * This program is free software; you can redistribute it and/or modify 1N/A * it under the terms of the GNU General Public License as published by 1N/A * the Free Software Foundation; either version 2 of the License, or 1N/A * (at your option) any later version. 1N/A * This program is distributed in the hope that it will be useful, 1N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1N/A * GNU General Public License for more details. 1N/A * You should have received a copy of the GNU General Public License 1N/A * along with this program; if not, write to the Free Software 1N/A * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 1N/A printf (
"Usage: mbchk [OPTION]... [FILE]...\n" 1N/A "Check if the format of FILE complies with the Multiboot Specification.\n" 1N/A "-q, --quiet suppress all normal output\n" 1N/A "-h, --help display this help and exit\n" 1N/A "-v, --version output version information and exit.\n" 1N/A "Report bugs to <bug-grub@gnu.org>.\n");
1N/A printf (
"%s: The Multiboot header is found at the offset %d.\n",
1N/A /* Check for the checksum. */ 1N/A "%s: Bad checksum (0x%lx).\n",
1N/A /* Reserved flags must be zero. */ 1N/A "%s: Non-zero is found in reserved flags (0x%lx).\n",
1N/A printf (
"%s: Page alignment is turned %s.\n",
1N/A printf (
"%s: Memory information is turned %s.\n",
1N/A printf (
"%s: Address fields is turned %s.\n",
1N/A /* Check for the address fields. */ 1N/A "%s: header_addr is less than " 1N/A "load_addr (0x%lx > 0x%lx).\n",
1N/A "%s: load_addr is not less than load_end_addr" 1N/A " (0x%lx >= 0x%lx).\n",
1N/A "%s: load_end_addr is greater than bss_end_addr" 1N/A " (0x%lx > 0x%lx).\n",
1N/A "%s: load_addr is greater than entry_addr" 1N/A " (0x%lx > 0x%lx).\n",
1N/A /* FIXME: It is better to check if the entry address is within the 1N/A file, especially when the load end address is zero. */ 1N/A "%s: load_end_addr is not greater than entry_addr" 1N/A " (0x%lx <= 0x%lx).\n",
1N/A /* This is a GRUB-specific limitation. */ 1N/A "%s: Cannot be loaded at less than 1MB by GRUB"