Library interface in devices

This forum is for general developer support questions.
Post Reply
chris
Posts: 552
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Library interface in devices

Post by chris »

Are the steps to add a library interface to a device documented anywhere?
Is there any example source code for a .device with a library interface?

User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1426
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Library interface in devices

Post by tonyw »

The so-called "library" part is just the data header connecting the ".device" to the system. It enables Exec to start the driver at boot time and DOS to generate a "struct DeviceNode" in the DOS list. Handlers like file systems use a similar (but different) means of initialisation. The driver uses the library "open count" and other flags to make sure that it is not expunged while tasks are using it, much like a library.

I'll send you an example privately.
cheers
tony

chris
Posts: 552
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Library interface in devices

Post by chris »

Thanks Tony, appreciated.

I was wondering if I needed to regenerate the files with fdtrans, but wasn't sure how to even get a .device out of it (I'm using old source code and don't have the original files that were apparently passed through fdtrans).

User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1426
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Library interface in devices

Post by tonyw »

Chris, did you get my PM? I don't know your email address, or at least I'm not sure which Chris I'm talking to ;)
cheers
tony

chris
Posts: 552
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Library interface in devices

Post by chris »

tonyw wrote:Chris, did you get my PM? I don't know your email address, or at least I'm not sure which Chris I'm talking to ;)
No :( I had an empty deleted message, but nothing else.

User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1426
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Library interface in devices

Post by tonyw »

Can you PM me your email address, then? I'll send you the archive I've made up for you.
cheers
tony

Post Reply