add NetBSD and OpenBSD partition slices support

This commit is contained in:
okuji 1999-08-09 16:34:08 +00:00
parent d52edd8638
commit 0f4f88a9d9
8 changed files with 47 additions and 15 deletions

View file

@ -1,3 +1,25 @@
1999-08-10 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
Support the NetBSD and OpenBSD partition slices.
* stage2/pc_slice.h (PC_SLICE_TYPE_BSD): Deleted.
(PC_SLICE_TYPE_FREEBSD): New macro.
(PC_SLICE_TYPE_OPENBSD): Likewise.
(PC_SLICE_TYPE_NETBSD): Likewise.
(IS_PC_SLICE_TYPE_BSD_WITH_FS): Likewise.
(IS_PC_SLICE_TYPE_BSD): Likewise.
* stage2/fsys_ffs.c (ffs_mount): Use the macro
IS_PC_SLICE_TYPE_BSD_WITH_FS instead of checking if
CURRECT_SLICE is equal to the BSD partition type directly.
* stage2/fsys_ext2fs.c (ext2fs_mount): Likewise.
* stage2/fsys_fat.c (fat_mount): Likewise.
* stage2/disk_io.c (check_BSD_parts): Set the low bits of
CURRENT_SLICE to PC_SLICE_TYPE_FREEBSD instead of
PC_SLICE_TYPE_BSD.
(real_open_partition): Use the macro IS_PC_SLICE_TYPE_BSD instead
of checking if CURRENT_SLICE is equal to the BSD partition type
directly.
1999-08-09 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* stage2/cmdline.c (commands): Added geometry.

2
NEWS
View file

@ -2,6 +2,8 @@ NEWS - list of user-visible changes between releases of GRUB
New in 0.5.93:
* ELF format of FreeBSD kernel is supported.
* Support the partition ids for NetBSD and OpenBSD.
* Exit from the grub emulator just by pushing the key `q' in the menu.
New in 0.5.92 - 1999-07-26:
* Bug fixes (i.e. Stage 1.5 can work fine again).

5
TODO
View file

@ -12,9 +12,6 @@ Look at the network booting patches from L4.
Add internationalization support, emulating gettext as much as is
feasible.
Add support/delays so that a floppy can be installed from another
floppy.
Add bootable CDROM support (this probably means we have to support
ISO-9660 plus maybe even the Rock Ridge extensions... ugh).
@ -30,8 +27,6 @@ larger than 16MB can be read.
Fix-up FreeBSD, NetBSD (and OpenBSD ?) command-line boot parameters
Support new partition IDs for NetBSD and OpenBSD.
Add ``configfile'' command, in a clean way.
Add keyboard layout configuration support.

View file

@ -346,8 +346,11 @@ check_BSD_parts (int flags)
{
/* FIXME: should do BAD144 sector remapping setup here */
/* XXX We cannot determine which variant of BSD owns
this slice, so set it to FreeBSD paritition type.
That should work fine for now. */
current_slice = ((BSD_PART_TYPE (label_buf, part_no) << 8)
| PC_SLICE_TYPE_BSD);
| PC_SLICE_TYPE_FREEBSD);
part_start = BSD_PART_START (label_buf, part_no);
part_length = BSD_PART_LENGTH (label_buf, part_no);
@ -487,7 +490,7 @@ real_open_partition (int flags)
{
current_partition |= 0xFFFF;
printf (" Partition num: %d, ", slice_no);
if (current_slice != PC_SLICE_TYPE_BSD)
if (! IS_PC_SLICE_TYPE_BSD (current_slice))
check_and_print_mount ();
else
check_BSD_parts (1);
@ -499,11 +502,11 @@ real_open_partition (int flags)
*/
else if (part_no == slice_no
|| (part_no == 0xFF
&& current_slice == PC_SLICE_TYPE_BSD))
&& IS_PC_SLICE_TYPE_BSD (current_slice)))
{
if ((current_partition & 0xFF00) != 0xFF00)
{
if (current_slice == PC_SLICE_TYPE_BSD)
if (IS_PC_SLICE_TYPE_BSD (current_slice))
check_BSD_parts (0);
else
errnum = ERR_NO_PART;

View file

@ -255,7 +255,7 @@ ext2fs_mount (void)
if ((((current_drive & 0x80) || (current_slice != 0))
&& (current_slice != PC_SLICE_TYPE_EXT2FS)
&& (current_slice != (PC_SLICE_TYPE_BSD | (FS_OTHER << 8))))
&& (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_OTHER)))
|| part_length < (SBLOCK + (sizeof (struct ext2_super_block) / DEV_BSIZE))
|| !devread (SBLOCK, 0, sizeof (struct ext2_super_block),
(char *) SUPERBLOCK)

View file

@ -42,7 +42,7 @@ fat_mount (void)
&& (current_slice != PC_SLICE_TYPE_FAT12)
&& (current_slice != PC_SLICE_TYPE_FAT16_LT32M)
&& (current_slice != PC_SLICE_TYPE_FAT16_GT32M)
&& (current_slice != (PC_SLICE_TYPE_BSD | (FS_MSDOS << 8))))
&& (! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_MSDOS << 8)))
|| !devread (0, 0, SECTOR_SIZE, (char *) BPB)
|| FAT_BPB_BYTES_PER_SECTOR (BPB) != SECTOR_SIZE
|| FAT_BPB_SECT_PER_CLUST (BPB) < 1 || FAT_BPB_SECT_PER_CLUST (BPB) > 64

View file

@ -80,7 +80,7 @@ ffs_mount (void)
int retval = 1;
if ((((current_drive & 0x80) || (current_slice != 0))
&& current_slice != (PC_SLICE_TYPE_BSD | (FS_BSDFFS << 8)))
&& ! IS_PC_SLICE_TYPE_BSD_WITH_FS (current_slice, FS_BSDFFS << 8))
|| part_length < (SBLOCK + (SBSIZE / DEV_BSIZE))
|| !devread (SBLOCK, 0, SBSIZE, (char *) SUPERBLOCK)
|| SUPERBLOCK->fs_magic != FS_MAGIC)

View file

@ -105,9 +105,19 @@
#define PC_SLICE_TYPE_WIN95_EXTENDED 0xf
#define PC_SLICE_TYPE_EXT2FS 0x83
/* this next one is special, as it uses it's own partitioning scheme
to subdivide the PC partition from there */
#define PC_SLICE_TYPE_BSD 0xa5
/* these ones are special, as they use thier own partitioning scheme
to subdivide the PC partitions from there. */
#define PC_SLICE_TYPE_FREEBSD 0xa5
#define PC_SLICE_TYPE_OPENBSD 0xa6
#define PC_SLICE_TYPE_NETBSD 0xa9
/* For convenience. */
#define IS_PC_SLICE_TYPE_BSD_WITH_FS(type,fs) \
((type) == (PC_SLICE_TYPE_FREEBSD | ((fs) << 8)) \
|| (type) == (PC_SLICE_TYPE_OPENBSD | ((fs) << 8)) \
|| (type) == (PC_SLICE_TYPE_NETBSD | (fs) << 8))
#define IS_PC_SLICE_TYPE_BSD(type) IS_PC_SLICE_TYPE_BSD_WITH_FS(type,0)
/*