Commit 4b13b216 authored by okuji's avatar okuji

2004-04-04 Yoshinori K. Okuji <okuji@enbug.org>

	All symbols prefixed with PUPA_ and pupa_ are renamed to GRUB_
	and grub_, respectively. Because the conversion is trivial and
	mechanical, I omit the details here. Please refer to the CVS
	if you need more information.
parent 6a142551
......@@ -6,5 +6,5 @@ Yoshinori K. Okuji designed and implemented the initial version.
Jeroen Dekkers added initrd support, Multiboot support, and fixed bugs
in ext2fs.
Marco Gerards added ext2fs support, pupa-emu, a new command-line
Marco Gerards added ext2fs support, grub-emu, a new command-line
engine, and fixed many bugs.
2004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
All symbols prefixed with PUPA_ and pupa_ are renamed to GRUB_
and grub_, respectively. Because the conversion is trivial and
mechanical, I omit the details here. Please refer to the CVS
if you need more information.
2004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
* include/pupa: Renamed to ...
......
-*- Text -*-
This is the PUPA. Welcome.
This is the GRUB. Welcome.
This file contains instructions for compiling and installing the PUPA.
This file contains instructions for compiling and installing the GRUB.
The Requirements
================
PUPA depends on some software packages installed into your system. If
GRUB depends on some software packages installed into your system. If
you don't have any of them, please obtain and install them before
configuring the PUPA.
configuring the GRUB.
* GCC 2.95 or later
* GNU Make
......@@ -17,12 +17,12 @@ configuring the PUPA.
* Other standard GNU/Unix tools
* LZO 1.02 or later
If you'd like to develop PUPA, these below are also required.
If you'd like to develop GRUB, these below are also required.
* Ruby 1.6 or later
* Autoconf 2.53 or later
Configuring the PUPA
Configuring the GRUB
====================
The `configure' shell script attempts to guess correct values for
......@@ -46,7 +46,7 @@ called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
Building the PUPA
Building the GRUB
=================
The simplest way to compile this package is:
......@@ -111,10 +111,10 @@ If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure'
the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Please note, however, that the PUPA knows where it is located in the
Please note, however, that the GRUB knows where it is located in the
filesystem. If you have installed it in an unusual location, the
system might not work properly, or at all. The chief utility of these
options for the PUPA is to allow you to "install" in some alternate
options for the GRUB is to allow you to "install" in some alternate
location, and then copy these to the actual root filesystem later.
......
......@@ -60,7 +60,7 @@ CPPFLAGS = -I. -Iinclude -I$(srcdir)/include -Wall -W
BUILD_CC = @BUILD_CC@
BUILD_CFLAGS = -g -O2
BUILD_CPPFLAGS = -I. -Iinclude -I$(srcdir)/include -Wall -W \
-DPUPA_DATADIR=\"$(pkgdatadir)\"
-DGRUB_DATADIR=\"$(pkgdatadir)\"
OBJCOPY = @OBJCOPY@
STRIP = @STRIP@
NM = @NM@
......@@ -86,14 +86,14 @@ DISK_DISTFILES = $(addprefix disk/i386/pc/,biosdisk.c partition.c)
FS_DISTFILES = $(addprefix fs/,fat.c)
INCLUDE_DISTFILES = $(addprefix include/pupa/,boot.h device.h disk.h \
INCLUDE_DISTFILES = $(addprefix include/grub/,boot.h device.h disk.h \
dl.h elf.h err.h file.h fs.h kernel.h loader.h misc.h mm.h \
net.h rescue.h symbol.h term.h types.h) \
$(addprefix include/pupa/util/,misc.h resolve.h) \
include/pupa/i386/types.h \
$(addprefix include/pupa/i386/pc/,biosdisk.h boot.h \
$(addprefix include/grub/util/,misc.h resolve.h) \
include/grub/i386/types.h \
$(addprefix include/grub/i386/pc/,biosdisk.h boot.h \
console.h init.h kernel.h loader.h memory.h partition.h) \
$(addprefix include/pupa/i386/pc/util/,biosdisk.h)
$(addprefix include/grub/i386/pc/util/,biosdisk.h)
KERN_DISTFILES = $(addprefix kern/,device.c disk.c dl.c err.c file.c \
fs.c loader.c main.c misc.c mm.c rescue.c term.c) \
......@@ -105,8 +105,8 @@ LOADER_DISTFILES = $(addprefix loader/i386/pc/,chainloader.c)
TERM_DISTFILES = $(addprefix term/i386/pc/,console.c)
UTIL_DISTFILES = $(addprefix util/,genmoddep.c misc.c resolve.c) \
$(addprefix util/i386/pc/,biosdisk.c pupa-mkimage.c \
pupa-setup.c)
$(addprefix util/i386/pc/,biosdisk.c grub-mkimage.c \
grub-setup.c)
DISTFILES = $(COMMON_DISTFILES) $(BOOT_DISTFILES) $(CONF_DISTFILES) \
$(DISK_DISTFILES) $(FS_DISTFILES) $(INCLUDE_DISTFILES) \
......@@ -120,7 +120,7 @@ SCRIPTS =
CLEANFILES =
MOSTLYCLEANFILES =
DISTCLEANFILES = config.status config.cache config.log config.h \
Makefile stamp-h include/pupa/cpu include/pupa/machine
Makefile stamp-h include/grub/cpu include/grub/machine
MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES))
# The default target.
......
New in 1.90:
* Rename the project name PUPA to GRUB. Now this version is the
developmental version of GRUB officially.
* The GRUB emulator ``grub-emu'' is added.
* Add support for newworld Mac. This should work with other
PowerPC-based machines as well, if they use IEEE 1275
(Open Firmware).
New in 0.7:
* Problems in cross-compiling PUPA are fixed.
......
......@@ -21,7 +21,7 @@ use (yet). For now, you can install GRUB 2 into a floppy by these
instructions:
$ configure && make
$ ./pupa-mkimage -v -d . -o core.img _chain ext2
$ ./grub-mkimage -v -d . -o core.img _chain ext2
$ dd if=boot.img of=/dev/fd0 bs=512 count=1
$ dd if=core.img of=/dev/fd0 bs=512 seek=1
......
-*- Mode: Outline -*-
Before working on anything in this file, it's very important that you
make contact with the core PUPA developers. Things herein might be
make contact with the core GRUB developers. Things herein might be
slightly out of date or otherwise not easy to understand at first
glance. So write to <pupa-devel@nongnu.org> first.
glance. So write to <grub-devel@gnu.org> first.
Priorities:
Reported bugs generally have top priority.
......@@ -13,8 +13,6 @@ Priorities:
higher priority.
* Replace PUPA with GRUB (or GRUB 2). !!!
* Add more filesystems (such as jfs, ffs, and reiserfs). !
* Add journal playback support to ext2fs (so it will become ext3fs).
......
This diff is collapsed.
/* -*-Asm-*- */
/*
* PUPA -- Preliminary Universal Programming Architecture for GRUB
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
......@@ -18,8 +18,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <pupa/boot.h>
#include <pupa/machine/boot.h>
#include <grub/boot.h>
#include <grub/machine/boot.h>
/*
* defines for the code go here
......@@ -83,25 +83,25 @@ cylinder_start:
.word 0
/* more space... */
. = _start + PUPA_BOOT_MACHINE_BPB_END
. = _start + GRUB_BOOT_MACHINE_BPB_END
/*
* End of BIOS parameter block.
*/
boot_version:
.byte PUPA_BOOT_VERSION_MAJOR, PUPA_BOOT_VERSION_MINOR
.byte GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR
boot_drive:
.byte 0xff /* the disk to load kernel from */
/* 0xff means use the boot drive */
force_lba:
.byte 0
kernel_address:
.word PUPA_BOOT_MACHINE_KERNEL_ADDR
.word GRUB_BOOT_MACHINE_KERNEL_ADDR
kernel_sector:
.long 1
kernel_segment:
.word PUPA_BOOT_MACHINE_KERNEL_SEG
.word GRUB_BOOT_MACHINE_KERNEL_SEG
after_BPB:
......@@ -122,7 +122,7 @@ real_start:
movw %ax, %ss
/* set up the REAL stack */
movw $PUPA_BOOT_MACHINE_STACK_SEG, %sp
movw $GRUB_BOOT_MACHINE_STACK_SEG, %sp
sti /* we're safe again */
......@@ -141,7 +141,7 @@ real_start:
MSG(notification_string)
/* do not probe LBA if the drive is a floppy */
testb $PUPA_BOOT_MACHINE_BIOS_HD_FLAG, %dl
testb $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl
jz chs_mode
/* check if LBA is supported */
......@@ -190,7 +190,7 @@ lba_mode:
movl %ebx, 8(%si)
/* the segment of buffer address */
movw $PUPA_BOOT_MACHINE_BUFFER_SEG, 6(%si)
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, 6(%si)
xorl %eax, %eax
movw %ax, 4(%si)
......@@ -211,7 +211,7 @@ lba_mode:
/* LBA read is not supported, so fallback to CHS. */
jc chs_mode
movw $PUPA_BOOT_MACHINE_BUFFER_SEG, %bx
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
jmp copy_buffer
chs_mode:
......@@ -226,7 +226,7 @@ chs_mode:
/*
* The call failed, so maybe use the floppy probe instead.
*/
testb $PUPA_BOOT_MACHINE_BIOS_HD_FLAG, %dl
testb $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl
jz floppy_probe
/* Nope, we definitely have a hard disk, and we're screwed. */
......@@ -322,7 +322,7 @@ setup_sectors:
* %al = 0x0 on success; err code on failure
*/
movw $PUPA_BOOT_MACHINE_BUFFER_SEG, %bx
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
movw %bx, %es /* load %es segment with disk buffer */
xorw %bx, %bx /* %bx = 0, put it at 0 in the segment */
......@@ -387,7 +387,7 @@ general_error:
/* go here when you need to stop the machine hard after an error condition */
stop: jmp stop
notification_string: .string "PUPA "
notification_string: .string "GRUB "
geometry_error_string: .string "Geom"
hd_probe_error_string: .string "Hard Disk"
read_error_string: .string "Read"
......@@ -419,7 +419,7 @@ message:
* number here.
*/
. = _start + PUPA_BOOT_MACHINE_WINDOWS_NT_MAGIC
. = _start + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC
nt_magic:
.long 0
.word 0
......@@ -431,7 +431,7 @@ nt_magic:
*/
part_start:
. = _start + PUPA_BOOT_MACHINE_PART_START
. = _start + GRUB_BOOT_MACHINE_PART_START
probe_values:
.byte 36, 18, 15, 9, 0
......@@ -465,7 +465,7 @@ fd_probe_error_string: .string "Floppy"
1:
/* perform read */
movw $PUPA_BOOT_MACHINE_BUFFER_SEG, %bx
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
movw $0x201, %ax
movb $0, %ch
movb $0, %dh
......@@ -480,7 +480,7 @@ fd_probe_error_string: .string "Floppy"
jmp final_init
. = _start + PUPA_BOOT_MACHINE_PART_END
. = _start + GRUB_BOOT_MACHINE_PART_END
/* the last 2 bytes in the sector 0 contain the signature */
.word PUPA_BOOT_MACHINE_SIGNATURE
.word GRUB_BOOT_MACHINE_SIGNATURE
/*
* PUPA -- Preliminary Universal Programming Architecture for GRUB
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
......@@ -17,7 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <pupa/machine/boot.h>
#include <grub/machine/boot.h>
/*
* defines for the code go here
......@@ -26,7 +26,7 @@
/* Absolute addresses
This makes the assembler generate the address without support
from the linker. (ELF can't relocate 16-bit addresses!) */
#define ABS(x) (x-_start+PUPA_BOOT_MACHINE_KERNEL_ADDR)
#define ABS(x) (x-_start+GRUB_BOOT_MACHINE_KERNEL_ADDR)
/* Print message string */
#define MSG(x) movw $ABS(x), %si; call message
......@@ -62,7 +62,7 @@ _start:
popw %si
/* this sets up for the first run through "bootloop" */
movw $ABS(firstlist - PUPA_BOOT_MACHINE_LIST_SIZE), %di
movw $ABS(firstlist - GRUB_BOOT_MACHINE_LIST_SIZE), %di
/* save the sector number of the second sector in %ebp */
movl (%di), %ebp
......@@ -119,7 +119,7 @@ lba_mode:
movl %ebx, 8(%si)
/* the segment of buffer address */
movw $PUPA_BOOT_MACHINE_BUFFER_SEG, 6(%si)
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, 6(%si)
/* save %ax from destruction! */
pushw %ax
......@@ -148,7 +148,7 @@ lba_mode:
jc read_error
movw $PUPA_BOOT_MACHINE_BUFFER_SEG, %bx
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
jmp copy_buffer
chs_mode:
......@@ -237,7 +237,7 @@ chs_mode:
* %al = 0x0 on success; err code on failure
*/
movw $PUPA_BOOT_MACHINE_BUFFER_SEG, %bx
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
movw %bx, %es /* load %es segment with disk buffer */
xorw %bx, %bx /* %bx = 0, put it at 0 in the segment */
......@@ -292,7 +292,7 @@ copy_buffer:
jne setup_sectors
/* update position to load from */
subw $PUPA_BOOT_MACHINE_LIST_SIZE, %di
subw $GRUB_BOOT_MACHINE_LIST_SIZE, %di
/* jump to bootloop */
jmp bootloop
......@@ -303,7 +303,7 @@ bootit:
/* print a newline */
MSG(notification_done)
popw %dx /* this makes sure %dl is our "boot" drive */
ljmp $0, $(PUPA_BOOT_MACHINE_KERNEL_ADDR + 0x200)
ljmp $0, $(GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200)
/*
......@@ -368,7 +368,7 @@ lastlist:
.word 0
.word 0
. = _start + 0x200 - PUPA_BOOT_MACHINE_LIST_SIZE
. = _start + 0x200 - GRUB_BOOT_MACHINE_LIST_SIZE
/* fill the first data listing with the default */
blocklist_default_start:
......@@ -381,6 +381,6 @@ blocklist_default_len:
.word 0
blocklist_default_seg:
/* this is the segment of the starting address to load the data into */
.word (PUPA_BOOT_MACHINE_KERNEL_SEG + 0x20)
.word (GRUB_BOOT_MACHINE_KERNEL_SEG + 0x20)
firstlist: /* this label has to be after the list data!!! */
/* cmain.c - Startup code for the PowerPC. */
/*
* PUPA -- Preliminary Universal Programming Architecture for GRUB
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
......@@ -21,8 +21,8 @@
#include <alloca.h>
#include <stdint.h>
#include "pupa/machine/ieee1275.h"
#include "pupa/kernel.h"
#include "grub/machine/ieee1275.h"
#include "grub/kernel.h"
struct module_info
{
......@@ -33,7 +33,7 @@ struct module_info
#define roundup(a, s) (((a) + ((s) - 1)) & ~((s) - 1))
/* OpenFirmware entry point passed to us from the real bootloader. */
intptr_t (*pupa_ieee1275_entry_fn) (void *);
intptr_t (*grub_ieee1275_entry_fn) (void *);
/* Return a help text for this architecture. */
......@@ -51,11 +51,11 @@ void
cmain (uint32_t firmware_entry)
{
char **argv, args[256];
pupa_ieee1275_phandle_t chosen;
grub_ieee1275_phandle_t chosen;
int argc = 0, actual;
long batl, batu;
pupa_ieee1275_entry_fn = (intptr_t (*)(void *)) firmware_entry;
grub_ieee1275_entry_fn = (intptr_t (*)(void *)) firmware_entry;
/* Initialize BAT registers to unmapped to not generate overlapping
mappings below. */
......@@ -83,8 +83,8 @@ cmain (uint32_t firmware_entry)
be null (just the nul-character), so check that the size
is actually greater than one. */
pupa_ieee1275_finddevice ("/chosen", &chosen);
if (pupa_ieee1275_get_property (chosen, "bootargs", args,
grub_ieee1275_finddevice ("/chosen", &chosen);
if (grub_ieee1275_get_property (chosen, "bootargs", args,
sizeof args, &actual) == 0
&& actual > 1)
{
......@@ -109,7 +109,7 @@ cmain (uint32_t firmware_entry)
/* The bootargs property does not contain the program
name, just the arguments. */
argv[0] = "pupa";
argv[0] = "grub";
/* Second time around we fill in the argv. */
str = args;
......@@ -136,13 +136,13 @@ cmain (uint32_t firmware_entry)
else
{
argv = alloca (sizeof (char *) * 2);
argv[0] = "pupa";
argv[0] = "grub";
argv[1] = 0;
argc = 1;
}
/* Now invoke the main function. */
/* XXX: pupa_main does not parse arguments yet. */
pupa_main ();
/* XXX: grub_main does not parse arguments yet. */
grub_main ();
/* Never reached. */
}
/* crt0.S - Startup code for the PowerPC. */
/*
* PUPA -- Preliminary Universal Programming Architecture for GRUB
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
......
This diff is collapsed.
/* boot.c - command to boot an operating system */
/*
* PUPA -- Preliminary Universal Programming Architecture for GRUB
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003 Free Software Foundation, Inc.
*
* PUPA is free software; you can redistribute it and/or modify
* 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 2 of the License, or
* (at your option) any later version.
......@@ -14,52 +14,52 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PUPA; if not, write to the Free Software
* along with GRUB; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <pupa/normal.h>
#include <pupa/dl.h>
#include <pupa/arg.h>
#include <pupa/misc.h>
#include <pupa/loader.h>
#include <grub/normal.h>
#include <grub/dl.h>
#include <grub/arg.h>
#include <grub/misc.h>
#include <grub/loader.h>
static pupa_err_t
pupa_cmd_boot (struct pupa_arg_list *state __attribute__ ((unused)),
static grub_err_t
grub_cmd_boot (struct grub_arg_list *state __attribute__ ((unused)),
int argc, char **args __attribute__ ((unused)))
{
if (argc)
return pupa_error (PUPA_ERR_BAD_ARGUMENT, "too many arguments");
return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many arguments");
pupa_loader_boot ();
grub_loader_boot ();
return 0;
}
#ifdef PUPA_UTIL
#ifdef GRUB_UTIL
void
pupa_boot_init (void)
grub_boot_init (void)
{
pupa_register_command ("boot", pupa_cmd_boot, PUPA_COMMAND_FLAG_BOTH,
grub_register_command ("boot", grub_cmd_boot, GRUB_COMMAND_FLAG_BOTH,
"boot", "Boot an operating system", 0);
}
void
pupa_boot_fini (void)
grub_boot_fini (void)
{
pupa_unregister_command ("boot");
grub_unregister_command ("boot");
}
#else /* ! PUPA_UTIL */
PUPA_MOD_INIT
#else /* ! GRUB_UTIL */
GRUB_MOD_INIT
{
(void)mod; /* To stop warning. */
pupa_register_command ("boot", pupa_cmd_boot, PUPA_COMMAND_FLAG_BOTH,
grub_register_command ("boot", grub_cmd_boot, GRUB_COMMAND_FLAG_BOTH,
"boot", "Boot an operating system", 0);
}
PUPA_MOD_FINI
GRUB_MOD_FINI
{
pupa_unregister_command ("boot");
grub_unregister_command ("boot");
}
#endif /* ! PUPA_UTIL */
#endif /* ! GRUB_UTIL */
/* cat.c - command to show the contents of a file */
/*
* PUPA -- Preliminary Universal Programming Architecture for GRUB
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003 Free Software Foundation, Inc.
*
* PUPA is free software; you can redistribute it and/or modify
* 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 2 of the License, or
* (at your option) any later version.
......@@ -14,35 +14,35 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PUPA; if not, write to the Free Software
* along with GRUB; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <pupa/normal.h>
#include <pupa/dl.h>
#include <pupa/arg.h>
#include <pupa/file.h>
#include <pupa/disk.h>
#include <pupa/term.h>
#include <pupa/misc.h>
#include <grub/normal.h>
#include <grub/dl.h>
#include <grub/arg.h>
#include <grub/file.h>
#include <grub/disk.h>
#include <grub/term.h>
#include <grub/misc.h>
static pupa_err_t
pupa_cmd_cat (struct pupa_arg_list *state __attribute__ ((unused)),
static grub_err_t
grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)),
int argc, char **args)
{
pupa_file_t file;
char buf[PUPA_DISK_SECTOR_SIZE];
pupa_ssize_t size;
grub_file_t file;
char buf[GRUB_DISK_SECTOR_SIZE];
grub_ssize_t size;
if (argc != 1)
return pupa_error (PUPA_ERR_BAD_ARGUMENT, "file name required");
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
file = pupa_file_open (args[0]);
file = grub_file_open (args[0]);
if (! file)
return 0;
while ((size = pupa_file_read (file, buf, sizeof (buf))) > 0)
while ((size = grub_file_read (file, buf, sizeof (buf))) > 0)
{
int i;
......@@ -50,48 +50,48 @@ pupa_cmd_cat (struct pupa_arg_list *state __attribute__ ((unused)),
{
unsigned char c = buf[i];
if (pupa_isprint (c) || pupa_isspace (c))
pupa_putchar (c);
if (grub_isprint (c) || grub_isspace (c))
grub_putchar (c);
else
{
pupa_setcolorstate (PUPA_TERM_COLOR_HIGHLIGHT);
pupa_printf ("<%x>", (int) c);
pupa_setcolorstate (PUPA_TERM_COLOR_STANDARD);
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
grub_printf ("<%x>", (int) c);
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
}
}
}
pupa_putchar ('\n');
pupa_refresh ();
pupa_file_close (file);
grub_putchar ('\n');
grub_refresh ();
grub_file_close (file);
return 0;
}
#ifdef PUPA_UTIL
#ifdef GRUB_UTIL
void
pupa_cat_init (void)
grub_cat_init (void)
{
pupa_register_command ("cat", pupa_cmd_cat, PUPA_COMMAND_FLAG_BOTH,
grub_register_command ("cat", grub_cmd_cat, GRUB_COMMAND_FLAG_BOTH,
"cat FILE", "Show the contents of a file", 0);
}
void
pupa_cat_fini (void)
grub_cat_fini (void)
{
pupa_unregister_command ("cat");
grub_unregister_command ("cat");
}
#else /* ! PUPA_UTIL */
PUPA_MOD_INIT
#else /* ! GRUB_UTIL */
GRUB_MOD_INIT
{
(void)mod; /* To stop warning. */
pupa_register_command ("cat", pupa_cmd_cat, PUPA_COMMAND_FLAG_BOTH,
grub_register_command ("cat", grub_cmd_cat, GRUB_COMMAND_FLAG_BOTH,
"cat FILE", "Show the contents of a file", 0);
}
PUPA_MOD_FINI
GRUB_MOD_FINI
{
pupa_unregister_command ("cat");
grub_unregister_command ("cat");
}
#endif /* ! PUPA_UTIL */
#endif /* ! GRUB_UTIL */
/* cmd.c - command to cmp an operating system */
/*
* PUPA -- Preliminary Universal Programming Architecture for GRUB
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003 Free Software Foundation, Inc.
*
* PUPA is free software; you can redistribute it and/or modify
* 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 2 of the License, or
* (at your option) any later version.
......@@ -14,57 +14,57 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PUPA; if not, write to the Free Software
* along with GRUB; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <pupa/normal.h>
#include <pupa/dl.h>
#include <pupa/arg.h>
#include <pupa/misc.h>
#include <pupa/file.h>
#include <grub/normal.h>