Shared devices vs. Dedicated devices

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pepito

Shared devices vs. Dedicated devices

Post by pepito »

I understand that the devices can be classify as Shared and Dedicated.

Shared: Devices that can be accessed by many process at the same time, obviously using mutual exclusion if is necessary. (Disks, video, etc).

Dedicated: Can be accessed by just one process at a given time. (Keyboard, Printer, etc).

I'm right? (Let me know if not)

But here are my questions:

Where (into the OS) must be defined that a device is shared or dedicated?
In the device list? When the device is open for access?

Exist some device that is both shared or dedicated?

Thank you very much,

pepito
pepito

Shared devices vs. Dedicated devices

Post by pepito »

Sorry, the second question must say:

Exist some device that is both shared AND dedicated?

pepito
TheUbu

RE:Shared devices vs. Dedicated devices

Post by TheUbu »

Pepito,

I guess you can make devices either shared or dedicated. It will mostly be up to your device/resource manager in your OS. It is all up to you how you want to handle it I mean all character devices you will most likely have shared such as disk drives..... but you may want things such as a video device dedicated because there would be many conflicts with multiple things writing to it.... Have you researched many of the existing device managers out there such as whats done in Unix/Windows and the like...


-Christopher
Gnome

RE:Shared devices vs. Dedicated devices

Post by Gnome »

This is another case of "whatever suits your design". There is no hard and fast way of doing this. I believe that, whenever possible, and wherever it makes sense, you should allow resources to be shared. Sometimes, it doesn't make sense, or can be a security risk. The keyboard is probably a good example. Having two programs be able to read keys from the keyboard doesn't really make sense except in certain  situations (like having key combinations that some program responds to no matter which task is active or, in a GUI, has input focus). It can even be a security risk if that program happens to be a keylogger. So maybe, the keyboard is one such device that should be both "shared" or "dedicated", as you call it. Perhaps any user can get access to it, when they have focus, but only programs owned by the administrator (or an equivilent priviledged user) can get global ("shared") access to it.

As for where in the OS it must be defined, my answer is: since when is this a cookbook? You can define it wherever it makes the most sense.

Pretty much any device can be multiplexed to allow multiple users. I think you'll need special cases for devices like the keyboard to apply security policies like the one I described above.

Gnome.
pepito

RE:Shared devices vs. Dedicated devices

Post by pepito »

Yes, I need a solution for the keyboard.

Do you know how can be implemented the SET FOCUS feature?

pepito
CodeSlasher

RE:Shared devices vs. Dedicated devices

Post by CodeSlasher »

The current Top application i.e in a GUI environment it will be the TOP window should be the one that gets the keyboard input when it requests for it. Other background task "Should" not get input from the keyboard since thy are not the TOP window. Same thing applies to Text mode environment. Active tasks (the one the user is interacting with) "should" be the one to get the one that get keyboard input.
pepito

RE:Shared devices vs. Dedicated devices

Post by pepito »

Thank you very much to all!

I resolved the problem yet...

pepito
Post Reply