Re: [PATCH] plan9 partition support

2001-01-16 Thread imel96



hi,

i read the man page more carefully, it says
that the partition table is really just a
textual partition table. the __u32 came
from bsd partition table code i copied.

i also fixed the doc. the 9fat always has
the same starting sector number with the
plan9 partition table, only plan9 put its
information in the 2nd sector.


On Sun, 14 Jan 2001 [EMAIL PROTECTED] wrote:
> I'll have a look.
> A week ago you sent almost the same patch.
> Was there a reason to change __u32 into unsigned long?


imel


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [PATCH] plan9 partition support

2001-01-16 Thread imel96



hi,

i read the man page more carefully, it says
that the partition table is really just a
textual partition table. the __u32 came
from bsd partition table code i copied.

i also fixed the doc. the 9fat always has
the same starting sector number with the
plan9 partition table, only plan9 put its
information in the 2nd sector.


On Sun, 14 Jan 2001 [EMAIL PROTECTED] wrote:
 I'll have a look.
 A week ago you sent almost the same patch.
 Was there a reason to change __u32 into unsigned long?


imel


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: [PATCH] plan9 partition support

2001-01-13 Thread Andries . Brouwer

> the patch locates partitions inside the plan9

> i can't find anyone with plan9 to test,

I'll have a look.
A week ago you sent almost the same patch.
Was there a reason to change __u32 into unsigned long?

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



[PATCH] plan9 partition support

2001-01-13 Thread imel96




hi all,


this one patch i believe is harmless as it only
reads partition table, but who knows. the diff
is against 2.4.0.

the patch locates partitions inside the plan9
partition table.

as you may know, a plan9 partition table has three
type of partitions inside (9fat, fs, and swap).
9fat is fat16.

with msdos file system, linux will mount 9fat partition,
so you could use the 9fat and other fat16 partition inside
plan9 from linux and plan9.

i can't find anyone with plan9 to test, but it works for
me, so...


imel


diff -ur linux~/Documentation/Configure.help linux/Documentation/Configure.help
--- linux~/Documentation/Configure.help Fri Jan  5 16:27:43 2001
+++ linux/Documentation/Configure.help  Sat Jan 13 14:46:10 2001
@@ -1,7 +1,7 @@
 # Maintained by Axel Boldt ([EMAIL PROTECTED])
 #
 # This version of the Linux kernel configuration help texts
-# corresponds to the kernel versions 2.3.x.
+# corresponds to the kernel versions 2.4.x.
 #
 # Translations of this file available on the WWW:
 #
@@ -11469,6 +11469,17 @@
 CONFIG_MSDOS_PARTITION
   Say Y here if you would like to use hard disks under Linux which
   were partitioned on an x86 PC (not necessarily by DOS).
+
+Plan9 partition table support (EXPERIMENTAL)
+CONFIG_PLAN9_PARTITION
+  Plan9 uses its own hard disk partition scheme on your PC. It
+  requires only one entry in the primary partition table of your disk
+  and manages it similarly to DOS extended partitions. Saying Y
+  here allows you to read the existing partitions, and mount FAT16
+  partitions from within Linux, if you have also said Y to "MSDOS fs
+  support" or "VFAT (Windows-95) fs support". You can mount the first
+  FAT16 partition (9fat) directly without this. If you don't know what
+  all this is about, say N.
 
 BSD disklabel (FreeBSD partition tables) support
 CONFIG_BSD_DISKLABEL
diff -ur linux~/fs/partitions/Config.in linux/fs/partitions/Config.in
--- linux~/fs/partitions/Config.in  Mon Jul 10 12:21:41 2000
+++ linux/fs/partitions/Config.in   Sun Jan  7 18:37:27 2001
@@ -23,6 +23,7 @@
   bool 'BSD disklabel (FreeBSD partition tables) support' 
CONFIG_BSD_DISKLABEL
   bool 'Solaris (x86) partition table support' CONFIG_SOLARIS_X86_PARTITION
   bool 'Unixware slices support' CONFIG_UNIXWARE_DISKLABEL
+  dep_bool 'Plan9 partition support (EXPERIMENTAL)' CONFIG_PLAN9_PARTITION 
+$CONFIG_EXPERIMENTAL
fi
bool '  SGI partition support' CONFIG_SGI_PARTITION
bool '  Ultrix partition table support' CONFIG_ULTRIX_PARTITION
diff -ur linux~/fs/partitions/msdos.c linux/fs/partitions/msdos.c
--- linux~/fs/partitions/msdos.cFri Nov 17 17:18:46 2000
+++ linux/fs/partitions/msdos.c Sun Jan  7 18:46:34 2001
@@ -17,6 +17,8 @@
  *  Check partition table on IDE disks for common CHS translations
  *
  *  Re-organised Feb 1998 Russell King
+ *
+ *  plan9 partition hack 2001 Jan, [EMAIL PROTECTED]
  */
 
 #include 
@@ -228,6 +230,55 @@
 }
 #endif
 
+#ifdef CONFIG_PLAN9_PARTITION
+
+static void add_plan9_partition(struct gendisk *hd, struct plan9_partition
+   *plan9_p, int minor)
+{
+   add_gd_partition(hd, current_minor, plan9_p->p_offset, plan9_p->p_size);
+   current_minor++;
+}
+
+/* 
+ * Create devices for plan9 partitions listed in a disklabel, under a
+ * dos-like partition. See bsd code for more information.
+ */
+static void plan9_disklabel_partition(struct gendisk *hd, int minor, int st_sec)
+{
+   struct buffer_head *bh;
+   struct plan9_partition p;
+   char * ptr;
+   char buf[40];
+
+   if (!(bh = get_partition_table_block(hd, minor, 0)))
+   return;
+
+   printk(" %s: b_data + 0x200;
+
+   while (!strncmp(ptr, "part", 4)) {
+
+   /* locate offset number (which is two spaces away) */
+   while (*ptr++ != ' ');
+   while (*ptr++ != ' ');
+   p.p_offset = simple_strtoul(ptr, NULL, 10);
+
+   /* find end sector number (next number) */
+   while (*ptr++ != ' ');
+   p.p_size = simple_strtoul(ptr, NULL, 10) - p.p_offset;
+   p.p_offset += st_sec;
+
+   add_plan9_partition(hd, , minor);
+
+   /* go on to next partition */
+   while (*ptr++ != '\n');
+   }
+   bforget(bh);
+   printk(" >\n");
+}
+
+#endif
+
 #ifdef CONFIG_BSD_DISKLABEL
 static void
 check_and_add_bsd_partition(struct gendisk *hd,
@@ -499,6 +550,10 @@
SYS_IND(p) == NETBSD_PARTITION ||
SYS_IND(p) == OPENBSD_PARTITION)
bsd_disklabel_partition(hd, minor, SYS_IND(p));
+#endif
+#ifdef CONFIG_PLAN9_PARTITION
+   if (SYS_IND(p) == PLAN9_PARTITION)
+  

[PATCH] plan9 partition support

2001-01-13 Thread imel96




hi all,


this one patch i believe is harmless as it only
reads partition table, but who knows. the diff
is against 2.4.0.

the patch locates partitions inside the plan9
partition table.

as you may know, a plan9 partition table has three
type of partitions inside (9fat, fs, and swap).
9fat is fat16.

with msdos file system, linux will mount 9fat partition,
so you could use the 9fat and other fat16 partition inside
plan9 from linux and plan9.

i can't find anyone with plan9 to test, but it works for
me, so...


imel


diff -ur linux~/Documentation/Configure.help linux/Documentation/Configure.help
--- linux~/Documentation/Configure.help Fri Jan  5 16:27:43 2001
+++ linux/Documentation/Configure.help  Sat Jan 13 14:46:10 2001
@@ -1,7 +1,7 @@
 # Maintained by Axel Boldt ([EMAIL PROTECTED])
 #
 # This version of the Linux kernel configuration help texts
-# corresponds to the kernel versions 2.3.x.
+# corresponds to the kernel versions 2.4.x.
 #
 # Translations of this file available on the WWW:
 #
@@ -11469,6 +11469,17 @@
 CONFIG_MSDOS_PARTITION
   Say Y here if you would like to use hard disks under Linux which
   were partitioned on an x86 PC (not necessarily by DOS).
+
+Plan9 partition table support (EXPERIMENTAL)
+CONFIG_PLAN9_PARTITION
+  Plan9 uses its own hard disk partition scheme on your PC. It
+  requires only one entry in the primary partition table of your disk
+  and manages it similarly to DOS extended partitions. Saying Y
+  here allows you to read the existing partitions, and mount FAT16
+  partitions from within Linux, if you have also said Y to "MSDOS fs
+  support" or "VFAT (Windows-95) fs support". You can mount the first
+  FAT16 partition (9fat) directly without this. If you don't know what
+  all this is about, say N.
 
 BSD disklabel (FreeBSD partition tables) support
 CONFIG_BSD_DISKLABEL
diff -ur linux~/fs/partitions/Config.in linux/fs/partitions/Config.in
--- linux~/fs/partitions/Config.in  Mon Jul 10 12:21:41 2000
+++ linux/fs/partitions/Config.in   Sun Jan  7 18:37:27 2001
@@ -23,6 +23,7 @@
   bool 'BSD disklabel (FreeBSD partition tables) support' 
CONFIG_BSD_DISKLABEL
   bool 'Solaris (x86) partition table support' CONFIG_SOLARIS_X86_PARTITION
   bool 'Unixware slices support' CONFIG_UNIXWARE_DISKLABEL
+  dep_bool 'Plan9 partition support (EXPERIMENTAL)' CONFIG_PLAN9_PARTITION 
+$CONFIG_EXPERIMENTAL
fi
bool '  SGI partition support' CONFIG_SGI_PARTITION
bool '  Ultrix partition table support' CONFIG_ULTRIX_PARTITION
diff -ur linux~/fs/partitions/msdos.c linux/fs/partitions/msdos.c
--- linux~/fs/partitions/msdos.cFri Nov 17 17:18:46 2000
+++ linux/fs/partitions/msdos.c Sun Jan  7 18:46:34 2001
@@ -17,6 +17,8 @@
  *  Check partition table on IDE disks for common CHS translations
  *
  *  Re-organised Feb 1998 Russell King
+ *
+ *  plan9 partition hack 2001 Jan, [EMAIL PROTECTED]
  */
 
 #include linux/config.h
@@ -228,6 +230,55 @@
 }
 #endif
 
+#ifdef CONFIG_PLAN9_PARTITION
+
+static void add_plan9_partition(struct gendisk *hd, struct plan9_partition
+   *plan9_p, int minor)
+{
+   add_gd_partition(hd, current_minor, plan9_p-p_offset, plan9_p-p_size);
+   current_minor++;
+}
+
+/* 
+ * Create devices for plan9 partitions listed in a disklabel, under a
+ * dos-like partition. See bsd code for more information.
+ */
+static void plan9_disklabel_partition(struct gendisk *hd, int minor, int st_sec)
+{
+   struct buffer_head *bh;
+   struct plan9_partition p;
+   char * ptr;
+   char buf[40];
+
+   if (!(bh = get_partition_table_block(hd, minor, 0)))
+   return;
+
+   printk(" %s: plan9:", disk_name(hd, minor, buf));
+   ptr = bh-b_data + 0x200;
+
+   while (!strncmp(ptr, "part", 4)) {
+
+   /* locate offset number (which is two spaces away) */
+   while (*ptr++ != ' ');
+   while (*ptr++ != ' ');
+   p.p_offset = simple_strtoul(ptr, NULL, 10);
+
+   /* find end sector number (next number) */
+   while (*ptr++ != ' ');
+   p.p_size = simple_strtoul(ptr, NULL, 10) - p.p_offset;
+   p.p_offset += st_sec;
+
+   add_plan9_partition(hd, p, minor);
+
+   /* go on to next partition */
+   while (*ptr++ != '\n');
+   }
+   bforget(bh);
+   printk(" \n");
+}
+
+#endif
+
 #ifdef CONFIG_BSD_DISKLABEL
 static void
 check_and_add_bsd_partition(struct gendisk *hd,
@@ -499,6 +550,10 @@
SYS_IND(p) == NETBSD_PARTITION ||
SYS_IND(p) == OPENBSD_PARTITION)
bsd_disklabel_partition(hd, minor, SYS_IND(p));
+#endif
+#ifdef CONFIG_PLAN9_PARTITION
+   

Re: [PATCH] plan9 partition support

2001-01-13 Thread Andries . Brouwer

 the patch locates partitions inside the plan9

 i can't find anyone with plan9 to test,

I'll have a look.
A week ago you sent almost the same patch.
Was there a reason to change __u32 into unsigned long?

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



[PATCH] plan9 partition support

2001-01-07 Thread imel96



hi all,


this one patch i believe is harmless as it only
reads partition table, but who knows. the diff
is against 2.4.0.

the patch locates partitions inside the plan9
partition table.

as you may know, a plan9 partition table has three
type of partitions inside (9fat, fs, and swap).
9fat is fat16.

plan9 puts its boot loader in the 9fat partition.
with this patch i can locate the 9fat partition so
lilo could boot plan9.

with msdos file system, linux will mount 9fat partition,
so you could use the 9fat partition from linux and plan9.

i can't find anyone with plan9 to test, but it works for
me, so... i'm not on the list anymore, so please cc.


imel


diff -ur linux~/Documentation/Configure.help linux/Documentation/Configure.help
--- linux~/Documentation/Configure.help Fri Jan  5 16:27:43 2001
+++ linux/Documentation/Configure.help  Sun Jan  7 18:22:25 2001
@@ -11470,6 +11470,17 @@
   Say Y here if you would like to use hard disks under Linux which
   were partitioned on an x86 PC (not necessarily by DOS).
 
+Plan9 partition table support (EXPERIMENTAL)
+CONFIG_PLAN9_PARTITION
+  Plan9 uses its own hard disk partition scheme on your PC. It
+  requires only one entry in the primary partition table of your disk
+  and manages it similarly to DOS extended partitions. Plan9 has FAT16
+  filesystem as the first partition to put its boot loader. Saying Y
+  here allows you to read the existing partition, and mount the FAT
+  partition from within Linux (if you have also said Y to "MSDOS file
+  system support"), which gives you the ability to make LILO work with
+  Plan9. If you don't know what all this is about, say N.
+
 BSD disklabel (FreeBSD partition tables) support
 CONFIG_BSD_DISKLABEL
   FreeBSD uses its own hard disk partition scheme on your PC. It
diff -ur linux~/fs/partitions/Config.in linux/fs/partitions/Config.in
--- linux~/fs/partitions/Config.in  Mon Jul 10 12:21:41 2000
+++ linux/fs/partitions/Config.in   Sun Jan  7 18:37:27 2001
@@ -23,6 +23,7 @@
   bool 'BSD disklabel (FreeBSD partition tables) support' 
CONFIG_BSD_DISKLABEL
   bool 'Solaris (x86) partition table support' CONFIG_SOLARIS_X86_PARTITION
   bool 'Unixware slices support' CONFIG_UNIXWARE_DISKLABEL
+  dep_bool 'Plan9 partition support (EXPERIMENTAL)' CONFIG_PLAN9_PARTITION 
+$CONFIG_EXPERIMENTAL
fi
bool '  SGI partition support' CONFIG_SGI_PARTITION
bool '  Ultrix partition table support' CONFIG_ULTRIX_PARTITION
diff -ur linux~/fs/partitions/msdos.c linux/fs/partitions/msdos.c
--- linux~/fs/partitions/msdos.cFri Nov 17 17:18:46 2000
+++ linux/fs/partitions/msdos.c Sun Jan  7 18:46:34 2001
@@ -17,6 +17,8 @@
  *  Check partition table on IDE disks for common CHS translations
  *
  *  Re-organised Feb 1998 Russell King
+ *
+ *  plan9 partition hack 2001 Jan, [EMAIL PROTECTED]
  */
 
 #include 
@@ -228,6 +230,55 @@
 }
 #endif
 
+#ifdef CONFIG_PLAN9_PARTITION
+
+static void add_plan9_partition(struct gendisk *hd, struct plan9_partition
+   *plan9_p, int minor)
+{
+   add_gd_partition(hd, current_minor, plan9_p->p_offset, plan9_p->p_size);
+   current_minor++;
+}
+
+/* 
+ * Create devices for plan9 partitions listed in a disklabel, under a
+ * dos-like partition. See bsd code for more information.
+ */
+static void plan9_disklabel_partition(struct gendisk *hd, int minor, int st_sec)
+{
+   struct buffer_head *bh;
+   struct plan9_partition p;
+   char * ptr;
+   char buf[40];
+
+   if (!(bh = get_partition_table_block(hd, minor, 0)))
+   return;
+
+   printk(" %s: b_data + 0x200;
+
+   while (!strncmp(ptr, "part", 4)) {
+
+   /* locate offset number (which is two spaces away) */
+   while (*ptr++ != ' ');
+   while (*ptr++ != ' ');
+   p.p_offset = simple_strtoul(ptr, NULL, 10);
+
+   /* find end sector number (next number) */
+   while (*ptr++ != ' ');
+   p.p_size = simple_strtoul(ptr, NULL, 10) - p.p_offset;
+   p.p_offset += st_sec;
+
+   add_plan9_partition(hd, , minor);
+
+   /* go on to next partition */
+   while (*ptr++ != '\n');
+   }
+   bforget(bh);
+   printk(" >\n");
+}
+
+#endif
+
 #ifdef CONFIG_BSD_DISKLABEL
 static void
 check_and_add_bsd_partition(struct gendisk *hd,
@@ -499,6 +550,10 @@
SYS_IND(p) == NETBSD_PARTITION ||
SYS_IND(p) == OPENBSD_PARTITION)
bsd_disklabel_partition(hd, minor, SYS_IND(p));
+#endif
+#ifdef CONFIG_PLAN9_PARTITION
+   if (SYS_IND(p) == PLAN9_PARTITION)
+   plan9_disklabel_partition(hd, minor, 

[PATCH] plan9 partition support

2001-01-07 Thread imel96



hi all,


this one patch i believe is harmless as it only
reads partition table, but who knows. the diff
is against 2.4.0.

the patch locates partitions inside the plan9
partition table.

as you may know, a plan9 partition table has three
type of partitions inside (9fat, fs, and swap).
9fat is fat16.

plan9 puts its boot loader in the 9fat partition.
with this patch i can locate the 9fat partition so
lilo could boot plan9.

with msdos file system, linux will mount 9fat partition,
so you could use the 9fat partition from linux and plan9.

i can't find anyone with plan9 to test, but it works for
me, so... i'm not on the list anymore, so please cc.


imel


diff -ur linux~/Documentation/Configure.help linux/Documentation/Configure.help
--- linux~/Documentation/Configure.help Fri Jan  5 16:27:43 2001
+++ linux/Documentation/Configure.help  Sun Jan  7 18:22:25 2001
@@ -11470,6 +11470,17 @@
   Say Y here if you would like to use hard disks under Linux which
   were partitioned on an x86 PC (not necessarily by DOS).
 
+Plan9 partition table support (EXPERIMENTAL)
+CONFIG_PLAN9_PARTITION
+  Plan9 uses its own hard disk partition scheme on your PC. It
+  requires only one entry in the primary partition table of your disk
+  and manages it similarly to DOS extended partitions. Plan9 has FAT16
+  filesystem as the first partition to put its boot loader. Saying Y
+  here allows you to read the existing partition, and mount the FAT
+  partition from within Linux (if you have also said Y to "MSDOS file
+  system support"), which gives you the ability to make LILO work with
+  Plan9. If you don't know what all this is about, say N.
+
 BSD disklabel (FreeBSD partition tables) support
 CONFIG_BSD_DISKLABEL
   FreeBSD uses its own hard disk partition scheme on your PC. It
diff -ur linux~/fs/partitions/Config.in linux/fs/partitions/Config.in
--- linux~/fs/partitions/Config.in  Mon Jul 10 12:21:41 2000
+++ linux/fs/partitions/Config.in   Sun Jan  7 18:37:27 2001
@@ -23,6 +23,7 @@
   bool 'BSD disklabel (FreeBSD partition tables) support' 
CONFIG_BSD_DISKLABEL
   bool 'Solaris (x86) partition table support' CONFIG_SOLARIS_X86_PARTITION
   bool 'Unixware slices support' CONFIG_UNIXWARE_DISKLABEL
+  dep_bool 'Plan9 partition support (EXPERIMENTAL)' CONFIG_PLAN9_PARTITION 
+$CONFIG_EXPERIMENTAL
fi
bool '  SGI partition support' CONFIG_SGI_PARTITION
bool '  Ultrix partition table support' CONFIG_ULTRIX_PARTITION
diff -ur linux~/fs/partitions/msdos.c linux/fs/partitions/msdos.c
--- linux~/fs/partitions/msdos.cFri Nov 17 17:18:46 2000
+++ linux/fs/partitions/msdos.c Sun Jan  7 18:46:34 2001
@@ -17,6 +17,8 @@
  *  Check partition table on IDE disks for common CHS translations
  *
  *  Re-organised Feb 1998 Russell King
+ *
+ *  plan9 partition hack 2001 Jan, [EMAIL PROTECTED]
  */
 
 #include linux/config.h
@@ -228,6 +230,55 @@
 }
 #endif
 
+#ifdef CONFIG_PLAN9_PARTITION
+
+static void add_plan9_partition(struct gendisk *hd, struct plan9_partition
+   *plan9_p, int minor)
+{
+   add_gd_partition(hd, current_minor, plan9_p-p_offset, plan9_p-p_size);
+   current_minor++;
+}
+
+/* 
+ * Create devices for plan9 partitions listed in a disklabel, under a
+ * dos-like partition. See bsd code for more information.
+ */
+static void plan9_disklabel_partition(struct gendisk *hd, int minor, int st_sec)
+{
+   struct buffer_head *bh;
+   struct plan9_partition p;
+   char * ptr;
+   char buf[40];
+
+   if (!(bh = get_partition_table_block(hd, minor, 0)))
+   return;
+
+   printk(" %s: plan9:", disk_name(hd, minor, buf));
+   ptr = bh-b_data + 0x200;
+
+   while (!strncmp(ptr, "part", 4)) {
+
+   /* locate offset number (which is two spaces away) */
+   while (*ptr++ != ' ');
+   while (*ptr++ != ' ');
+   p.p_offset = simple_strtoul(ptr, NULL, 10);
+
+   /* find end sector number (next number) */
+   while (*ptr++ != ' ');
+   p.p_size = simple_strtoul(ptr, NULL, 10) - p.p_offset;
+   p.p_offset += st_sec;
+
+   add_plan9_partition(hd, p, minor);
+
+   /* go on to next partition */
+   while (*ptr++ != '\n');
+   }
+   bforget(bh);
+   printk(" \n");
+}
+
+#endif
+
 #ifdef CONFIG_BSD_DISKLABEL
 static void
 check_and_add_bsd_partition(struct gendisk *hd,
@@ -499,6 +550,10 @@
SYS_IND(p) == NETBSD_PARTITION ||
SYS_IND(p) == OPENBSD_PARTITION)
bsd_disklabel_partition(hd, minor, SYS_IND(p));
+#endif
+#ifdef CONFIG_PLAN9_PARTITION
+   if (SYS_IND(p) == PLAN9_PARTITION)
+