Skip to contentSkip to conversation

Common removable media interface?

DISCUSSION Joe Krahn 3 participants 5 messages Dec 18, 2001

lore
Share & tools
lore

Joe Krahn

author
#0 lore raw

I think Linux could use a common removable media interface, sort of like cdrom.c adds a common interface to all CD/DVD. But, cdrom.c does such a good job, it almost seems like the thing to do is to just add acces to other devices to cdrom.c, and maybe rename it to media.c. Other media includes IDE floppies, regular floppies (if they live much longer), solid state media. Maybe even include some access to all media (not to replace the real drivers) like tapes, non-removable disks, etc.

Is anyone working on or thinking about such a thing?
Do other people think this would be useful? Would it be 'bad' to just add IDE floppy access (not well developed) to cdrom.c, (which is already mislabelled now that it handles DVD)?

Joe Krahn

#1 lore raw
Quoted 12 lines · Joe Krahn

I think Linux could use a common removable media interface, sort of like cdrom.c adds a common interface to all CD/DVD. But, cdrom.c does such a good job, it almost seems like the thing to do is to just add acces to other devices to cdrom.c, and maybe rename it to media.c. Other media includes IDE floppies, regular floppies (if they live much longer), solid state media. Maybe even include some access to all media (not to replace the real drivers) like tapes, non-removable disks, etc.

Quoted 7 lines

Is anyone working on or thinking about such a thing?
Do other people think this would be useful? Would it be 'bad' to just add IDE floppy access (not well developed) to cdrom.c, (which is already mislabelled now that it handles DVD)?

Stuff like this belongs in user space, no need to bloat the kernel with it.

Signature · 1 line
Jens Axboe
author
#2 lore raw
In reply to Joe Krahn
Quoted 4 lines · Jens Axboe
Quoted 2 lines · Joe Krahn

I think Linux could use a common removable
media interface, sort of like cdrom.c adds

...

Quoted 6 lines

Stuff like this belongs in user space, no need to bloat the kernel with it.

--
Jens Axboe

OK, you are right. Bloat is bad. So,
would you say that new drivers should keep ioctls to a bare minimum, much less than cdrom.c, and just provide generic access, like SG_IO/HDIO_DRIVE_CMD, as a general rule from now on?
(Sounds OK to me...)

Joe Krahn

#4 lore raw
In reply to Joe Krahn
Quoted 10 lines · Joe Krahn
Quoted 4 lines · Jens Axboe
Quoted 2 lines · Joe Krahn

I think Linux could use a common removable
media interface, sort of like cdrom.c adds

...

Quoted 4 lines

Stuff like this belongs in user space, no need to bloat the kernel with it.

Quoted 8 lines
Quoted 2 lines

--
Jens Axboe

OK, you are right. Bloat is bad. So,
would you say that new drivers should keep ioctls to a bare minimum, much less than cdrom.c, and just provide generic access, like SG_IO/HDIO_DRIVE_CMD, as a general rule from now on?
(Sounds OK to me...)

That's exactly what I'm saying, in fact that's the direction that 2.5 is heading currently (rq->cmd[]). _One_ packet ioctl for your atapi or scsi removables, done.

Signature · 1 line
Jens Axboe
#3 lore raw
In reply to Joe Krahn
Quoted 6 lines

OK, you are right. Bloat is bad. So,
would you say that new drivers should keep ioctls to a bare minimum, much less than cdrom.c, and just provide generic access, like SG_IO/HDIO_DRIVE_CMD, as a general rule from now on?
(Sounds OK to me...)

Even better would be to move the from the existing drivers into a kernel compat module you can load for older apps/tools. Our module tools and kernel code already allow that module to be loaded on demand

Alan