public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
* Config.in help needed
@ 2002-05-24 18:36 Stefke
  2002-05-24 20:37 ` Riley Williams
  0 siblings, 1 reply; 12+ messages in thread
From: Stefke @ 2002-05-24 18:36 UTC (permalink / raw)
  To: linux-8086

hi,

If I have the following code in config.in (in drivers/block)

   bool 'SSD disk support' CONFIG_BLK_DEV_SSD
   bool 'Internal disk support' CONFIG_BLK_DEV_ID
   define_bool CONFIG_BLK_DEV_BIOS n

   if [ "$CONFIG_BLK_DEV_SSD" = "y" ]; then
      choice 'Size off SSD (in Kb)' \
             "128 CONFIG_BLK_DEV_SSD_128\
              256 CONFIG_BLK_DEV_SSD_256\
              512 CONFIG_BLK_DEV_SSD_512\
             1024 CONFIG_BLK_DEV_SSD_1024\
             2048 CONFIG_BLK_DEV_SSD_2048" 512
   fi

can I use the following code in a program ? (wrt_dsk.c)


#ifdef CONFIG_BLK_DEV_SSD

#ifdef CONFIG_BLK_DEV_SSD_128
#define BLOCKS 2
#endif

#ifdef CONFIG_BLK_DEV_SSD_256
#define BLOCKS 4
#endif

#ifdef CONFIG_BLK_DEV_SSD_512
#define BLOCKS 8
#endif

#ifdef CONFIG_BLK_DEV_SSD_1024
#define BLOCKS 16
#endif

#ifdef CONFIG_BLK_DEV_SSD_2048
#define BLOCKS 32
#endif

#endif

Or do I need to do more ? Can someone give me some feedback on how those
config.in files work ?

Stefaan


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Config.in help needed
  2002-05-24 18:36 Config.in help needed Stefke
@ 2002-05-24 20:37 ` Riley Williams
  2002-05-24 21:43   ` Stefke
  0 siblings, 1 reply; 12+ messages in thread
From: Riley Williams @ 2002-05-24 20:37 UTC (permalink / raw)
  To: Stefke; +Cc: linux-8086

Hi Stefke.

> If I have the following code in config.in (in drivers/block)
>
>	bool 'SSD disk support' CONFIG_BLK_DEV_SSD
>	bool 'Internal disk support' CONFIG_BLK_DEV_ID
>	define_bool CONFIG_BLK_DEV_BIOS n
> 
>	if [ "$CONFIG_BLK_DEV_SSD" = "y" ]; then
>		choice 'Size off SSD (in Kb)' \
>			"128	CONFIG_BLK_DEV_SSD_128 \
>			 256	CONFIG_BLK_DEV_SSD_256 \
>			 512	CONFIG_BLK_DEV_SSD_512 \
>			1024	CONFIG_BLK_DEV_SSD_1024 \
>			2048	CONFIG_BLK_DEV_SSD_2048" 512
>	fi
>
> can I use the following code in a program ? (wrt_dsk.c)
>

	#include <linuxmt/config.h>

>	#ifdef CONFIG_BLK_DEV_SSD
>
>	#ifdef CONFIG_BLK_DEV_SSD_128
>	#define BLOCKS 2
>	#endif
>
>	#ifdef CONFIG_BLK_DEV_SSD_256
>	#define BLOCKS 4
>	#endif
>
>	#ifdef CONFIG_BLK_DEV_SSD_512
>	#define BLOCKS 8
>	#endif
>
>	#ifdef CONFIG_BLK_DEV_SSD_1024
>	#define BLOCKS 16
>	#endif
>
>	#ifdef CONFIG_BLK_DEV_SSD_2048
>	#define BLOCKS 32
>	#endif
>
>	#endif
>
> Or do I need to do more ? Can someone give me some feedback on how
> those config.in files work ?

Providing you have the include line I've added before you make use of
any such variable, that's fine. The config system turns the results of
doing either `make config` or `make menuconfig` into both the .config
file for the Makefiles and the linuxmt/config.h header file for the C
code.

Best wishes from Riley.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Config.in help needed
  2002-05-24 20:37 ` Riley Williams
@ 2002-05-24 21:43   ` Stefke
  2002-05-24 22:04     ` pauln
  0 siblings, 1 reply; 12+ messages in thread
From: Stefke @ 2002-05-24 21:43 UTC (permalink / raw)
  To: linux-8086

Riley,

> 	#include <linuxmt/config.h>
> 
> Providing you have the include line I've added before you make use of
> any such variable, that's fine. The config system turns the results of
> doing either `make config` or `make menuconfig` into both the .config
> file for the Makefiles and the linuxmt/config.h header file for the C
> code.
> 
> Best wishes from Riley.
> 

That did the trick. Now it compiles just fine.

Thanx

Stefaan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Config.in help needed
  2002-05-24 21:43   ` Stefke
@ 2002-05-24 22:04     ` pauln
  2002-05-25  9:37       ` Stefke
  0 siblings, 1 reply; 12+ messages in thread
From: pauln @ 2002-05-24 22:04 UTC (permalink / raw)
  To: linux-8086

On Fri, May 24, 2002 at 11:43:56PM +0200, Stefke wrote:
 
> That did the trick. Now it compiles just fine.

That's good. If you get a chance you might want to change the location
of the wrt_disk as you need may want a bigger image file size.

However this is  currently done in assembler IIRC

/arch/i86/tools/file.s

But changing it to A: shouldn't be too hard.

Paul

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Config.in help needed
  2002-05-24 22:04     ` pauln
@ 2002-05-25  9:37       ` Stefke
  2002-05-25 10:40         ` pauln
  2002-05-25 21:05         ` Riley Williams
  0 siblings, 2 replies; 12+ messages in thread
From: Stefke @ 2002-05-25  9:37 UTC (permalink / raw)
  To: pauln, linux-8086

Paul,

>
> That's good. If you get a chance you might want to change the location
> of the wrt_disk as you need may want a bigger image file size.
>
> However this is  currently done in assembler IIRC
>
> /arch/i86/tools/file.s
>
> But changing it to A: shouldn't be too hard.
>

file_name:
   .ASCII "loc::m:\\minix.dsk\0"

This seems the code, right ? ;-) I'm not changing it at the moment, since
I'm using a 2Mb 3c and only a 512Kb Flash. Plenty of room on the psion ;-p

But would it be possible to put something like
"rem::c:\\psion\\elks\\minix.dsk\0" in there ?

Never used assembler before :-(

Stefaan


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Config.in help needed
  2002-05-25  9:37       ` Stefke
@ 2002-05-25 10:40         ` pauln
  2002-05-25 21:05         ` Riley Williams
  1 sibling, 0 replies; 12+ messages in thread
From: pauln @ 2002-05-25 10:40 UTC (permalink / raw)
  To: linux-8086

On Sat, May 25, 2002 at 11:37:11AM +0200, Stefke wrote:
 
> file_name:
>    .ASCII "loc::m:\\minix.dsk\0"
> 
> This seems the code, right ? ;-) I'm not changing it at the moment, since
> I'm using a 2Mb 3c and only a 512Kb Flash. Plenty of room on the psion ;-p

Yup - but 2mg disks is more interesting :)

I'd say leave this as is for now as well...

> But would it be possible to put something like
> "rem::c:\\psion\\elks\\minix.dsk\0" in there ?

I imagine so, Simon Wood did this stuff.  It's used by the Psion, I'm
not sure why that bit's in assembler, looks to be for size, although I
can't see it would be that expensive to have in C or OPL.

Some random useful links:

http://www.mungewell.ndirect.co.uk/linux/
http://www.mungewell.ndirect.co.uk/psion/assem.htm
http://www.gumbley.demon.co.uk/crypt.html
http://www.itimpi.freeserve.co.uk/Â
http://www.psionusa.com/Support/Downloads/Samples/Content.html

> Never used assembler before :-(

I've been avoiding learning it until after I get my C sorted.

Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-8086" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Config.in help needed
  2002-05-25  9:37       ` Stefke
  2002-05-25 10:40         ` pauln
@ 2002-05-25 21:05         ` Riley Williams
  2002-05-25 22:06           ` Stefke
  2002-05-26  8:53           ` Stefke
  1 sibling, 2 replies; 12+ messages in thread
From: Riley Williams @ 2002-05-25 21:05 UTC (permalink / raw)
  To: Stefke; +Cc: pauln, Linux 8086

Hi Stefaan, Paul.

>> That's good. If you get a chance you might want to change the
>> location of the wrt_disk as you need may want a bigger image
>> file size.
>>
>> However this is  currently done in assembler IIRC
>>
>> /arch/i86/tools/file.s
>>
>> But changing it to A: shouldn't be too hard.

> file_name:
>    .ASCII "loc::m:\\minix.dsk\0"
>
> This seems the code, right ? ;-) I'm not changing it at the moment,
> since I'm using a 2Mb 3c and only a 512Kb Flash. Plenty of room on
> the psion ;-p

I've just tweaked it, and both the disk size and the filename to use are
now defined in a (new) C header file called tools.h in that directory.
The relevant patch is attached, and has been committed to the CVS tree.

> But would it be possible to put something like
> "rem::c:\\psion\\elks\\minix.dsk\0" in there ?

Certainly possible, though I haven't implemented that yet. However, the
relevant code is now in C rather than assembler, so should be easy for
you to implement if you wish to.

> Never used assembler before :-(

Thankfully, I've been using it for years...

Best wishes from Riley.

========================================================================

Index: CHANGELOG
===================================================================
RCS file: /cvsroot/elks/elks/CHANGELOG,v
retrieving revision 1.305
retrieving revision 1.307
diff -u -5 -r1.305 -r1.307
--- CHANGELOG	15 May 2002 20:53:58 -0000	1.305
+++ CHANGELOG	25 May 2002 20:43:37 -0000	1.307
@@ -31,10 +31,20 @@
 Simon Wood                                               6 Jan 2000-12 Jan 2000
 Thomas McWilliams     tgm9999@yahoo.com                 27 Aug 1999- 2 Apr 2001
 
 -------------------------------------------------------------------------------
 
+Sat May 25 21:30:35 BST 2002	Riley Williams <Riley@Williams.Name>
+
+	* Simplified configuration of SiBO wrt_disk.img utility. The two
+	  configuration parameters are now in a separate tools.h header
+	  file, and both wrt_disk.c and file.s make use of the values in
+	  this header file to achieve the required task.
+	* Made wrt_disk.img use an unsigned long int for the address var
+	  rather than the two separate unsigned short ints that were in
+	  use previously.
+
 Wed May 15 16:00:08 EEST 2002	Harry Kalogirou <harkal@gmx.net>
 
 	* Invert the "Is this system call valid" condition in strace.c
 	  so it actually works.
 	* Added parameters to strace for sys_signal().
Index: arch/i86/tools/tools.h
===================================================================
RCS file: arch/i86/tools/tools.h
diff -N arch/i86/tools/tools.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ arch/i86/tools/tools.h	25 May 2002 20:37:00 -0000	1.1
@@ -0,0 +1,27 @@
+/* Define items that may vary from one configuration to another.
+ * These are as follows:
+ *
+ *	DISK_SIZE	The size of the flash disk we are writing to
+ *			in Kilobytes.
+ *
+ *	DRIVE		The drive letter the source file is on.
+ *
+ *	FILENAME	The filename to assume for the source file.
+ *
+ * These last two are put together in the code to create a string similar
+ * to the following...
+ *
+ *	loc::m:\\minix.dsk
+ *
+ * ...which would be produced for the following definitions...
+ *
+ *	DRIVE		'm'
+ *	FILENAME	"minix.dsk"
+ */
+
+#define DISK_SIZE	128
+
+#define DRIVE		'm'
+
+#define FILENAME	"minix.dsk"
+
Index: arch/i86/tools/file.s
===================================================================
RCS file: /cvsroot/elks/elks/arch/i86/tools/file.s,v
retrieving revision 1.3
retrieving revision 1.5
diff -u -5 -r1.3 -r1.5
--- arch/i86/tools/file.s	27 Nov 2001 12:04:34 -0000	1.3
+++ arch/i86/tools/file.s	25 May 2002 20:45:16 -0000	1.5
@@ -3,33 +3,27 @@
 
 	.text
 	.global _open_file
 	.global _read_byte
 	.global _close_file
+	.global _file_name
 
 _open_file:
 	mov dx, #file_status
-	mov al, #0x00
-
-	mov ah, #0x00		;connect to file server
+	mov ax, #0x0000		; connect to file server.
 	int 0x87
-
-
-	mov bx, #file_name
-	mov cx, #0x00		;binary, readonly
+	mov cx, #0x00		; binary, readonly.
-
+	mov bx, #_file_name
 	mov ah, #0x00
 	int 0x85
-
-	mov file_handle, ax
+	mov file_handle, ax	; Save file handle for later.
 	ret
 
 _read_byte:
 	mov bx, file_handle
 	mov cx, #file_buffer
 	mov dx, #0x01
-
 	mov ah, #0x11
 	int 0x86
 	
 	mov ax, file_buffer
 	ret
@@ -40,12 +34,10 @@
 	mov ah, #0x10
 	int 0x86
 	ret
 
 	.data
-file_name:
-	.ASCII "loc::m:\\minix.dsk\0"
 file_handle:
 	.word 0x0000
 file_buffer:
 	.byte 0x00
 file_status:
Index: arch/i86/tools/wrt_disk.c
===================================================================
RCS file: /cvsroot/elks/elks/arch/i86/tools/wrt_disk.c,v
retrieving revision 1.4
retrieving revision 1.6
diff -u -5 -r1.4 -r1.6
--- arch/i86/tools/wrt_disk.c	23 Apr 2002 17:57:24 -0000	1.4
+++ arch/i86/tools/wrt_disk.c	25 May 2002 20:50:37 -0000	1.6
@@ -1,20 +1,103 @@
-/* This tool copies a Minix Disk image to the 'B' Flash SSD, it assumes
- * that the disk is a 128K Flash and the source file for the image is
- * LOC::M:\MINIX.DSK
+/* This tool copies a Minix Disk image to the 'B' Flash SSD. The original
+ * assumed that the disk was a 128K Flash and that the source file for the
+ * image was LOC::M:\MINIX.DSK but this version draws both parameters from
+ * a separate header file where they can be configured.
+ *
  * It is rather slow at present but uses the SSD driver stuff so should 
  * pick up any improvements as that developes.
  */
 
+#include "tools.h"
+
+/* Select method to use - uncomment the following line to use a single long
+ * int for the address, or comment it to use two short ints instead.
+ */
+
+#define LONG_INT
+/****/
+
+/* Pseudotypes we use internally */
+
+#define DWORD	unsigned long int
+#define WORD	unsigned short int
+#define BYTE	unsigned char
+
+/* Common values generated from the parameters */
+
+#define BLOCKS	((WORD) ((DWORD) DISK_SIZE) / 64UL)
+#define SIZE	(((DWORD) DISK_SIZE) * 1024UL)
+
+/* Prototypes for local functions */
-/* NOTE: Each time this is run it erases the SSD */
 
-#define BLOCKS 2		/* set for 128K SSD, 1 Block = 64K */
+void open_file(void);
+BYTE read_byte(void);
+void close_file(void);
+
+char filename[64];
+
+void print_word(WORD data)
+{
+    LCD_WriteChar('0' + ((data & 0xF000) >> 12));
+    LCD_WriteChar('0' + ((data & 0x0F00) >>  8));
+    LCD_WriteChar('0' + ((data & 0x00F0) >>  4));
+    LCD_WriteChar('0' +  (data & 0x000F)       );
+}
+
+void print_address(WORD high, WORD low)
+{
+    print_word(high);
+    print_word(low);
+    LCD_WriteChar(' ');
+}
 
+void error(char Pass, WORD data, WORD result)
+{
+    LCD_WriteChar('E');
+    LCD_WriteChar('r');
+    LCD_WriteChar('r');
+    LCD_WriteChar('o');
+    LCD_WriteChar('r');
+    LCD_WriteChar(' ');
+    LCD_WriteChar(Pass);
+    LCD_WriteChar(' ');
+    print_word(data);
+    LCD_WriteChar('/');
+    print_word(result);
+    LCD_WriteChar(' ');
+
+    /* Sleep forever - requires a hard reset */
+    while (1)
+	/* Do nothing */;
+}
+
+void strcat(char *tgt, char *src)
+{
+    while (*tgt)
+	tgt++;
+    while (*src)
+	*tgt++ = *src++;
+    *tgt = *src;
+}
+
+/* NOTE: Each time this is run it erases the SSD */
 int main(void)
 {
-    unsigned int high_address, low_address;
-    unsigned char data, result, not_done;
+#ifdef LONG_INT
+    DWORD address;
+#endif
+    WORD high_address, low_address;
+    BYTE data, result;
+#ifndef LONG_INT
+    BYTE not_done;
+#endif
+
+    /* Specify the filename to use */
+    *filename = '\0';
+    strcat(filename, "loc::m:\\");
+    filename[5] = DRIVE;
+    strcat(filename,FILENAME);
 
     /* Connect to SSD in slot 'B' (under 'enter') */
     ssd_open4(0x01);
 
     /* pre-program all bits to zero */
@@ -25,10 +108,28 @@
     LCD_WriteChar('P');
     LCD_WriteChar('r');
     LCD_WriteChar('o');
     LCD_WriteChar('g');
 
+#ifdef LONG_INT
+
+    for (address = 0; address < SIZE; address++) {
+	high_address = (WORD) (address >> 16);
+	low_address = (WORD) (address & 0xFFFF);
+	if ((low_address & 0x1F) == 0) {
+	    LCD_Position(0, 1);
+	    print_address(high_address, low_address);
+	}
+	result = ssd_write4(high_address, low_address, 0);
+	if (result) {
+	    LCD_Position(0, 2);
+	    error('1', data, result);
+	}
+    }
+
+#else
+
     /* for block of 64K write data */
     for (high_address = 0; high_address < BLOCKS; high_address++) {
 	low_address = 0;
 	not_done = 1;
 
@@ -38,21 +139,22 @@
 		print_address(high_address, low_address);
 	    }
 
 	    result = ssd_write4(high_address, low_address, 0);
 
-	    if (result != data) {
+	    if (result) {
 		LCD_Position(0, 2);
-		error(data, result);
+		error('1', data, result);
 	    }
 
 	    low_address++;
 	    if (low_address == 0)
 		not_done = 0;
 	}
     }
 
+#endif
 
     /* need to erase each chip in the SSD */
     LCD_Position(0, 0);
     LCD_WriteChar('E');
     LCD_WriteChar('r');
@@ -69,11 +171,11 @@
 
 	result = ssd_erase4(0);
 
 	if (result) {
 	    LCD_Position(0, 2);
-	    error(high_address, result);
+	    error('2', high_address, result);
 	}
     }
 
     open_file();
 
@@ -85,10 +187,29 @@
     LCD_WriteChar('g');
     LCD_WriteChar('r');
     LCD_WriteChar('a');
     LCD_WriteChar('m');
 
+#ifdef LONG_INT
+
+    for (address = 0; address < SIZE; address++) {
+	high_address = (unsigned short int) (address >> 16);
+	low_address = (unsigned short int) (address & 0xFFFF);
+	if ((low_address & 0x1F) == 0) {
+	    LCD_Position(0, 1);
+	    print_address(high_address, low_address);
+	}
+	data = read_byte();
+	result = ssd_write4(high_address, low_address, data);
+	if (result != data) {
+	    LCD_Position(0, 2);
+	    error('3', data, result);
+	}
+    }
+
+#else
+
     /* for block of 64K write data */
     for (high_address = 0; high_address < BLOCKS; high_address++) {
 	low_address = 0;
 	not_done = 1;
 
@@ -103,62 +224,31 @@
 
 	    result = ssd_write4(high_address, low_address, data);
 
 	    if (result != data) {
 		LCD_Position(0, 2);
-		error(data, result);
+		error('3', data, result);
 	    }
 
 	    low_address++;
 	    if (low_address == 0)
 		not_done = 0;
 	}
     }
 
+#endif
+
     close_file();
 
     LCD_Position(0, 2);
     LCD_WriteChar('D');
     LCD_WriteChar('o');
     LCD_WriteChar('n');
     LCD_WriteChar('e');
     LCD_WriteChar('.');
 
-    /* Sleep for every - requires a hard reset */
+    /* Sleep forever - requires a hard reset */
-    while (1);
+    while (1)
+	/* Do nothing */;
 
-    return (0);
+    return 0;
 }
-
-int print_address(high, low)
-     int high;
-     int low;
-{
-    /* Print out the address at the current location */
-    LCD_WriteChar('0' + ((high & 0xF000) >> 12));
-    LCD_WriteChar('0' + ((high & 0x0F00) >> 8));
-    LCD_WriteChar('0' + ((high & 0x00F0) >> 4));
-    LCD_WriteChar('0' + (high & 0x000F));
-
-    LCD_WriteChar('0' + ((low & 0xF000) >> 12));
-    LCD_WriteChar('0' + ((low & 0x0F00) >> 8));
-    LCD_WriteChar('0' + ((low & 0x00F0) >> 4));
-    LCD_WriteChar('0' + (low & 0x000F));
-
-    LCD_WriteChar(' ');
-}
-
-int error(data, result)
-     int data;
-     int result;
-{
-    LCD_WriteChar('E');
-    LCD_WriteChar('r');
-    LCD_WriteChar('r');
-    LCD_WriteChar('o');
-    LCD_WriteChar('r');
-
-    LCD_WriteChar(' ');
-    print_address(data, result);
-
-    while (1);
-}


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Config.in help needed
  2002-05-25 21:05         ` Riley Williams
@ 2002-05-25 22:06           ` Stefke
  2002-05-26  8:53           ` Stefke
  1 sibling, 0 replies; 12+ messages in thread
From: Stefke @ 2002-05-25 22:06 UTC (permalink / raw)
  To: Linux 8086


> 
> Hi Stefaan, Paul.
> 
> 
> I've just tweaked it, and both the disk size and the filename to use are
> now defined in a (new) C header file called tools.h in that directory.
> The relevant patch is attached, and has been committed to the CVS tree.
> 
> 
> Best wishes from Riley.

Ok, I'll give this a try first thing tomorrow morning.

Stefaan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Config.in help needed
  2002-05-25 21:05         ` Riley Williams
  2002-05-25 22:06           ` Stefke
@ 2002-05-26  8:53           ` Stefke
  2002-05-26  9:39             ` Riley Williams
  1 sibling, 1 reply; 12+ messages in thread
From: Stefke @ 2002-05-26  8:53 UTC (permalink / raw)
  To: Riley Williams, Linux 8086

Riley,

> I've just tweaked it, and both the disk size and the filename to use are
> now defined in a (new) C header file called tools.h in that directory.
> The relevant patch is attached, and has been committed to the CVS tree.
> 
> Best wishes from Riley.
> 

I just got the latest CVS tree, and can't get it to compile anymore....

make[3]: Entering directory `/usr/src/elks/arch/i86/tools'
ld86 -0 -i -D 0x400      -H 0x800        -o wrt_disk.tmp \
        wrt_disk.o file.o \
        ../drivers/char/con_asm.o \
        ../drivers/char/font.o \
        ../drivers/char/key_asm.o \
        ../drivers/block/ssd_asm.o
undefined symbol: lcmpul
undefined symbol: _file_name
make[3]: *** [wrt_disk.tmp] Error 1
make[3]: Leaving directory `/usr/src/elks/arch/i86/tools'
make[2]: *** [toolkit] Error 2
make[2]: Leaving directory `/usr/src/elks/arch/i86'
make[1]: *** [Image] Error 2
make[1]: Leaving directory `/usr/src/elks'
make: *** [elks] Error 2

Any ideas ?

Stefaan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Config.in help needed
  2002-05-26  8:53           ` Stefke
@ 2002-05-26  9:39             ` Riley Williams
  2002-05-26 19:21               ` Stefke
  0 siblings, 1 reply; 12+ messages in thread
From: Riley Williams @ 2002-05-26  9:39 UTC (permalink / raw)
  To: Stefke; +Cc: Linux 8086

Hi Stefaan.

>> I've just tweaked it, and both the disk size and the filename to use
>> are now defined in a (new) C header file called tools.h in that
>> directory. The relevant patch is attached, and has been committed to
>> the CVS tree.

> I just got the latest CVS tree, and can't get it to compile anymore...

Stupid thinko on my part - now fixed and committed to CVS...

Best wishes from Riley.

==========================================================================

Index: CHANGELOG
===================================================================
RCS file: /cvsroot/elks/elks/CHANGELOG,v
retrieving revision 1.307
diff -u -5 -r1.307 CHANGELOG
--- CHANGELOG	25 May 2002 20:43:37 -0000	1.307
+++ CHANGELOG	26 May 2002 09:28:58 -0000
@@ -23,17 +23,22 @@
 Mario Frasca                                            20 Jan 2000-14 Feb 2000
 Paul Nasrat           pauln@truemesh.com                29 Oct 2001-24 Apr 2002
 Per Olofsson          MagerValp@cling.gu.se             25 Feb 2000
 Peter L Vachuska      pvachusk@nconnect.net             13 Aug 2001
 Richard Wallman       murkygoth@murkygoth.uklinux.net    2 Apr 2002
-Riley Williams        Riley@Williams.Name               16 Nov 1998-13 May 2002
+Riley Williams        Riley@Williams.Name               16 Nov 1998-26 May 2002
 Roman Festchook       roma@polesye.net                  27 Oct 2001
 Simon Weijgers        simon@weijgers.com                16 Sep 1998-15 Nov 1999
 Simon Wood                                               6 Jan 2000-12 Jan 2000
 Thomas McWilliams     tgm9999@yahoo.com                 27 Aug 1999- 2 Apr 2001
 
 -------------------------------------------------------------------------------
+
+Sun May 26 10:25:01 BST 2002	Riley Williams <Riley@Williams.Name>
+
+	* Fixed thinko in wrt_disk.img simplification. It now compiles.
+	* Converted open_file in file.s to take filename as parameter.
 
 Sat May 25 21:30:35 BST 2002	Riley Williams <Riley@Williams.Name>
 
 	* Simplified configuration of SiBO wrt_disk.img utility. The two
 	  configuration parameters are now in a separate tools.h header
Index: arch/i86/tools/Makefile
===================================================================
RCS file: /cvsroot/elks/elks/arch/i86/tools/Makefile,v
retrieving revision 1.15
diff -u -5 -r1.15 Makefile
--- arch/i86/tools/Makefile	5 May 2002 10:12:16 -0000	1.15
+++ arch/i86/tools/Makefile	26 May 2002 09:28:58 -0000
@@ -56,11 +56,12 @@
 	ld86 -0 -i -D $(DATA_SEG) -H $(HEAP_SEG) -o wrt_disk.tmp \
 		wrt_disk.o file.o \
 		../drivers/char/con_asm.o \
 		../drivers/char/font.o \
 		../drivers/char/key_asm.o \
-		../drivers/block/ssd_asm.o
+		../drivers/block/ssd_asm.o \
+		../lib/lib86.a
 
 wrt_disk.img: wrt_disk.tmp imgconv
 	./imgconv wrt_disk.tmp wrt_disk.img
 
 build: build.c
Index: arch/i86/tools/file.s
===================================================================
RCS file: /cvsroot/elks/elks/arch/i86/tools/file.s,v
retrieving revision 1.5
diff -u -5 -r1.5 file.s
--- arch/i86/tools/file.s	25 May 2002 20:45:16 -0000	1.5
+++ arch/i86/tools/file.s	26 May 2002 09:28:58 -0000
@@ -3,18 +3,20 @@
 
 	.text
 	.global _open_file
 	.global _read_byte
 	.global _close_file
-	.global _file_name
 
 _open_file:
 	mov dx, #file_status
 	mov ax, #0x0000		; connect to file server.
 	int 0x87
 	mov cx, #0x00		; binary, readonly.
+	push bp
+	mov bp, sp
-	mov bx, #_file_name
+	mov bx, 4[bp]
+	pop bp
 	mov ah, #0x00
 	int 0x85
 	mov file_handle, ax	; Save file handle for later.
 	ret
 
Index: arch/i86/tools/wrt_disk.c
===================================================================
RCS file: /cvsroot/elks/elks/arch/i86/tools/wrt_disk.c,v
retrieving revision 1.6
diff -u -5 -r1.6 wrt_disk.c
--- arch/i86/tools/wrt_disk.c	25 May 2002 20:50:37 -0000	1.6
+++ arch/i86/tools/wrt_disk.c	26 May 2002 09:29:02 -0000
@@ -27,15 +27,15 @@
 #define BLOCKS	((WORD) ((DWORD) DISK_SIZE) / 64UL)
 #define SIZE	(((DWORD) DISK_SIZE) * 1024UL)
 
 /* Prototypes for local functions */
 
-void open_file(void);
+void open_file(char *);
 BYTE read_byte(void);
 void close_file(void);
 
-char filename[64];
+static char filename[64];
 
 void print_word(WORD data)
 {
     LCD_WriteChar('0' + ((data & 0xF000) >> 12));
     LCD_WriteChar('0' + ((data & 0x0F00) >>  8));
@@ -175,11 +175,11 @@
 	    LCD_Position(0, 2);
 	    error('2',high_address, result);
 	}
     }
 
-    open_file();
+    open_file(filename);
 
     /* lets create the disk image */
     LCD_Position(0, 0);
     LCD_WriteChar('P');
     LCD_WriteChar('r');


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Config.in help needed
  2002-05-26  9:39             ` Riley Williams
@ 2002-05-26 19:21               ` Stefke
  2002-05-26 19:38                 ` Stefke
  0 siblings, 1 reply; 12+ messages in thread
From: Stefke @ 2002-05-26 19:21 UTC (permalink / raw)
  To: Linux 8086

Riley,

>
> Hi Stefaan.
>
> >> I've just tweaked it, and both the disk size and the filename to use
> >> are now defined in a (new) C header file called tools.h in that
> >> directory. The relevant patch is attached, and has been committed to
> >> the CVS tree.
>
> > I just got the latest CVS tree, and can't get it to compile anymore...
>
> Stupid thinko on my part - now fixed and committed to CVS...
>

Ok, it compiles fine now, but it wont execute on the psion anymore :-(
Set DISK_SIZE in tools.h to 512, program compiles just fine, moved it over
to psion (3c 2MB, french).
Psion gives the following error after executing :

Programme quitte
Numero de sortie 72

Meaning something like :

Program ended
Exit code 72


Stefaan

> Best wishes from Riley.
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: Config.in help needed
  2002-05-26 19:21               ` Stefke
@ 2002-05-26 19:38                 ` Stefke
  0 siblings, 0 replies; 12+ messages in thread
From: Stefke @ 2002-05-26 19:38 UTC (permalink / raw)
  To: Linux 8086



>
> Ok, it compiles fine now, but it wont execute on the psion anymore :-(
> Set DISK_SIZE in tools.h to 512, program compiles just fine, moved it over
> to psion (3c 2MB, french).
> Psion gives the following error after executing :
>
> Programme quitte
> Numero de sortie 72
>
> Meaning something like :
>
> Program ended
> Exit code 72
>
>
> Stefaan

Just a quick remark, it won't run either if I change DISK_SIZE to 128 again,
same error.

Stefaan


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-05-26 19:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-24 18:36 Config.in help needed Stefke
2002-05-24 20:37 ` Riley Williams
2002-05-24 21:43   ` Stefke
2002-05-24 22:04     ` pauln
2002-05-25  9:37       ` Stefke
2002-05-25 10:40         ` pauln
2002-05-25 21:05         ` Riley Williams
2002-05-25 22:06           ` Stefke
2002-05-26  8:53           ` Stefke
2002-05-26  9:39             ` Riley Williams
2002-05-26 19:21               ` Stefke
2002-05-26 19:38                 ` Stefke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox