Porting Linux IOCTL based applications

kantor

Member

Reaction score: 1
Messages: 26

Hi, I wrote a program in Linux that uses specific IOCTL's specifically from the Linux SCSI subsystem the SG_IO and some other CD-ROM IOCTL's (like ejecting/closing the tray and such).
The project is at sourceforge, If you want to take a look here is the project homepage: http://odman.sourceforge.net
I'm using Linux at home, and sometimes FreeBSD. (In the last time I started to use FreeBSD more). But I have no advanced knowledge about the FreeBSD SCSI subsystem and I have no idea if it is possible to port such a program to FreeBSD, but if it's possible I would like to do it (maybe with some help).
 
OP
OP
kantor

kantor

Member

Reaction score: 1
Messages: 26

yes, and no. For instance in the program there are functionalities like reading the identify information from the device controller, or sending close/eject and such commands. In this case you can use the an sg device. But there is a transfer rate test included too. With the test you need to use a block device, the sg driver is a character device so you can't use the sg driver/device to read data from the CD/DVD. (at least this is in linux)
 

rdivacky@

New Member
Developer


Messages: 10

I know no details but there are two positive news for you :)

1) we dont distinguish block/char devices in fbsd anymore so it might "just work"

2) there is some ioctl translation support in the linuxulator, I dont know it might be sufficient, there are some CDROM related ioctls

just go and try that
 
OP
OP
kantor

kantor

Member

Reaction score: 1
Messages: 26

Maybe I need to do some background research in this field but I don't know if it worth's. I do not want to do useless work like porting the software to FreeBSD but nobody gonna use it
 

Mel_Flynn

Well-Known Member

Reaction score: 81
Messages: 379

kantor said:
Maybe I need to do some background research in this field but I don't know if it worth's. I do not want to do useless work like porting the software to FreeBSD but nobody gonna use it
I would start by browsing cdrecord source. Things like eject, transfer rate and so on are covered and it's written highly portable.
A good follow up may be investigating FreeBSD's camcontrol(8) sources and the cam(4) interface in general.

It would help if you posted some details about what your program can do and/or look through FreeBSD ports sysutils/ category (cdrecord, dvd+rwtools, k3b to name a few).
 
OP
OP
kantor

kantor

Member

Reaction score: 1
Messages: 26

Mel_Flynn said:
It would help if you posted some details about what your program can do and/or look through FreeBSD ports sysutils/ category (cdrecord, dvd+rwtools, k3b to name a few).
The program uses the SG_IO ioctl or if that is too old or if it is not present falls back to CDROM_SEND_PACKET ioctl (this is in linux)
The program can do the followings:
- enable/disable auto eject mode
- lock/unlock the tray
- close/eject the tray
- kernel level device debugging
- device resets
- getting the identification information from the controller
including supported DMA/PIO modes, supported/enabled
device features, S-ATA specific informations, and a lot more
- getting the Multi-Media informations like read/write
capabilities, writing modes, buffer size, model, firmware,
serial number . . .
- transfer rate test with direct/indirect IO, adjustable buffer
size and such . . .
- and some other functionalities . . .


I would like to port it but, I don't know if such an utility is useful for the FreeBSD users
 

halplus

Member

Reaction score: 1
Messages: 64

I would like to port it but, I don't know if such an utility is useful for the FreeBSD users
It is usefull for Linux users? Why wouldn't be for us? Of course we would prefer BSD/Beerware license and eventually somebody will feel unconftable enought with GPL to replace it just because of that.
 
Top