Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jan 2002 23:09:29 +0100
From:      Marc Fonvieille <fonvi@easynet.fr>
To:        Wim Livens <wim@livens.net>
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: porting disk2d64 to freebsd ?
Message-ID:  <20020120230929.A3867@gothic.blackend.org>
In-Reply-To: <20020120215906.GC72391@krijt.livens.net>; from wim@livens.net on Sun, Jan 20, 2002 at 10:59:07PM %2B0100
References:  <20020120215906.GC72391@krijt.livens.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 20, 2002 at 10:59:07PM +0100, Wim Livens wrote:
> 
> I've found a nice tool to transfer Commodore 64 disks to .D64 images
> (http://www.weihenstephan.org/~michaste/disk2d64/)
> 
> However, this is for Linux.  I think it shouldn't be too hard to get
> it to run under freebsd, even for a amateur like me.  I rather not
> install a linux box just for that...
> 
> It's a very small C program that controls the parallel port using
> primitives from linux's <sys/io.h>, like outb() etc.
> 
> I'm not familiar with this but don't mind fooling around a bit so I've
> found that <machine/cpufunc.h> provides the same definitions, so I
> included that and it compiled up to:
> 
> gcc -o disk2d64 -O3 disk2d64.c
> /tmp/cci9d5Ir.o: In function `main':
> /tmp/cci9d5Ir.o(.text+0x6a9): undefined reference to `ioperm'
> *** Error code 1

add to the source:

#include <machine/sysarch.h>

inline unsigned char
inb (unsigned short port)
{
    unsigned char _v;
    
    __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
    return _v;
}

inline void
outb (unsigned char value, unsigned short port)
{
    __asm__ __volatile__ ("outb %b0,%w1"::"a" (value), "Nd" (port));
}

you could use outb and inb like: outb(0x08,port); etc..

and use i386_set_ioperm function instead of ioperm 

Marc


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020120230929.A3867>