add hide and unhide commands. add additional minix fs support. some code cleanups.

This commit is contained in:
okuji 1999-08-29 16:23:12 +00:00
parent 434d8607cc
commit 83b3d5eee0
17 changed files with 249 additions and 79 deletions

View file

@ -1,3 +1,48 @@
1999-08-30 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
From Edward Killips <ekillips@triton.net>:
* stage2/cmdline.c (commands): Added hide and unhide.
(enter_cmdline): Likewise.
* stage2/disk_io.c (unhide_partition): New function.
(hide_partition): Likewise.
* stage2/pc_slice.h (PC_SLICE_TYPE_HIDDEN_FLAG): New macro.
1999-08-29 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
From Pavel Roskin <pavel_roskin@geocities.com>:
* stage2/fsys_minix.c (namelen): New variable.
(MINIX_NAME_LEN): Deleted.
(minix_mount): Set NAMELEN to 14 if SUPRTBLOCK->S_MAGIC is
MINIX_SUPER_MAGIC, and set NAMELEN to 30 if it is
MINIX_SUPER_MAGIC2.
(minix_dir): Use NAMELEN instead of MINIX_NAME_LEN.
1999-08-29 Pavel Roskin <pavel_roslin@geocities.com>
* grub/Makefile.am, stage1/Makefile.am, stage2/Makefile.am:
Avoid using variables inclosed in '@' because they cannot be
overridden at the make time.
1999-08-29 Pavel Roskin <pavel_roskin@geocities.com>
* stage2/fsys_fat.c (fat_create_blocklist): Return 1 for the
root directory on FAT12 and FAT16.
1999-08-27 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* stage2/boot.c (load_image): Accept two arguments, KERNEL and
ARG. And use them instead of CUR_CMDLINE.
(load_module): Accept two arguments, MODULE and ARG. And use
them instead of CUR_CMDLINE.
(load_initrd): Accept one argument, INITRD. And use it instead
of CUR_CMDLINE.
(bsd_boot): Accept one additional argument, ARG. And use it
instead of CUR_CMDLINE.
* stage2/cmdline.c (enter_cmdline): Use MB_CMDLINE instead of
HEAP for the Multiboot command-line buffer.
* stage2/shared.h (MB_CMDLINE_BUF): New macro.
(MB_CMDLINE_BUFLEN): Likewise.
1999-08-26 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* docs/Makefile.am [GRUB_MAINT] (grub.8): The argument for the

1
NEWS
View file

@ -8,6 +8,7 @@ New in 0.5.93:
ext2fs, FAT and FFS support in Stage 2 respectively.
* FAT32 support is added.
* Minix fs support is added.
* The new commands "hide" and "unhide" are added.
New in 0.5.92 - 1999-07-26:
* Bug fixes (i.e. Stage 1.5 can work fine again).

1
THANKS
View file

@ -11,6 +11,7 @@ Bradford Hovinen <hovinen@redrose.net>
Brian Brunswick <brian@skarpsey.demon.co.uk>
Bryan Ford <baford@cs.utah.edu>
Dan J. Walters <djw@cs.utexas.edu>
Edward Killips <ekillips@triton.net>
Eric Hanchrow <erich@microsoft.com>
Heiko Schroeder <heiko@pool.informatik.rwth-aachen.de>
Jochen Hoenicke <jochen@gnu.org>

2
TODO
View file

@ -35,6 +35,4 @@ Clean up and enhance the manuals, especially concept indexes.
Add more filesystems support (XFS, NTFS, etc.)
??? Add hide and unhide facilities.
Add remote console support (serial, parallel and net).

View file

@ -1,8 +1,8 @@
sbin_PROGRAMS = grub
AM_CFLAGS = @GRUB_CFLAGS@ -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \
AM_CFLAGS = $(GRUB_CFLAGS) -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \
-DFSYS_FFS=1 -DFSYS_MINIX=1 -fwritable-strings \
-I$(top_srcdir)/stage2 -I$(top_srcdir)/stage1
grub_SOURCES = main.c asmstub.c getopt.c getopt1.c getopt.h
grub_LDADD = ../stage2/libgrub.a @GRUB_LIBS@
grub_LDADD = ../stage2/libgrub.a $(GRUB_LIBS)

View file

@ -81,13 +81,13 @@ install_sh = @install_sh@
sbin_PROGRAMS = grub
AM_CFLAGS = @GRUB_CFLAGS@ -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \
AM_CFLAGS = $(GRUB_CFLAGS) -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \
-DFSYS_FFS=1 -DFSYS_MINIX=1 -fwritable-strings \
-I$(top_srcdir)/stage2 -I$(top_srcdir)/stage1
grub_SOURCES = main.c asmstub.c getopt.c getopt1.c getopt.h
grub_LDADD = ../stage2/libgrub.a @GRUB_LIBS@
grub_LDADD = ../stage2/libgrub.a $(GRUB_LIBS)
subdir = grub
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =

View file

@ -3,7 +3,7 @@ nodist_pkgdata_DATA = stage1 stage1_lba
CLEANFILES = $(pkgdata_DATA)
# We can't use builtins or standard includes.
AM_CFLAGS = @STAGE1_CFLAGS@ -fno-builtin -nostdinc
AM_CFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
LDFLAGS = -nostdlib -Wl,-N -Wl,-Ttext -Wl,7C00
noinst_PROGRAMS = stage1.exec stage1_lba.exec

View file

@ -82,7 +82,7 @@ nodist_pkgdata_DATA = stage1 stage1_lba
CLEANFILES = $(pkgdata_DATA)
# We can't use builtins or standard includes.
AM_CFLAGS = @STAGE1_CFLAGS@ -fno-builtin -nostdinc
AM_CFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
LDFLAGS = -nostdlib -Wl,-N -Wl,-Ttext -Wl,7C00
noinst_PROGRAMS = stage1.exec stage1_lba.exec

View file

@ -16,7 +16,7 @@ noinst_LIBRARIES = libgrub.a
libgrub_a_SOURCES = boot.c common.c char_io.c cmdline.c disk_io.c \
gunzip.c fsys_ffs.c fsys_ext2fs.c fsys_fat.c fsys_minix.c \
stage2.c
libgrub_a_CFLAGS = @GRUB_CFLAGS@ -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 \
libgrub_a_CFLAGS = $(GRUB_CFLAGS) -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 \
-DFSYS_FAT=1 -DFSYS_FFS=1 -DFSYS_MINIX=1 -fwritable-strings
# Stage 2 and Stage 1.5's.
@ -29,7 +29,7 @@ noinst_PROGRAMS = stage2.exec e2fs_stage1_5.exec fat_stage1_5.exec \
MOSTLYCLEANFILES = $(noinst_PROGRAMS)
STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8000
STAGE2_COMPILE = @STAGE2_CFLAGS@ -fno-builtin -nostdinc
STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc
STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1 \
@ -40,7 +40,7 @@ STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1 \
stage2_exec_SOURCES = asm.S boot.c common.c char_io.c cmdline.c \
disk_io.c gunzip.c stage2.c bios.c smp-imps.c fsys_ext2fs.c \
fsys_fat.c fsys_ffs.c fsys_minix.c
stage2_exec_CFLAGS = $(STAGE2_COMPILE) @FSYS_CFLAGS@
stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
stage2_exec_LDFLAGS = $(STAGE2_LINK)
# For e2fs_stage1_5 target.

View file

@ -98,7 +98,7 @@ libgrub_a_SOURCES = boot.c common.c char_io.c cmdline.c disk_io.c \
gunzip.c fsys_ffs.c fsys_ext2fs.c fsys_fat.c fsys_minix.c \
stage2.c
libgrub_a_CFLAGS = @GRUB_CFLAGS@ -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 \
libgrub_a_CFLAGS = $(GRUB_CFLAGS) -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 \
-DFSYS_FAT=1 -DFSYS_FFS=1 -DFSYS_MINIX=1 -fwritable-strings
@ -114,7 +114,7 @@ noinst_PROGRAMS = stage2.exec e2fs_stage1_5.exec fat_stage1_5.exec \
MOSTLYCLEANFILES = $(noinst_PROGRAMS)
STAGE2_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,8000
STAGE2_COMPILE = @STAGE2_CFLAGS@ -fno-builtin -nostdinc
STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc
STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
STAGE1_5_COMPILE = $(STAGE2_COMPILE) -DNO_DECOMPRESSION=1 -DSTAGE1_5=1 \
@ -127,7 +127,7 @@ stage2_exec_SOURCES = asm.S boot.c common.c char_io.c cmdline.c \
disk_io.c gunzip.c stage2.c bios.c smp-imps.c fsys_ext2fs.c \
fsys_fat.c fsys_ffs.c fsys_minix.c
stage2_exec_CFLAGS = $(STAGE2_COMPILE) @FSYS_CFLAGS@
stage2_exec_CFLAGS = $(STAGE2_COMPILE) $(FSYS_CFLAGS)
stage2_exec_LDFLAGS = $(STAGE2_LINK)
# For e2fs_stage1_5 target.

View file

@ -39,7 +39,7 @@ static struct mod_list mll[99];
*/
int
load_image (void)
load_image (char *kernel, char *arg)
{
int len, i, exec_type = 0, align_4k = 1, type = 0;
unsigned long flags = 0, text_len = 0, data_len = 0, bss_len = 0;
@ -59,7 +59,7 @@ load_image (void)
buffer by default */
pu.aout = (struct exec *) buffer;
if (!grub_open (cur_cmdline))
if (!grub_open (kernel))
return 0;
if (!(len = grub_read (buffer, MULTIBOOT_SEARCH)) || len < 32)
@ -213,7 +213,7 @@ load_image (void)
char *vga;
/* Find the substring "vga=". */
vga = grub_strstr (cur_cmdline, "vga=");
vga = grub_strstr (arg, "vga=");
if (vga)
{
char *value = vga + 4;
@ -250,7 +250,7 @@ load_image (void)
/* copy command-line plus memory hack to staging area */
{
char *src = cur_cmdline;
char *src = arg;
char *dest = (char *) (CL_MY_LOCATION + 4);
memmove ((char *) CL_MY_LOCATION, "mem=", 4);
@ -290,7 +290,7 @@ load_image (void)
return 0;
/* fill the multiboot info structure */
mbi.cmdline = (int) cur_cmdline;
mbi.cmdline = (int) arg;
mbi.mods_count = 0;
mbi.mods_addr = 0;
mbi.boot_device = (saved_drive << 24) | saved_partition;
@ -473,14 +473,14 @@ load_image (void)
}
int
load_module (void)
load_module (char *module, char *arg)
{
int len;
/* if we are supposed to load on 4K boundaries */
cur_addr = (cur_addr + 0xFFF) & 0xFFFFF000;
if (!grub_open (cur_cmdline) || !(len = grub_read ((char *) cur_addr, -1)))
if (!grub_open (module) || !(len = grub_read ((char *) cur_addr, -1)))
return 0;
printf (" [Multiboot-module @ 0x%x, 0x%x bytes]\n", cur_addr, len);
@ -489,7 +489,7 @@ load_module (void)
mbi.flags |= MB_INFO_MODS;
mbi.mods_addr = (int) mll;
mll[mbi.mods_count].cmdline = (int) cur_cmdline;
mll[mbi.mods_count].cmdline = (int) arg;
mll[mbi.mods_count].mod_start = cur_addr;
cur_addr += len;
mll[mbi.mods_count].mod_end = cur_addr;
@ -502,12 +502,12 @@ load_module (void)
}
int
load_initrd (void)
load_initrd (char *initrd)
{
int len;
long *ramdisk, moveto;
if (!grub_open (cur_cmdline) || !(len = grub_read ((char *) cur_addr, -1)))
if (! grub_open (initrd) || ! (len = grub_read ((char *) cur_addr, -1)))
return 0;
moveto = ((mbi.mem_upper + 0x400) * 0x400 - len) & 0xfffff000;
@ -532,7 +532,7 @@ load_initrd (void)
void
bsd_boot (int type, int bootdev)
bsd_boot (int type, int bootdev, char *arg)
{
char *str;
int clval = 0, i;
@ -540,8 +540,8 @@ bsd_boot (int type, int bootdev)
stop_floppy ();
while (*(++cur_cmdline) && *cur_cmdline != ' ');
str = cur_cmdline;
while (*(++arg) && *arg != ' ');
str = arg;
while (*str)
{
if (*str == '-')
@ -579,10 +579,10 @@ bsd_boot (int type, int bootdev)
bi.bi_version = BOOTINFO_VERSION;
*cur_cmdline = 0;
while ((--cur_cmdline) > (char *) (mbi.cmdline) && *cur_cmdline != '/');
if (*cur_cmdline == '/')
bi.bi_kernelname = cur_cmdline + 1;
*arg = 0;
while ((--arg) > (char *) MB_CMDLINE_BUF && *arg != '/');
if (*arg == '/')
bi.bi_kernelname = arg + 1;
else
bi.bi_kernelname = 0;

View file

@ -68,7 +68,7 @@ char commands[] =
" Possible commands are: \"pause= ...\", \"uppermem= <kbytes>\", \"root= <device>\",
\"rootnoverify= <device>\", \"chainloader= <file>\", \"kernel= <file> ...\",
\"testload= <file>\", \"read= <addr>\", \"displaymem\", \"impsprobe\",
\"geometry= <drive>\",
\"geometry= <drive>\", \"hide= <device>\", \"unhide= <device>\",
\"fstest\", \"debug\", \"module= <file> ...\", \"modulenounzip= <file> ...\",
\"color= <normal> [<highlight>]\", \"makeactive\", \"boot\", \"quit\" and
\"install= <stage1_file> [d] <dest_dev> <file> <addr> [p] [<config_file>]\"\n";
@ -117,7 +117,8 @@ enter_cmdline (char *script, char *heap)
{
int bootdev, cmd_len, type = 0, run_cmdline = 1, have_run_cmdline = 0;
char *cur_heap = heap, *cur_entry = script, *old_entry;
char *mb_cmdline = (char *) MB_CMDLINE_BUF;
/* initialization */
saved_drive = boot_drive;
saved_partition = install_partition;
@ -185,20 +186,20 @@ returnit:
if (run_cmdline && get_cmdline (PACKAGE "> ", commands, cur_heap, 2048, 0))
return CMDLINE_ERROR;
if (substring("boot", cur_heap) == 0 || (script && !*cur_heap))
if (substring ("boot", cur_heap) == 0 || (script && !*cur_heap))
{
if ((type == 'f') | (type == 'n'))
bsd_boot(type, bootdev);
bsd_boot (type, bootdev, (char *) MB_CMDLINE_BUF);
if (type == 'l')
linux_boot();
linux_boot ();
if (type == 'L')
big_linux_boot();
big_linux_boot ();
if (type == 'c')
{
gateA20(0);
gateA20 (0);
boot_drive = saved_drive;
chain_stage1(0, BOOTSEC_LOCATION, BOOTSEC_LOCATION-16);
chain_stage1 (0, BOOTSEC_LOCATION, BOOTSEC_LOCATION-16);
}
if (!type)
@ -271,17 +272,21 @@ returnit:
}
}
}
else if (substring("kernel", cur_heap) < 1)
else if (substring ("kernel", cur_heap) < 1)
{
/* make sure it's at the beginning of the boot heap area */
memmove (heap, cur_heap,
cmd_len + (((int)cur_cmdline) - ((int)cur_heap)));
cur_cmdline = heap + (((int)cur_cmdline) - ((int)cur_heap));
cur_heap = heap;
if ((type = load_image()) != 0)
cur_heap = cur_cmdline + cmd_len;
/* Reset MB_CMDLINE. */
mb_cmdline = (char *) MB_CMDLINE_BUF;
if (cmd_len + 1 > MB_CMDLINE_BUFLEN)
errnum = ERR_WONT_FIT;
else
{
/* Copy the command-line to MB_CMDLINE. */
grub_memmove (mb_cmdline, cur_cmdline, cmd_len + 1);
if ((type = load_image (cur_cmdline, mb_cmdline)) != 0)
mb_cmdline += cmd_len + 1;
}
}
else if (substring("module", cur_heap) < 1)
else if (substring ("module", cur_heap) < 1)
{
if (type == 'm')
{
@ -291,17 +296,25 @@ returnit:
if (cur_heap[6] == 'n')
no_decompression = 1;
#endif /* NO_DECOMPRESSION */
if (load_module())
cur_heap = cur_cmdline + cmd_len;
if (mb_cmdline + cmd_len + 1
> (char *) MB_CMDLINE_BUF + MB_CMDLINE_BUFLEN)
errnum = ERR_WONT_FIT;
else
{
/* Copy the command-line to MB_CMDLINE. */
grub_memmove (mb_cmdline, cur_cmdline, cmd_len + 1);
if (load_module (cur_cmdline, mb_cmdline))
mb_cmdline += cmd_len + 1;
}
#ifndef NO_DECOMPRESSION
no_decompression = 0;
#endif /* NO_DECOMPRESSION */
}
else if (type == 'L' || type == 'l')
{
load_initrd ();
load_initrd (cur_cmdline);
}
else
errnum = ERR_NEED_MB_KERNEL;
@ -310,7 +323,7 @@ returnit:
{
if (type == 'L' || type == 'l')
{
load_initrd ();
load_initrd (cur_cmdline);
}
else
errnum = ERR_NEED_LX_KERNEL;
@ -693,6 +706,28 @@ returnit:
}
}
}
else if (substring ("hide", cur_heap) < 1)
{
set_device (cur_cmdline);
if (! errnum)
{
saved_partition = current_partition;
saved_drive = current_drive;
hide_partition ();
}
}
else if (substring ("unhide", cur_heap) < 1)
{
set_device (cur_cmdline);
if (! errnum)
{
saved_partition = current_partition;
saved_drive = current_drive;
unhide_partition ();
}
}
else if (*cur_heap && *cur_heap != ' ')
errnum = ERR_UNRECOGNIZED;

View file

@ -311,6 +311,69 @@ make_saved_active (void)
return 1;
}
int
unhide_partition (void)
{
if (saved_drive)
{
int part = saved_partition >> 16;
if (part > 3)
{
errnum = ERR_NO_PART;
return 0;
}
if (! rawread (saved_drive, 0, 0, SECTOR_SIZE, (char *) SCRATCHADDR))
return 0;
if (PC_SLICE_TYPE (SCRATCHADDR, part) & PC_SLICE_TYPE_HIDDEN_FLAG)
{
PC_SLICE_TYPE (SCRATCHADDR, part) ^= PC_SLICE_TYPE_HIDDEN_FLAG;
buf_track = -1;
if (biosdisk (BIOSDISK_WRITE, saved_drive, &buf_geom,
0, 1, SCRATCHSEG))
{
errnum = ERR_WRITE;
return 0;
}
}
}
return 1;
}
int
hide_partition (void)
{
if (saved_drive)
{
int part = saved_partition >> 16;
if (part > 3)
{
errnum = ERR_NO_PART;
return 0;
}
if (! rawread (saved_drive, 0, 0, SECTOR_SIZE, (char *) SCRATCHADDR))
return 0;
if (! (PC_SLICE_TYPE (SCRATCHADDR, part) & PC_SLICE_TYPE_HIDDEN_FLAG))
{
PC_SLICE_TYPE (SCRATCHADDR, part) |= PC_SLICE_TYPE_HIDDEN_FLAG;
buf_track = -1;
if (biosdisk (BIOSDISK_WRITE, saved_drive, &buf_geom,
0, 1, SCRATCHSEG))
{
errnum = ERR_WRITE;
return 0;
}
}
}
return 1;
}
static void
check_and_print_mount (void)

View file

@ -87,6 +87,7 @@ fat_create_blocklist (int first_fat_entry)
BLK_BLKSTART (BLK_BLKLIST_START) = FAT_BPB_ROOT_DIR_START (BPB);
fsmax = filemax = SECTOR_SIZE * (BLK_BLKLENGTH (BLK_BLKLIST_START)
= FAT_BPB_ROOT_DIR_LENGTH (BPB));
return 1;
}
else
/* any real directory/file */

View file

@ -20,7 +20,7 @@
/* Restrictions:
This is MINIX V1 only (yet)
Disk creation is like:
mkfs.minix -c -n14 DEVICE
mkfs.minix -c DEVICE
*/
#ifdef FSYS_MINIX
@ -31,7 +31,7 @@
/* #define DEBUG_MINIX */
/* indirect blocks */
static int mapblock1, mapblock2;
static int mapblock1, mapblock2, namelen;
/* sizes are always in bytes, BLOCK values are always in DEV_BSIZE (sectors) */
#define DEV_BSIZE 512
@ -80,8 +80,6 @@ typedef unsigned int __u32;
here we have */
#define INODE_VERSION(inode) (SUPERBLOCK->s_version)
#define MINIX_NAME_LEN 14 /* XXX depend on version */
/*
* This is the original minix inode layout on disk.
* Note the 8-bit gid and atime and ctime.
@ -162,19 +160,32 @@ struct minix_dir_entry {
int
minix_mount (void)
{
int retval = 1;
if (((current_drive & 0x80 || current_slice != 0))
&& (current_slice != PC_SLICE_TYPE_MINIX)
&& ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER))
return 0; /* The partition is not of MINIX type */
if (part_length < (SBLOCK +
(sizeof (struct minix_super_block) / DEV_BSIZE)))
return 0; /* The partition is too short */
if (!devread (SBLOCK, 0, sizeof (struct minix_super_block),
(char *) SUPERBLOCK))
return 0; /* Cannot read superblock */
switch (SUPERBLOCK->s_magic)
{
case MINIX_SUPER_MAGIC:
namelen = 14;
break;
case MINIX_SUPER_MAGIC2:
namelen = 30;
break;
default:
return 0; /* Unsupported type */
}
if ((((current_drive & 0x80 || current_slice != 0))
&& (current_slice != PC_SLICE_TYPE_MINIX)
&& ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER))
|| part_length < (SBLOCK +
(sizeof (struct minix_super_block) / DEV_BSIZE))
|| ! devread (SBLOCK, 0, sizeof (struct minix_super_block),
(char *) SUPERBLOCK)
|| SUPERBLOCK->s_magic != MINIX_SUPER_MAGIC)
retval = 0;
return retval;
return 1;
}
/* Takes a file system block number and reads it into BUFFER. */
@ -482,9 +493,10 @@ minix_dir (char *dirname)
off = loc & (BLOCK_SIZE - 1);
dp = (struct minix_dir_entry *) (DATABLOCK2 + off);
/* advance loc prematurely to next on-disk directory entry */
loc += sizeof (dp->inode) + 14; /* XXX */
loc += sizeof (dp->inode) + namelen;
/* NOTE: minix filenames are NULL terminated if < 14 else exact */
/* NOTE: minix filenames are NULL terminated if < NAMELEN
else exact */
#ifdef DEBUG_MINIX
printf ("directory entry ino=%d\n", dp->inode);
@ -494,9 +506,9 @@ minix_dir (char *dirname)
if (dp->inode)
{
int saved_c = dp->name[MINIX_NAME_LEN+1];
int saved_c = dp->name[namelen + 1];
dp->name[MINIX_NAME_LEN+1] = 0;
dp->name[namelen+1] = 0;
str_chk = substring (dirname, dp->name);
# ifndef STAGE1_5
@ -509,7 +521,7 @@ minix_dir (char *dirname)
}
# endif
dp->name[MINIX_NAME_LEN+1] = saved_c;
dp->name[namelen + 1] = saved_c;
}
}

View file

@ -133,6 +133,8 @@
#define IS_PC_SLICE_TYPE_BSD(type) IS_PC_SLICE_TYPE_BSD_WITH_FS(type,0)
/* This is not a flag actually, but used as if it were a flag. */
#define PC_SLICE_TYPE_HIDDEN_FLAG 0x10
/*
* *BSD-style disklabel & partition definitions.

View file

@ -68,6 +68,12 @@ extern char *grub_scratch_mem;
#define FSYS_BUFLEN 0x8000
#define FSYS_BUF RAW_ADDR (0x68000)
/* Command-line buffer for Multiboot kernels and modules. This area
includes the area into which Stage 1.5 and Stage 1 are loaded, but
that's no problem. */
#define MB_CMDLINE_BUF RAW_ADDR (0x2000)
#define MB_CMDLINE_BUFLEN 0x6000
/*
* Linux setup parameters
*/
@ -546,6 +552,12 @@ int open_partition (void);
/* Sets device to the one represented by the SAVED_* parameters. */
int make_saved_active (void);
/* Hide a partition. */
int hide_partition (void);
/* Unhide a partition. */
int unhide_partition (void);
/* Open a file or directory on the active device, using GRUB's
internal filesystem support. */
int grub_open (char *filename);
@ -570,10 +582,10 @@ void print_completions (char *filename);
/* Copies the current partition data to the desired address. */
void copy_current_part_entry (char *buf);
void bsd_boot (int type, int bootdev) __attribute__ ((noreturn));
int load_image (void);
int load_module (void);
int load_initrd (void);
void bsd_boot (int type, int bootdev, char *arg) __attribute__ ((noreturn));
int load_image (char *kernel, char *arg);
int load_module (char *module, char *arg);
int load_initrd (char *initrd);
void init_bios_info (void);