Skip to contentSkip to conversation

add support for PC-9800 architecture (fs)

PATCH In review Osamu Tomita 1 participant 1 message Oct 28, 2002 VFAT/FAT/msdos filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 8/23 add support for PC-9800 architecture (fs)

This is part 8/23 of patchset for add support NEC PC-9800 architecture, against 2.5.44.

Summary:
file system modules
- add support PC-9800 partition table.
- small hack for access FAT partition made by PC-9800 DOS.

diffstat:

 fs/fat/inode.c          |    9 +
 fs/partitions/Config.in |    8 +
 fs/partitions/Makefile  |    1 
 fs/partitions/check.c   |    4 
 fs/partitions/msdos.c   |   15 ++
 fs/partitions/nec98.c   |  281 ++++++++++++++++++++++++++++++++++++++++++++++++
 fs/partitions/nec98.h   |   10 +
 7 files changed, 327 insertions(+), 1 deletion(-)

patch:

fs/fat/inode.c +8 -1
diff -urN linux/fs/fat/inode.c linux98/fs/fat/inode.c
@@ -10,6 +10,7 @@
  *  	Max Cohan: Fixed invalid FSINFO offset when info_sector is 0
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/time.h>
 #include <linux/slab.h>
@@ -979,7 +980,13 @@
 		error = first;
 		goto out_fail;
 	}
-	if (FAT_FIRST_ENT(sb, media) != first) {
+#ifndef CONFIG_PC9800
+	if (FAT_FIRST_ENT(sb, media) != first)
+#else
+	if (FAT_FIRST_ENT(sb, media) != first
+	    && (media != 0xf8 || (first & 0xff) != 0xfe))
+#endif
+	{
 		if (!silent) {
 			printk("FAT: invalid first entry of FAT "
 			       "(0x%x != 0x%x)\n",
fs/partitions/Config.in +8 -0
diff -urN linux/fs/partitions/Config.in linux98/fs/partitions/Config.in
@@ -29,6 +29,10 @@
    if [ "$CONFIG_LDM_PARTITION" = "y" ]; then
       bool '    Windows LDM extra logging' CONFIG_LDM_DEBUG
    fi
+   bool '  NEC PC-9800 partition table support' CONFIG_NEC98_PARTITION
+   if [ "$CONFIG_NEC98_PARTITION" = "y" ]; then
+      bool '    BSD disklabel support for NEC PC-9800 type partitions' CONFIG_NEC98_BSD_DISKLABEL
+   fi
    bool '  SGI partition support' CONFIG_SGI_PARTITION
    bool '  Ultrix partition table support' CONFIG_ULTRIX_PARTITION
    bool '  Sun partition tables support' CONFIG_SUN_PARTITION
@@ -37,11 +41,15 @@
    if [ "$CONFIG_ALPHA" = "y" ]; then
       define_bool CONFIG_OSF_PARTITION y
    fi
+   if [ "$CONFIG_PC9800" = "y" ]; then
+      define_bool CONFIG_NEC98_PARTITION y
+   else
    if [ "$CONFIG_AMIGA" != "y" -a "$CONFIG_ATARI" != "y" -a \
         "$CONFIG_MAC" != "y" -a "$CONFIG_SGI_IP22" != "y" -a \
 	"$CONFIG_ARM" != "y" -a "$CONFIG_SGI_IP27" != "y" ]; then
       define_bool CONFIG_MSDOS_PARTITION y
    fi
+   fi
    if [ "$CONFIG_AMIGA" = "y" -o "$CONFIG_AFFS_FS" = "y" ]; then
       define_bool CONFIG_AMIGA_PARTITION y
    fi
fs/partitions/Makefile +1 -0
diff -urN linux/fs/partitions/Makefile linux98/fs/partitions/Makefile
@@ -18,6 +18,7 @@
 obj-$(CONFIG_ULTRIX_PARTITION) += ultrix.o
 obj-$(CONFIG_IBM_PARTITION) += ibm.o
 obj-$(CONFIG_EFI_PARTITION) += efi.o
+obj-$(CONFIG_NEC98_PARTITION) += nec98.o msdos.o
 
 include $(TOPDIR)/Rules.make
 
fs/partitions/check.c +4 -0
diff -urN linux/fs/partitions/check.c linux98/fs/partitions/check.c
@@ -28,6 +28,7 @@
 #include "ldm.h"
 #include "mac.h"
 #include "msdos.h"
+#include "nec98.h"
 #include "osf.h"
 #include "sgi.h"
 #include "sun.h"
@@ -51,6 +52,9 @@
 #ifdef CONFIG_LDM_PARTITION
 	ldm_partition,		/* this must come before msdos */
 #endif
+#ifdef CONFIG_NEC98_PARTITION
+	nec98_partition,	/* must be come before `msdos_partition' */
+#endif
 #ifdef CONFIG_MSDOS_PARTITION
 	msdos_partition,
 #endif
fs/partitions/msdos.c +15 -0
diff -urN linux/fs/partitions/msdos.c linux98/fs/partitions/msdos.c
@@ -20,6 +20,11 @@
  */
 
 #include <linux/config.h>
+
+#ifdef CONFIG_NEC98_BSD_DISKLABEL
+# define CONFIG_BSD_DISKLABEL
+#endif
+
 #include <linux/buffer_head.h>		/* for invalidate_bdev() */
 
 #ifdef CONFIG_BLK_DEV_IDE
@@ -37,6 +42,7 @@
 #include "msdos.h"
 #include "efi.h"
 
+#if !defined(CONFIG_PC9800) || defined(CONFIG_MSDOS_PARTITION)
 /*
  * Many architectures don't like unaligned accesses, which is
  * frequently the case with the nr_sects and start_sect partition
@@ -171,6 +177,7 @@
 done:
 	put_dev_sector(sect);
 }
+#endif /* !defined(CONFIG_PC9800) || defined(CONFIG_MSDOS_PARTITION) */
 
 /* [email protected]: Solaris has a nasty indicator: 0x82 which also
    indicates linux swap.  Be careful before believing this is Solaris. */
@@ -179,6 +186,7 @@
 parse_solaris_x86(struct parsed_partitions *state, struct block_device *bdev,
 			u32 offset, u32 size, int origin)
 {
+#if !defined(CONFIG_PC9800) || defined(CONFIG_MSDOS_PARTITION)
 #ifdef CONFIG_SOLARIS_X86_PARTITION
 	Sector sect;
 	struct solaris_x86_vtoc *v;
@@ -212,6 +220,7 @@
 	put_dev_sector(sect);
 	printk(" >\n");
 #endif
+#endif /* !defined(CONFIG_PC9800) || defined(CONFIG_MSDOS_PARTITION) */
 }
 
 #ifdef CONFIG_BSD_DISKLABEL
@@ -219,7 +228,11 @@
  * Create devices for BSD partitions listed in a disklabel, under a
  * dos-like partition. See parse_extended() for more information.
  */
+#ifndef CONFIG_NEC98_BSD_DISKLABEL
 static void
+#else
+void
+#endif
 parse_bsd(struct parsed_partitions *state, struct block_device *bdev,
 		u32 offset, u32 size, int origin, char *flavour,
 		int max_partitions)
@@ -292,6 +305,7 @@
 #endif
 }
 
+#if !defined(CONFIG_PC9800) || defined(CONFIG_MSDOS_PARTITION)
 /*
  * Create devices for Unixware partitions listed in a disklabel, under a
  * dos-like partition. See parse_extended() for more information.
@@ -461,3 +475,4 @@
 	put_dev_sector(sect);
 	return 1;
 }
+#endif /* !defined(CONFIG_PC9800) || defined(CONFIG_MSDOS_PARTITION) */
fs/partitions/nec98.c +281 -0

281 lines not on this page · raw message

fs/partitions/nec98.h +10 -0
diff -urN linux/fs/partitions/nec98.h linux98/fs/partitions/nec98.h
@@ -0,0 +1,10 @@
+/*
+ *  NEC PC-9800 series partition supports
+ *
+ *  Copyright (C) 1998-2000	Kyoto University Microcomputer Club
+ */
+
+#define NEC98_PTABLE_MAGIC	0xAA55
+
+extern int nec98_partition(struct parsed_partitions *state,
+				struct block_device *bdev);