Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Any experiences with Macs?



On Thu, 28 Aug 2003, Johannes Stezenbach wrote:

> John Dalgliesh wrote:
> > On Wed, 27 Aug 2003, Lauri Pesonen wrote:
> > > Can you 
> > > compile the linuxdvb driver on OS X?
> > 
> > Unlikely. The Mac OS X driver model is quite different to the Linux one.  
> ...
> > When I wanted to get my PCI DVB-T card working in my Mac, I didn't really
> > consider directly compiling the linux-dvb source. Although if I'd known
> > what I know now then I might have tried it. I didn't even know what source
> > files were relevant so I spent a fair bit of time flailing around in the
> > dark, trying various things. Anyway, I ended up writing my own, gleaning
> > the technical details from the linux drivers (thanks guys!)
> > 
> > I am currently in the process of rewriting the Mac driver for the
> > TehcnoTrend DVB-T PCI cards, after my first attempt which was a bit of a
> > dog's breakfast. It is taking me a lot longer than I expected, partially
> > because I want to make it good, and partially because now that I have
> > something working I spend a lot more time watching TV :). The revised
> > version should also make it easier to convert linux-dvb drivers to work 
> > on the Mac. Maybe even with source compatibility ... but that's a long way
> > off :)
> 
> Some time ago Holger started to create a porting layer for the
> DVB driver in dvb-kernel CVS, i.e. he provided prototypes for all
> Linux kernel functions used by the driver so one could possibly
> implement them for OS-X or *BSD.
> 
> Have you had looked at that?

Unfortunately I didn't know about it at the time, or else I would probably
have tried to implement them. But I didn't even know the first thing about
PCI when I started (would my Mac recognise the card?), let alone i2c or
DVB, so I probably wouldn't have got very far :)

Holger sent a very informative mail to the list about a month and a half
ago listing all the functions and macros you'd have the implement
(although some seem to be missing, e.g. mdelay for sure) in the porting
layer. I've only glanced through the list.

> Do you think this approach will work,

I really don't know enough about either the Linux kernel or the Mac OS X 
kernel (i.e. xnu) to say. It's possible. Some of the things which do not 
map well to xnu could probably be emulated (e.g. kernel_thread_setup? no 
idea how that works). All the Apple docs are for their 'IOKit' which 
wraps up all the nasty kernel bits in nice functions and classes for you 
to use. If you want to go underneath that layer then you're on your own.

> or do
> you seen any other way to share code between Linux and OS-X drivers?

I don't think there's much chance of getting the whole thing to compile on 
OS X. But I think there's an excellent chance of getting bits of it work. 
Especially say the frontend drivers - if all they do is talk over an i2c 
bus with a few delays and semaphores then there shouldn't be any problem.

On the other hand, if you're prepared to make a few abstractions in the
source code in CVS to account for platform differences then there's no
doubt the same code could work for both kernels. I think it would be
pretty easy to come up with a thin layer that dealt with the tricky parts 
of each architecture.

But I wonder if this has not already been done? Are there any other open 
source driver projects that maintain compatibility with both Linux and Mac 
OS X (and/or BSD)?


I was going to suggest something like this when I'd got some sort of a DVB
framework in place in Mac OS X, and figured out how it interacts with
Apple's existing driver families (e.g. video input through QuickTime).  
Still I suspect there will be resistance to this idea (of abstracting
linux from the code) from the authors of the drivers - this is 'linux-dvb'
after all!

> Johannes

{P^/



-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index