Subject: Re: questions/remarks on running NetBSD on a falcon030
To: Markus Kilbinger <kilbi@rad.rwth-aachen.de>
From: Leo Weppelman <leo@wau.mis.ah.nl>
List: port-atari
Date: 11/07/1995 23:11:44
Hi,

> Using NetBSD on my Falcon030 (14MB, 540MB SCSI disk, Screenblaster, 32
> MHz accelerator) now for several weeks everything works very stable
> except the following points:
> 
> - Floppy disks: I can mount and read data from (gem)dos disks
> formatted in 360kb (fd0a), 720kb (fd0b) and 1.4mb (fd0c). But every
> attempt to write data to the disk ends in a kernel hung (->reboot
> necessary). When i use the mtools reading works fine, but writing is
> impossible (`Device busy'!?), too. My mistake? (msdos partitions on my
> harddisk work fine.)
I just tried this on my TT without problems. For the Falcon Thomas has
found a bug in the dma-code. If you have the source present, apply the
following patch to atari/dev/dma.c :
--- dma.c.SAV	Sun Oct 29 12:41:02 1995
+++ dma.c	Sun Nov  5 16:38:15 1995
@@ -273,5 +273,6 @@
 	DMA->dma_mode = mode ^ DMA_WRBIT;
 	DMA->dma_mode = mode;
 	DMA->dma_data = nblk;
+	delay(2);	/* TG: This seems to be needed at a falcon */
 	DMA->dma_mode = DMA_SCREG | (mode & DMA_WRBIT);

If this will not fix your problem, could you try just a plain dd(1)
command? Something like: dd if=/dev/zero of=/dev/rfd0b bs=18b
and let me know what it says?

> 
> - I'm running X directly via xdm in /etc/rc. I'd like to have an
> xconsole window as non root. When I start xconsole as non root access
> to /dev/console is denied. Changing /dev/console's ownership to that
> of the non root user very often results in X hangings (no reactions on
> further input (key and mouse)). How can this problem be solved?
I haven't tried this myself, but I do remember having seen this kind
of discussion before on another newsgroup/mailing list. Did you check
one of the X-faqs, it might be a common problem.

> 
> I'm planning to add parallel port support for the kernel. Is there a
> recipe of how to add it? Which files to create/use? Where to announce
> the new port in the kernel? Which kernel structures to supply? etc.
Great! You ask a lot of questions that are hard to answer ;-) There is
no recipe that i know of. Usually, you have a set of files called:
	<dev>.c		Containing the driver itself.
	<dev>reg.h	Containing the hardware register descriptions
			specific for the driver.
	<dev>var.h	Defining the drivers private structures
	<dev>ioctl.h	Defining the ioctl's appropriate for the driver

These files should go in 'atari/dev'.
This is the general framework, in practice especially the <dev>reg.h
contents can't be cleanly separated. A nice example is the PSG chip.
It's I/O ports are used by several devices; floppy/serial/sound .
The same is true for some other chips. I decided to group them
functionally and made an include-file in atari/include. The placeing
of the ioctl-files in 'atari/dev' is questionable because you
generally want them included in '/usr/include/machine/*'. The only
files copied there are those in 'atari/include'. But this is another
thread ;-)
Your driver should support 'auto-config'. This means that you have
to provide the probe & attach functions and add the driver to
'atari/conf/files.atari' and into the kernel config files.
If you have a working driver, send it to me. I'll check it out, test
it, add copyrights and other legal required stuff and, if we're both
satisfied, add it to the official source tree.

Best thing you can do is take a look at the other drivers and take a
look at /usr/share/misc/style for some programming conventions.

If you have questions left, please ask.

Leo.