public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: Neil Holmes <neil.holmes@zoom.co.uk>
To: Riley Williams <rhw@InfraDead.Org>
Cc: Linux 8086 <linux-8086@vger.kernel.org>
Subject: Re: Elks Distribution
Date: 26 May 2002 07:26:50 +0100	[thread overview]
Message-ID: <1022394411.2055.3.camel@nhthinkpad> (raw)
In-Reply-To: <Pine.LNX.4.21.0205252208120.15697-200000@Consulate.UFP.CX>

I will, indeed, look very closely at your remarks as I move forward. I
am particularly interested by the partition.c.

I'll keep everyone posted.

Many Thanks

Neil

On Sat, 2002-05-25 at 23:55, Riley Williams wrote:
> Hi Neil.
> 
> > It sounds like your distribution is in advance of that which I have
> > produced thus far Richard.
> >
> > My first "stable" version is ready now. I am not sure what the
> > procedure is here but I have attached a zip file EDE.zip to this
> > email which contains two floppy image files for install disk one
> > and disk two.
> >
> > I would be interested to hear how it runs elsewhere. 
> >
> > Here are some notes on what to expect.
> >
> > - I have tested it on 80286 and 80386 machines.
> > - I recommend creating a dos partition before starting (at least 20Mb)
> > - The install will create a 20Mb ELks /dev/bda1
> > - This first version will only install to /dev/bda1
> >
> > DON'T TRY IT UNLESS YOU HAVE A BLANK SYSTEM TO PLAY WITH
> 
> Some thoughts regarding the above which you may wish to consider:
> 
>  1. If the target partition has to be fixed, then it would make more
>     sense to select /dev/bda4 as the ELKS partition to use, as MSDOS
>     (and most other operating systems) allocate starting at the low
>     end of the numbers.
> 
>  2. The ideal would be to have it parse the partition table looking
>     for a suitable partition, where "suitable" is defined as being
> 
>      a. Smaller than 31M (the claimed limit of the file system
> 	format used for ELKS, and
> 
>      b. Of partition type 80 hex (the "Old Minix" partition that ELKS
> 	uses for its filesystem).
> 
> I've added a command to the elkscmd CVS tree that deals with point 2b
> above (look for partype.c in the disk_utils directory) and the source
> is enclosed for reference. It takes the desired partition code as a
> command-line parameter, so is generic in that sense. It also checks both
> /dev/hda and /dev/sda if it can't find /dev/bda so in that sense is not
> ELKS-specific either.
> 
> Best wishes from Riley.
> ----
> 

> /* partype v1.0.0 Partition type locator
>  * Copyright (C) 2002, Riley H Williams G7GOD,
>  * Released under the GNU General Public Licence, version 2 only.
>  *
>  * This program searches the partition table of the primary hard drive for
>  * a partition with a particular hex code for the partition type. It only
>  * searches the four primary partitions, not logical partitions.
>  *
>  * If it finds any partitions of the specified type, it displays the name
>  * of the lowest numbered partition on stdout.
>  *
>  * On completion, it returns one of the following error codes:
>  *
>  *	  0	No partition with the specified type was found.
>  *
>  *	  1	Partition /dev/bda1 has the specified type.
>  *	  2	Partition /dev/bda2 has the specified type.
>  *	  3	Partition /dev/bda3 has the specified type.
>  *	  4	Partition /dev/bda4 has the specified type.
>  *
>  *	 65	Partition /dev/hda1 has the specified type.
>  *	 66	Partition /dev/hda2 has the specified type.
>  *	 67	Partition /dev/hda3 has the specified type.
>  *	 68	Partition /dev/hda4 has the specified type.
>  *
>  *	129	Partition /dev/sda1 has the specified type.
>  *	130	Partition /dev/sda2 has the specified type.
>  *	131	Partition /dev/sda3 has the specified type.
>  *	132	Partition /dev/sda4 has the specified type.
>  *
>  *	252	The raw drive is not seekable.
>  *	253	Neither /dev/hda nor /dev/bda is available.
>  *	254	An invalid partition type was specified.
>  *	255	Usage message displayed.
>  *
>  * Note that the error code only indicates the FIRST partition in the
>  * sequence listed above that is of the relevant type.
>  */
> 
> #include <stdio.h>
> 
> unsigned char digit(char ch)
> {
>     if (ch >= '0' && ch <= '9')
> 	return ch - '0';
>     else if (ch >= 'A' && ch <= 'F')
> 	return ch + 10 - 'A';
>     else if (ch >= 'a' && ch <= 'f')
> 	return ch + 10 - 'a';
>     else
> 	return 0;
> }
> 
> int main(int argc,char **argv)
> {
>     unsigned char table[64];
>     FILE *fp;
>     char *ptr = argv[1], *drive = "/dev/bda";
>     unsigned char n, partition = 0, result = 0;
> 
>     if (argc != 2) {
> 	fprintf(stderr, "Usage: %s <type>\n\n", *argv);
> 	fprintf(stderr, "Where <type> is the hexadecimal partition type required\n");
> 	exit(255);
>     }
>     while (*ptr) {
> 	partition *= 16;
> 	partition += digit(*ptr++);
>     }
>     if (!partition) {
> 	fprintf(stderr, "ERROR 1: Invalid partition type: %02X (%s)\n",
> 		partition, argv[1]);
> 	exit(254);
>     }
>     
>     if ((fp = fopen(drive,"rb")) == NULL) {
> 	drive[5] = 'h';
> 	if ((fp = fopen(drive,"rb")) == NULL) {
> 	    drive[5] = 's';
> 	    if ((fp = fopen(drive,"rb")) == NULL) {
> 		fprintf(stderr, "ERROR 2: Can't open raw drive.\n");
> 		fprintf(stderr, "         Searched /dev/hda - /dev/sda - /dev/bda only.\n");
> 		exit(253);
> 	    }
> 	}
>     }
>     if (fseek(fp,0x1c0,SEEK_SET)) {
> 	fprintf(stderr, "ERROR 3: Can't seek to partition table in /dev/bda\n");
> 	exit(252);
>     }
>     for (n=0; n<64; n++)
> 	table[n] = fgetc(fp);
>     for (n=4; n; n--)
> 	if (table[16*n-14] == partition)
> 	    result = n;
>     if (result) {
> 	printf("%s%d\n",drive,result);
> 	switch (drive[5]) {
> 	    case 's':
> 		result += 64;
> 	    case 'h':
> 		result += 64;
> 	    case 'b':
> 		break;
> 	}
>     }
>     exit(result);
> }



  reply	other threads:[~2002-05-26  6:26 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200205242123.WAA08977@eddie.loc>
2002-05-25 20:52 ` Elks Distribution Neil Holmes
2002-05-25 22:39   ` Stefan de Konink
2002-05-25 22:55   ` Riley Williams
2002-05-26  6:26     ` Neil Holmes [this message]
2002-05-26  8:00       ` Riley Williams
2002-05-26  8:07         ` Neil Holmes
2002-05-26  9:50           ` Riley Williams
2002-05-26 15:27           ` Riley Williams
2002-05-26 12:52   ` pauln
2002-12-18 20:08 ELKS distribution Gábor Lénárt
     [not found] <Pine.LNX.4.33.0206100912170.8487-100000@zeus.edeclaracion.com>
2002-06-10 15:22 ` ELKS Distribution Daniele D'Elia
2002-06-10 15:35   ` Miguel Bolanos
  -- strict thread matches above, loose matches on Subject: below --
2002-06-10 14:29 Daniele D'Elia
     [not found] <Pine.LNX.4.21.0205302112040.15697-100000@Consulate.UFP.CX>
2002-06-01  0:25 ` Elks Distribution Blaz Antonic
2002-05-31 16:13 Neil Holmes
2002-05-30 16:47 Neil Holmes
2002-05-30  7:40 neil.holmes
2002-05-28 21:01 Neil Holmes
2002-05-28 22:47 ` Stefan de Konink
2002-05-29  6:40   ` neil.holmes
2002-05-30 11:40     ` Stefan de Konink
2002-05-30 11:03       ` Riley Williams
2002-05-30 19:38         ` Stefan de Konink
2002-05-30 18:47           ` Riley Williams
2002-05-30 19:35             ` neil.holmes
2002-05-31  5:34           ` Neil Holmes
2002-05-30 18:19       ` Blaz Antonic
2002-05-30 11:57         ` Stefan de Konink
2002-05-30 19:18           ` Blaz Antonic
2002-05-28 17:44 Neil Holmes
     [not found] <Pine.LNX.4.21.0205280728170.15697-100000@Consulate.UFP.CX>
2002-05-28 15:13 ` Javier Sedano
2002-05-28  5:30 Neil Holmes
2002-05-28  5:30 Neil Holmes
2002-05-28  5:29 Neil Holmes
2002-05-28  6:27 ` Riley Williams
2002-05-28  7:14   ` Neil Holmes
2002-05-28 11:12     ` Stefan de Konink
2002-05-28  9:53       ` Neil Holmes
2002-05-28 11:39     ` Alan Cox
2002-05-28 10:51       ` Neil Holmes
2002-05-28 12:01         ` Alan Cox
2002-05-28 11:03           ` Neil Holmes
2002-05-28 15:35     ` Javier Sedano
2002-05-29  8:57       ` Pascal Bellard
2002-05-29 10:17         ` Javier Sedano
2002-05-28 23:11     ` Riley Williams
2002-05-28 23:35       ` Dan Olson
2002-05-29  6:26         ` neil.holmes
2002-05-29 10:33           ` Javier Sedano
2002-05-29 18:31             ` Riley Williams
2002-05-29 23:44           ` Dan Olson
2002-05-30  7:51             ` Stefan de Konink
2002-05-30 13:01               ` Harry Kalogirou
2002-05-30  9:38             ` Javier Sedano
2002-05-29  6:31       ` neil.holmes
2002-05-27 13:46 Neil Holmes
2002-05-27 20:34 ` Michael McConnell
2002-05-28  5:33   ` Neil Holmes
2002-05-28  6:46     ` Michael McConnell
2002-05-28  6:57       ` Neil Holmes
2002-05-28  6:59       ` Neil Holmes
2002-05-27 12:22 Re : " Javier Sedano
2002-05-27 18:52 ` Riley Williams
2002-05-27 20:23   ` Stefan de Konink
2002-05-28  6:11     ` Riley Williams
2002-05-25 21:48 Neil Holmes
2002-05-25 23:22 ` Stefan de Konink
2002-05-26 13:30   ` Nicholas Knight
2002-05-25 23:31 ` Stefan de Konink
2002-05-25 22:06   ` Neil Holmes
2002-05-25 23:41     ` Stefan de Konink
2002-05-25 22:15       ` Neil Holmes
2002-05-25 23:47         ` Stefan de Konink
2002-05-25 22:22           ` Neil Holmes
2002-05-25 23:51             ` Stefan de Konink
2002-05-27 16:59   ` Dan Olson
2002-05-26 14:37 ` Blaz Antonic
2002-05-26  6:45   ` Neil Holmes
2002-05-26 15:01     ` Blaz Antonic
2002-05-27 12:30 ` Javier Sedano
     [not found]   ` <3CF33E41.6ED906FB@ascend.com>
2002-05-28 15:46     ` Javier Sedano
2002-05-28 16:30       ` Pascal Bellard
2002-05-24 13:17 Neil Holmes
2002-05-24 14:16 ` Javier Sedano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1022394411.2055.3.camel@nhthinkpad \
    --to=neil.holmes@zoom.co.uk \
    --cc=linux-8086@vger.kernel.org \
    --cc=rhw@InfraDead.Org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox