mac osx driver is here

43 views
Skip to first unread message

Joel Reymont

unread,
Feb 4, 2009, 6:42:37 AM2/4/09
to seaf...@googlegroups.com
Grab it from GitHub:

http://github.com/tinycode/seaforth24/tree/master

Please pay attention to the notes in the README file!

The driver shouldn't crash your kernel but writing to the CPU does not
work. It will run and report a success but the blinktest example
doesn't work.

---
http://tinyco.de
--- Mac & iPhone

Joel Reymont

unread,
Feb 4, 2009, 7:09:32 AM2/4/09
to SEAforth
I take it back.

blinktest (and writing to the CPU) works now.

Joel Reymont

unread,
Feb 4, 2009, 3:56:37 PM2/4/09
to SEAforth

garyaj

unread,
Feb 6, 2009, 11:50:51 PM2/6/09
to SEAforth
Thanks for this.

I followed your README and ioreg confirms it loaded. I'm using a
Seaforth40 but according to the spec. sheet the USB dongle is the same
as that of S24.

One question though, is the orange LED on the Seaforth supposed to
light up when I plug the dongle into the USB socket? It doesn't when I
connect to the S40 using Parallels+Ubuntu (until I actually run the VF
'blinktest' script).

Rgds

Gary
> ---http://tinyco.de
> --- Mac & iPhone

Joel Reymont

unread,
Feb 7, 2009, 5:04:40 AM2/7/09
to seaf...@googlegroups.com
I initialize the chip in the driver so the orange light goes on.

This is unnecessary as the chip is initialized again from the Forth
code.

I'll leave this in unless there are objections, I think it's a nice
visual indication of the driver working.

On Feb 7, 2009, at 4:50 AM, garyaj wrote:

> One question though, is the orange LED on the Seaforth supposed to
> light up when I plug the dongle into the USB socket? It doesn't when I
> connect to the S40 using Parallels+Ubuntu (until I actually run the VF
> 'blinktest' script).

---

Dennis Ruffer

unread,
Feb 17, 2009, 6:45:39 PM2/17/09
to seaf...@googlegroups.com
On Wed, Feb 4, 2009 at 5:42 AM, Joel Reymont <joe...@gmail.com> wrote:
>
> Grab it from GitHub:
>
> http://github.com/tinycode/seaforth24/tree/master

Here are the diffs to make your driver work with gforth on OSX:

--- USBdriveMX.f 2009-02-14 18:07:54.000000000 -0600
+++ USBdriveGX.f 2009-02-17 17:27:35.828125000 -0600
@@ -1,4 +1,4 @@
\ (C) 2009 Wager Labs, SA
-\ Author: Joel Reymont
+\ Author: Joel Reymont, gforth modes by Dennis Ruffer
\ Web: http://tinyco.de
\ FORTHdrive interface
@@ -7,7 +7,21 @@
HOST

+[undefined] ENUM [IF] : ENUM ( n -- n+1 ) DUP CONSTANT 1+ ; [THEN]
: CSTR ( -- n ) BL WORD COUNT TUCK 0 DO COUNT C, LOOP DROP 0 C, ;
: ZSTR ( -- ) CSTR DROP ;

+S" gforth" ENVIRONMENT? [IF]
+s" IOKit" add-lib
+
+c-function mach_task_self mach_task_self -- n
+c-function CFRelease CFRelease a -- void
+c-function IOServiceOpen IOServiceOpen n n n a -- n
+c-function IOServiceClose IOServiceClose n -- n
+c-function IOServiceMatching IOServiceMatching a -- a
+c-function IOServiceGetMatchingServices IOServiceGetMatchingServices n a a -- n
+c-function IOIteratorNext IOIteratorNext n -- n
+c-function IOObjectRelease IOObjectRelease n -- n
+c-function IOConnectCallScalarMethod IOConnectCallScalarMethod n n a n a a -- n
+[ELSE]
LIBRARY /usr/lib/libc.dylib

@@ -27,4 +41,5 @@
FUNCTION: IOObjectRelease ( iter -- kr )
FUNCTION: IOConnectCallScalarMethod ( port u addr u addr u -- kr )
+[THEN]

\ Dispatch selectors
@@ -39,5 +54,9 @@

0 CONSTANT kIOMasterPortDefault
+S" gforth" ENVIRONMENT? [IF]
+mach_task_self CONSTANT OUR-MACH-TASK
+[ELSE]
mach_task_self_ @ CONSTANT OUR-MACH-TASK
+[THEN]

CREATE DRIVER-CLASS-NAME ZSTR com_wagerlabs_driver_SEAforth24
@@ -108,7 +127,7 @@
ABORT" Driver write failed" ;

-{ --------------------------------------------------------------------
+0 [IF] --------------------------------------------------------------------
16>OnStream appends a 16-bit word to the stream in the data buffer.
--------------------------------------------------------------------- }
+-------------------------------------------------------------------- [THEN]

: 16>OnStream ( x -- )
@@ -116,5 +135,5 @@
2 SPT-DataTransferLength +! ;

-{ --------------------------------------------------------------------
+0 [IF] --------------------------------------------------------------------
SEAforth [x] buffer transfers

@@ -122,5 +141,5 @@
[x]>USBdrive sends the [x] buffer to the drive.
USBdrive>[x] reads from the drive, compiling into the [x] memory.
--------------------------------------------------------------------- }
+-------------------------------------------------------------------- [THEN]

HOST

Reply all
Reply to author
Forward
0 new messages