some bug fixes

This commit is contained in:
okuji committed 1999-05-12 02:43:19 +00:00
1 parent d654cfa0fd
commit 22c4b56b59
28 files changed
+890 -563

No files matched your search

+65 -45
View File
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Makefile.in generated automatically by automake 1.4a from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,8 +10,7 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = /bin/sh
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -32,7 +31,7 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -49,6 +48,7 @@ INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
@@ -59,39 +59,42 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
AMTARFLAGS = @AMTARFLAGS@
CC = @CC@
LD = @LD@
MAKEINFO = @MAKEINFO@
OBJCOPY = @OBJCOPY@
PACKAGE = @PACKAGE@
TAR = @TAR@
VERSION = @VERSION@
host_cpu = @host_cpu@
host_vendor = @host_vendor@
sbingrub = @sbingrub@
stage2debug = @stage2debug@
noinst_HEADERS = apic.h defs.h dir.h disk_inode.h disk_inode_ffs.h \
fat.h filesys.h freebsd.h fs.h i386-elf.h imgact_aout.h \
mb_header.h mb_info.h pc_slice.h shared.h smp-imps.h
EXTRA_DIST = asm.S boot.c char_io.c cmdline.c common.c disk_io.c \
fsys_ext2fs.c fsys_fat.c fsys_ffs.c gunzip.c smp-imps.c \
stage1_5.c stage2.c
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
HEADERS = $(noinst_HEADERS)
DIST_COMMON = Makefile.am Makefile.in
DIST_COMMON = $(noinst_HEADERS) Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
all: Makefile $(HEADERS)
DISTFILES = $(DIST_COMMON) $(SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu shared_src/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
@@ -102,8 +105,12 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
@@ -136,60 +143,73 @@ distdir: $(DISTFILES)
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu shared_src/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
info:
dvi:
check: all
$(MAKE)
installcheck:
install-exec:
@$(NORMAL_INSTALL)
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data:
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall:
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile $(HEADERS)
all-redirect: all-am
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-tags mostlyclean-generic
mostlyclean-am: mostlyclean-tags mostlyclean-generic
clean: clean-tags clean-generic mostlyclean
mostlyclean: mostlyclean-am
distclean: distclean-tags distclean-generic clean
-rm -f config.status
clean-am: clean-tags clean-generic mostlyclean-am
maintainer-clean: maintainer-clean-tags maintainer-clean-generic \
distclean
clean: clean-am
distclean-am: distclean-tags distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: tags mostlyclean-tags distclean-tags clean-tags \
maintainer-clean-tags distdir info dvi installcheck install-exec \
install-data install uninstall all installdirs mostlyclean-generic \
maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
+6 -1
View File
@@ -35,9 +35,14 @@ ENTRY(start)
.globl _start
_start:
/*
* Guarantee that "start" is loaded at 0x0:0x8000.
* Guarantee that "start" is loaded at 0x0:0x8000 in stage2 and
* at 0x0:0x2000 in stage1.5.
*/
#ifndef STAGE1_5
ljmp $0, $(codestart - EXT_C(start) + 0x8000)
#else
ljmp $0, $(codestart - EXT_C(start) + 0x2000)
#endif
/*
* Compatibility version number
-3
View File
@@ -118,9 +118,6 @@ get_diskinfo (int drive, struct geometry *geometry)
{
int err;
/* Clear GEOMETRY. */
memset (geometry, 0, sizeof (struct geometry));
if (drive & 0x80)
{
/* hard disk */
+8 -3
View File
@@ -105,6 +105,7 @@ grub_printf (char *format,...)
putchar (*(ptr++));
break;
#ifndef STAGE1_5
case 'c':
putchar ((*(dataptr++)) & 0xff);
break;
@@ -115,6 +116,7 @@ grub_printf (char *format,...)
while ((c = *(ptr++)) != 0)
putchar (c);
break;
#endif
}
}
}
@@ -414,7 +416,6 @@ get_cmdline (char *prompt, char *commands, char *cmdline, int maxlen,
#endif /* STAGE1_5 */
#if !defined(STAGE1_5) || !defined(NO_BLOCK_FILES)
int
get_based_digit (int c, int base)
{
@@ -492,7 +493,6 @@ grub_tolower (int c)
return c;
}
#endif /* !defined(STAGE1_5) || !defined(NO_BLOCK_FILES) */
int
@@ -505,6 +505,7 @@ grub_isspace (int c)
}
#ifndef STAGE1_5
int
grub_strncat (char *s1, char *s2, int n)
{
@@ -540,7 +541,7 @@ grub_strcmp (char *s1, char *s2)
return 0;
}
#endif /* ! STAGE1_5 */
int
substring (char *s1, char *s2)
@@ -562,6 +563,7 @@ substring (char *s1, char *s2)
}
#ifndef STAGE1_5
char *
grub_strstr (char *s1, char *s2)
{
@@ -580,6 +582,7 @@ grub_strstr (char *s1, char *s2)
return 0;
}
#endif /* ! STAGE1_5 */
int
@@ -635,6 +638,7 @@ grub_memmove (char *to, char *from, int len)
}
#ifndef STAGE1_5
void *
grub_memset (void *start, int c, int len)
{
@@ -648,3 +652,4 @@ grub_memset (void *start, int c, int len)
return errnum ? NULL : start;
}
#endif /* ! STAGE1_5 */
+3 -4
View File
@@ -439,9 +439,8 @@ returnit:
if (!errnum &&
grub_read ((char *) SCRATCHADDR, SECTOR_SIZE) == SECTOR_SIZE)
{
if (*((long *)SCRATCHADDR) != 0x8070ea
|| (*((short *)(SCRATCHADDR+STAGE2_VER_MAJ_OFFS))
!= COMPAT_VERSION))
if (*((short *)(SCRATCHADDR+STAGE2_VER_MAJ_OFFS))
!= COMPAT_VERSION)
errnum = ERR_BAD_VERSION;
else
{
@@ -467,7 +466,7 @@ returnit:
while ((*(str++) = *(ptr++)) != 0); /* do copy */
}
grub_read ((char *) 0x100000, -1);
grub_read (RAW_ADDR (0x100000), -1);
buf_track = -1;
+1 -2
View File
@@ -1,4 +1,3 @@
/*
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -59,7 +58,7 @@ quad; /* an 8-byte item */
typedef unsigned int time_t; /* an unsigned int */
typedef unsigned int daddr_t; /* an unsigned int */
typedef unsigned int off_t; /* another unsigned int */
typedef unsigned int mach_off_t; /* another unsigned int */
typedef unsigned short uid_t;
typedef unsigned short gid_t;
+15 -18
View File
@@ -230,8 +230,7 @@ devread (int sector, int byte_offset, int byte_len, char *buf)
byte_len, buf);
}
#if !defined(STAGE1_5) || !defined(NO_BLOCK_FILES)
#ifndef STAGE1_5
static int
sane_partition (void)
{
@@ -247,20 +246,22 @@ sane_partition (void)
errnum = ERR_DEV_VALUES;
return 0;
}
#endif /* !defined(STAGE1_5) || !defined(NO_BLOCK_FILES) */
#endif /* ! STAGE1_5 */
#ifndef STAGE1_5
static void
attempt_mount (void)
{
#ifndef STAGE1_5
for (fsys_type = 0; fsys_type < NUM_FSYS
&& (*(fsys_table[fsys_type].mount_func)) () != 1; fsys_type++);
if (fsys_type == NUM_FSYS && errnum == ERR_NONE)
errnum = ERR_FSYS_MOUNT;
#else
if ((*(fsys_table[0].mount_func)) () != 1)
errnum = ERR_FSYS_MOUNT;
#endif
}
#endif /* STAGE1_5 */
#ifndef STAGE1_5
@@ -317,7 +318,6 @@ check_and_print_mount (void)
#endif /* STAGE1_5 */
#if !defined(STAGE1_5) || !defined(NO_BLOCK_FILES)
static int
check_BSD_parts (int flags)
{
@@ -381,13 +381,13 @@ check_BSD_parts (int flags)
errnum = ERR_BAD_PART_TABLE;
return 0;
}
#endif /* !defined(STAGE1_5) || !defined(NO_BLOCK_FILES) */
#if !defined(STAGE1_5) || !defined(NO_BLOCK_FILES)
/* This isn't static, because the GRUB utility's char_io.c (memcheck)
needs to know about it as a special case. */
#ifndef STAGE1_5
char cur_part_desc[16];
#endif
static int
real_open_partition (int flags)
@@ -399,9 +399,11 @@ real_open_partition (int flags)
* The "rawread" is probably unnecessary here, but it is good to
* know it works.
*/
#ifndef STAGE1_5
if (!sane_partition ()
|| !rawread (current_drive, 0, 0, SECTOR_SIZE, mbr_buf))
return 0;
#endif
bsd_evil_hack = 0;
current_slice = 0;
@@ -451,7 +453,9 @@ real_open_partition (int flags)
current_slice = PC_SLICE_TYPE (mbr_buf, i);
part_start = part_offset + PC_SLICE_START (mbr_buf, i);
part_length = PC_SLICE_LENGTH (mbr_buf, i);
#ifndef STAGE1_5
memmove (cur_part_desc, mbr_buf + PC_SLICE_OFFSET + (i << 4), 16);
#endif
/*
* Is this PC partition entry valid?
@@ -566,10 +570,8 @@ open_partition (void)
{
return real_open_partition (0);
}
#endif /* !defined(STAGE1_5) || !defined(NO_BLOCK_FILES) */
#ifndef STAGE1_5
/* XX used for device completion in 'set_device' and 'print_completions' */
static int incomplete, disk_choice;
static enum
@@ -750,9 +752,7 @@ set_device (char *device)
return retval;
}
#endif /* STAGE1_5 */
#ifndef STAGE1_5
/*
* This performs a "mount" on the current device, both drive and partition
* number.
@@ -769,7 +769,6 @@ open_device (void)
return 1;
}
#endif /* STAGE1_5 */
#ifndef STAGE1_5
@@ -804,7 +803,6 @@ set_bootdev (int hdbias)
#endif /* STAGE1_5 */
#ifndef STAGE1_5
static char *
setup_part (char *filename)
{
@@ -849,12 +847,13 @@ setup_part (char *filename)
else
errnum = 0;
#ifndef STAGE1_5
if (!sane_partition ())
return 0;
#endif
return filename;
}
#endif /* STAGE1_5 */
#ifndef STAGE1_5
@@ -962,10 +961,8 @@ grub_open (char *filename)
set it to zero before returning if opening a file! */
filepos = 0;
#ifndef STAGE1_5
if (!(filename = setup_part (filename)))
return 0;
#endif /* STAGE1_5 */
#ifndef NO_BLOCK_FILES
block_file = 0;
+2 -3
View File
@@ -1,4 +1,3 @@
/*
* Mach Operating System
* Copyright (c) 1991,1990 Carnegie Mellon University
@@ -69,8 +68,8 @@
*/
#define BBSIZE 8192
#define SBSIZE 8192
#define BBOFF ((off_t)(0))
#define SBOFF ((off_t)(BBOFF + BBSIZE))
#define BBOFF ((mach_off_t)(0))
#define SBOFF ((mach_off_t)(BBOFF + BBSIZE))
#define BBLOCK ((daddr_t)(0))
#define SBLOCK ((daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE))
+1 -1
View File
@@ -167,7 +167,7 @@ struct ext2_inode
#define NAME_MAX 255 /* # chars in a file name */
/* linux/posix_type.h */
typedef long off_t;
typedef long linux_off_t;
/* linux/ext2fs.h */
#define EXT2_NAME_LEN 255