delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/28/05:10:09

From: pavenis AT lanet DOT lv
Message-ID: <B0000119506@stargate.astr.lu.lv>
To: Peter Gerwinski <peter AT gerwinski DOT de>, djgpp AT delorie DOT com
Date: Mon, 28 Feb 2000 11:12:02 +0200
MIME-Version: 1.0
Subject: Re: Bill Currie's `serio' module: License and bugs
In-reply-to: <20000227100933.A723@titanic.gerwinski.de>
X-mailer: Pegasus Mail for Win32 (v3.12b)
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--Message-Boundary-23309
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

On 27 Feb 00, at 10:09, Peter Gerwinski wrote:

> Hello,
> 
> we would like to use Bill Currie's `serio' module in GPLed and
> non-GPLed projects.

I also tried to use bcsio20 with:
	DJGPP v2.03
	gcc-2.95.2
	recent binutils snapshots (this year)

Before I was able to do anything usefull I had to fix some bugs...

> 
> Since there is no notice about the license in the source we need 
> a statement from the author (Hi, Bill!:-) to clarify this point.
> GPL with exception for linking (as in `glibc') would be perfect
> for us, LGPL would be fine as well, but of course the license is
> the author's decision.
> 
> (Unfortunately I cannot reach Bill via email; if someone could
> email me his current address that would be most helpful.)

I haven't tried

> 
> And now for two bugs we have encountered:
> 
> We could not assemble `serio.s' with current versions of `gas'.
> Below is a patch that fixes this problem.  We hope that it is
> correct.

Yes it was so.

> 
> Second, we think that we have found a bug in _sio_write():
> 
>     _sio_write:.globl       _sio_write
>                     call    disable
>                     pushl   %eax
>                     pushl   %ebx
>                     pushl   %ebp
>                     pushl   %edi
>                     movl    24(%esp),%ebp
> 
> There is the return address (4 bytes) on the stack, and we
> are `pushl'ing four registers, so the parameters should be
> accessible at 20(%esp).  However we try to access them at
> 24(%esp).  Did this routine ever work correctly?
> 

sio_write() is broken. But this is not only broken procedure.

I'm including my diffs in attachment.

Andris




--Message-Boundary-23309
Content-type: text/plain; charset=US-ASCII
Content-disposition: inline
Content-description: Attachment information.

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  Bcsio.dif
     Date:  28 Feb 2000, 11:07
     Size:  4298 bytes.
     Type:  Text

--Message-Boundary-23309
Content-type: Application/Octet-stream; name="Bcsio.dif"; type=Text
Content-disposition: attachment; filename="Bcsio.dif"

diff -ur3 orig/contrib/bcsio20/djgpp.djl new/contrib/bcsio20/djgpp.djl
--- orig/contrib/bcsio20/djgpp.djl	Fri Mar 14 13:30:48 1997
+++ new/contrib/bcsio20/djgpp.djl	Thu Feb  3 12:47:28 2000
@@ -4,6 +4,8 @@
 {
   .text  0x1000+SIZEOF_HEADERS : {
     *(.text)
+    *(.gnu.linkonce.t*)
+    *(.gnu.linkonce.r*)
     etext  =  . ; _etext = .;
     sltext = . ;
     *(.ltext)
@@ -18,6 +20,12 @@
     *(.dtor)
     djgpp_last_dtor = . ;
     *(.data)
+    *(.gnu.linkonce.d*)
+    *(.gcc_exc*)
+    ___EH_FRAME_BEGIN__ = . ;
+    *(.eh_fram*)
+    ___EH_FRAME_END__ = . ;
+    LONG(0)
      edata  =  . ; _edata = .;
     sldata = . ;
     *(.ldata)
@@ -26,6 +34,8 @@
   }
   .bss  SIZEOF(.data) + ADDR(.data) :
   { 					
+    _object.2 = . ;
+    . += 24 ;
     *(.bss)
     *(COMMON)
      end = . ; _end = .;
diff -ur3 orig/contrib/bcsio20/makefile new/contrib/bcsio20/makefile
--- orig/contrib/bcsio20/makefile	Wed Jul  9 10:01:28 1997
+++ new/contrib/bcsio20/makefile	Wed Feb  9 10:50:18 2000
@@ -1,6 +1,8 @@
 CFLAGS=-Wall -Werror -O2 -g
 CXXFLAGS=$(CFLAGS)
 TARGET_ARCH=-m486
+# The next line is for gcc to find local djgpp.djl
+LDFLAGS=-L.
 
 # strip symbols, if no debug-info requested
 ifneq ($(findstring -g,$(CFLAGS)),-g)
diff -ur3 orig/contrib/bcsio20/serio.s new/contrib/bcsio20/serio.s
--- orig/contrib/bcsio20/serio.s	Wed Jul  9 09:13:18 1997
+++ new/contrib/bcsio20/serio.s	Mon Feb 28 11:05:30 2000
@@ -41,7 +41,7 @@
 		##  ³ ³ ³ ³ ³ ÀÄÁÄÄÄÄÄ Interrupt Id bits (see below)
 		##  ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄ 16550  1 = timeout int. pending, 0 for 8250/16450
 		##  ³ ³ ÀÄÁÄÄÄÄÄÄÄÄÄ reserved (zero)
-		##  ÀÄÁÄÄÄÄÄÄÄÄÄÄÄÄ 16550  set to 1 if FIFO queues are enabled
+                ##  ÀÄÁÄÄÄÄÄÄÄÄÄÄÄÄ 16550  set to 1 if FIFO queues are enabled
 		##
 		## Bits
 		##  21       Meaning            Priority           To reset
@@ -225,7 +225,7 @@
 		ret
 1:		andl	$3,%eax					## incase 16550
 #		movzbl	%al,%eax
-		call	commFuncTable(,%eax,4)	## call the appropriate comm routine
+                call	*commFuncTable(,%eax,4)	## call the appropriate comm routine
 										## IIR==0 (%al==0) -> msr
 										## IIR==2 (%al==1) -> xmit
 										## IIR==4 (%al==2) -> rcv
@@ -594,9 +594,9 @@
 		pushl	%ebx
 		pushl	%ebp
 		pushl	%edi
-		movl	24(%esp),%ebp
-		movl	28(%esp),%esi
-		movl	32(%esp),%edi
+		movl	20(%esp),%ebp
+		movl	24(%esp),%esi
+		movl	28(%esp),%edi
 		orl		%edi,%edi
 		jz		3f
 		movl	xmithead(%ebp),%eax	## testing for overflow so load head into %eax
@@ -629,9 +629,10 @@
 		pushl	%esi
 		movl	8(%esp),%esi
 		## if xmittail == xmithead then there are no characters in the buffer
-		movl	xmittail,%ecx
-		cmpl	%ecx,xmithead
+		movl	xmittail(%esi),%ecx
+		cmpl	%ecx,xmithead(%esi)
 		setne	%cl
+                popl    %esi
 		call	enable
 		movzbl	%cl,%eax
 		ret
@@ -935,7 +936,7 @@
 		andw	irqdmasks(,%ebx,2),%cx	# calculate value to disable this irq
 										# for cleanup
 		jnz		1f
-		btrw	%ebx,oldmasks
+		btrw	%bx,oldmasks
 1:		outb	%al,$0x21
 		movb	%ah,%al
 		outb	%al,$0xa1
@@ -949,7 +950,7 @@
 		inb		$0xa1,%al
 		movb	%al,%ah
 		inb		$0x21,%al
-		btsw	%ebx,oldmasks
+		btsw	%bx,oldmasks
 		jnc		1f
 		orw		irqdmasks(,%ebx,2),%ax	# restore the PIC mask for this irq to what it
 										# was when this module was initialize
@@ -995,9 +996,10 @@
 
 2:		movl	portIIR(%esi),%edx
 		inb		%dx,%al
+		andb    $7,%al
 		shrb	$1,%al
 		jc		3f
-		jmp		init_port_case(,%eax,4)
+		jmp		*init_port_case(,%eax,4)
 		.align	2
 init_port_case:
 		.long	ip_msr
@@ -1055,8 +1057,8 @@
 		pushl	%esi
 
 .if FOR_DJGPP
-		movw	___djgpp_ds_alias,%eax
-		movw	%eax,ourds
+		movw	___djgpp_ds_alias,%ax
+		movw	%ax,ourds
 .endif
 
 		xorl	%eax,%eax
diff -ur3 orig/contrib/bcsio20/term.c new/contrib/bcsio20/term.c
--- orig/contrib/bcsio20/term.c	Wed Jul  9 10:07:52 1997
+++ new/contrib/bcsio20/term.c	Wed Feb  9 10:59:40 2000
@@ -269,7 +269,7 @@
 extern char sldata[] asm ("sldata");
 extern char eldata[] asm ("eldata");
 
-static void __attribute__((contructor))lock_sections(void)
+static void __attribute__((constructor))lock_sections(void)
 {
 	_go32_dpmi_lock_code(sltext,eltext-sltext);
 	_go32_dpmi_lock_data(sldata,eldata-sldata);

--Message-Boundary-23309--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019