Re: Serial ports?

2002-06-24 Thread Tor Hildrum

 Has anyone tried accessing serial ports from perl?

I tried accessing a USB-port.
 
 I tried installing Device::Serial and it crashes hard  (text is
 printed on the screen as if it was a console indicating it is waiting
 for the remote debugger to attach).

snip

 Somewhere around test 85 the Mac crashes badly.  Even from user mode.

That is strange. The kernel shouldn't really panic, unless you where running
this process in kernel space. Trying to access an I/O port or
hardware-mapped memory shouldn't give you a kernel panic from user space.
The kernel should just reject it, and send a signal to your process.
 
 I don't know if this crash would affect different serial ports or
 non-SUB serial ports or whatever.
 
 Any thoughts?

I think you have to use a device driver.
Or you need to make your script run in kernel space, you can't access any HW
from user space. 

http://developer.apple.com/techpubs/macosx/Darwin/IOKit/IOKitFundamentals/Ab
out/index.html

Tor




Re: Serial ports?

2002-06-24 Thread Peter N Lewis

At 9:39 + 24/6/02, Tor Hildrum wrote:

   Somewhere around test 85 the Mac crashes badly.  Even from user mode.

That is strange. The kernel shouldn't really panic, unless you where running
this process in kernel space. Trying to access an I/O port or
hardware-mapped memory shouldn't give you a kernel panic from user space.
The kernel should just reject it, and send a signal to your process.

Yeah, that was my thoughts!

I think you have to use a device driver.
Or you need to make your script run in kernel space, you can't access any HW
from user space.

Yes and no.  You're right, I didn't have a driver, the Belkin serial 
ports aren't supported under Mac OS X, so there was in fact no serial 
port available at all.

This still begs the question how can a user process running the Perl 
Device::Serial test scripts completely crash the Mac.  But at the end 
of the day, it isn't going to work anyway because I don't have any 
serial ports (I was confused because I can actually access the serial 
ports as USB devices under Virtual PC from Windows!).

On another Mac with a built in serial port I am just reading/writing 
from /dev/cu.modem and it is working fine.
Peter.
-- 
http://www.interarchy.com/  http://download.interarchy.com/



Re: Serial ports?

2002-06-24 Thread Tor Hildrum

 On another Mac with a built in serial port I am just reading/writing
 from /dev/cu.modem and it is working fine.

Running Mac OS X?
From my understanding, that shouldn't be possible. Unless you are using some
kind of ioctl call.

Tor




YAPC talk

2002-06-24 Thread Chris Nandor

Just a reminder for anyone who will be there, I'll be giving a Mac::Perl
talk at YAPC.  Covered will be an overview of the state of perl on Mac OS
and Mac OS X; different methods for controlling your Mac OS X environment
from perl (including AppleScript, Carbon, Cocoa); MacPerl's place in Mac OS
X; and an announcement about MacPerl on Mac OS X that you may not want to
miss.

Slides will be posted after the talk.

-- 
Chris Nandor  [EMAIL PROTECTED]http://pudge.net/
Open Source Development Network[EMAIL PROTECTED] http://osdn.com/