LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-22-2005, 01:53 PM   #1
Aphex_Twin2
Member
 
Registered: May 2005
Posts: 54

Rep: Reputation: 15
The limits of Linux


Can Linux accept the concept of "virtual hardware"? It would be a kind of program that from the outside behaves like a hardware device (sound card, video card, ...) and from the inside would interact with one or more pieces of hardware itself. It's something similar to the C++ concept of incapsulation.

It could be something as simple as an improved interface for a piece of hardware or something more complex that would coordinate the behaviour of a part of the system.

I would really appreciate any pointers in the right direction.

The closest I've seen accomplished was the Windows concept of "virtual CD", but I was wondering if you can take it further, and where to begin but with Linux
 
Old 05-22-2005, 02:22 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
as far as CD's are concerned, Linux can use a loopback device to mount a cd image as if it were a real cd, but the principles are much more fundamental and low level than any "virtual" crap in windows. Loopback devices can be used i a number of area, like abstracting video devices and such. I've not seen a lot of projects that use them, but it's certainly possible. Projects like ALSA can also create virtual soundcards, so you can implitcly play back sound from any program into it's virtual input and do whatever you want with it from then on.
 
Old 05-22-2005, 05:05 PM   #3
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
To linux, "everything is a file": My hard drive is the file /dev/hda, my mouse is the file /dev/mouse, etc etc

So it should be pretty much trivial to have software pretend to be hardware - just tell the software to accept input from and give output to a /dev file, and as far as Linux is concerned, that /dev file is as much hardware as anything else.
 
Old 05-22-2005, 07:10 PM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Do you mean virtual hardware such as virtual machines like Xen, Qemu, Bochs and that commercial one whose name escapes me? Cos that sort of virtualisation has been around on linux for a few years now.
 
Old 05-23-2005, 09:27 AM   #5
Aphex_Twin2
Member
 
Registered: May 2005
Posts: 54

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by oneandoneis2
To linux, "everything is a file": My hard drive is the file /dev/hda, my mouse is the file /dev/mouse, etc etc
That is a bit misleading. I think it's "everything is a stream" or "everything is a file stream".

I'm trying to figure out how I can perform low-level I/O operations based on that concept. Is it enough to for instance declare a FILE or a std::i(o)(f)stream for C/C++ and manipulate that?

Edit:
Moreover, can I overwrite something like /dev/mouse with an application or can I supply my own applications that can replace or mimick the behaviour of pieces of hardware?

Last edited by Aphex_Twin2; 05-23-2005 at 09:30 AM.
 
Old 05-23-2005, 09:45 AM   #6
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
Misleading it may be, but it's still a popular line in widespread use...

Last edited by oneandoneis2; 05-23-2005 at 09:46 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
no /etc/limits ? Mig21 Slackware 7 07-25-2005 11:18 PM
Can PIPE_BUF constant in linux/limits.h be changes ? ayb Linux - Newbie 1 06-25-2004 10:48 AM
[URGENT]linux/limits.h: Input/output error havish14 Programming 3 04-20-2004 02:09 PM
CD/RW capacity limits slackerboy Linux - General 14 01-20-2003 01:41 AM
Bandwidth Limits by IP Bomber Linux - Networking 3 01-16-2002 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration