Device management

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Device management

Post by bubach »

Hi, I have a few questions about general device management. I have simple MM and VFS implemented, but it struck me that for other types of devices I'd probably need many more abstraction layers just like how the VFS handles storage devices and FS's.

I would need one for sound, one for networking, one for graphics, one for webcams, one for printers and so on... or am I missing something? Also, input could be both from a file and the keyboard, output could be both to screen, COM, USB, file and well lots of stuff.. so would I tie the VFS to both the "input-layer" (keyb/mouse) and to the "output-layer" (VGA/screen) tie VFS, printer and so on to be able to redirect information/pipe stuff. It's getting very confusing... :P

How does other OS's (yours) handle this? Is there other ways to group similar types of devices together in interfaces, like PCI bus ID's or something? Or do I just have to bite the bullet and implement kernel layers to handle each group of hardware in a nice uniform way to user programs?

One thing is for sure, I wont use mount points like *nix style OS's since my OS will be very similar to DOS with a 32-bit unprotected, single tasking environment. Of course any information on how to deal with this stuff is welcome, but it would be even better if my OS goals and design where considered in the replies.

Or maybe if I should do some RTFM'ing, you could be kind enough to point me in the right direction?

TIA,
Christoffer
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Device management

Post by bluemoon »

My Device Manager will organize a tree of devices, with displays, sounds, networks, disks, etc

Each device type shares a common stub that provide basic functionality, while having different extend functions.

Take keyboard as an example, keyboard events is posted to the WM/GUI and deliver to focused process's input queue, that's all.
For console application, the main panel receive the key event and "unget" it to stdin, all done in application's implementation.

In short, the re-direction is done on the user-space "libgloss" which line up different devices and events, and call native kernel function to access devices.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re: Device management

Post by bubach »

Ok, thanks. Well, seems I have my work cut out for me.. :P
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
Post Reply