Cooking with Linux - The Virtual Streets of $HOME
François, what are you looking for on Freshmeat? Quoi? A program to digitize you so you can go inside the computer? Yes, I know what it looks like in the movies, but virtual reality hasn't quite made it there yet. I thought you understood that when we discussed lightcycles months ago. No, François, I don't think people are going to be living inside computers anytime soon. I'm not laughing at you, mon ami. I am just amused, that's all. No, I'm sorry to disappoint you, but I don't think there are cities or people in your Linux system either. We will discuss this later. Our guests will be here any moment, and we must be ready for them.
What did you say, mon ami? They are already here? Quickly, François, help our guests to their tables. Welcome, everyone, to Chez Marcel, where fine wine meets exceptional Linux fare and the most superb clientele. When you have finished seating our guests, François, head down to the wine cellar and bring back the 2002 Ctôes du Roussillon Villages.
François and I were just discussing the possibility of virtual worlds inside our computers, a truly amazing prospect but one that is still fantasy. It's true that amazing things have happened in the time I've been working with computers. Your Linux system is one of those things, and its open nature means a freedom to explore that simply doesn't exist elsewhere. Still, I keep thinking that the computing model in general is still in its infancy. Maybe it's because I watched too much science fiction and as a result, my expectations are a bit high. Think back to the movie Tron, for instance. In the opening sequence, Flynn the hero of the show, sends a program named CLU into the system to locate some missing files. CLU, the program, looks like Flynn and moves around in a 3-D tank while a companion bit offers yes or no advice. There are towering skyscraper-like structures all around as he navigates his tank down digital streets. That's the virtual computer world I wanted to experience in my younger days.
Ah, François, you have returned with the wine. Please, pour for our guests. May I suggest, mes amis, that you enjoy the many hidden flavors in this excellent red.
Although there may be no hidden worlds inside the system, plenty of things are otherwise hidden from view. Virtual consoles, for instance, scroll information that is hidden from view once your graphical desktop starts up. Sure, you could jump out of your graphical session with a Ctrl-Alt-F1 to see what is happening out there, but there is a better way. To view the hidden contents of that virtual console, type the following at a shell prompt (you will need root permissions for this):
cat /dev/vcs1
You see, what you may not know is that your system keeps track of the contents of those virtual consoles (1-6) in a special device file, /dev/sdaX, where X is the number of your virtual console. For example, here is a sample of the output of the first VT on my Ubuntu test system:
* Starting OpenBSD Secure Shell server... [ ok ] * Starting Bluetooth services... hcid sdpd [ ok ] * Starting RAID monitoring services... [ ok ] * Starting anac(h)ronistic cron: anacron [ ok ] * Starting deferred execution scheduler... [ ok ] * Starting periodic command scheduler... [ ok ] * Checking battery state... [ ok ] * Starting TiMidity++ ALSA midi emulation... [ ok ] Ubuntu 6.04 "Dapper Drake" Development Branch francois tty1
This is interesting stuff, but it hardly qualifies as a hidden world, and it just doesn't have the Wow! factor my humble waiter is looking for. Yet, despite what I said to François, there are ways to see cities inside your Linux system. It's a bit of a stretch, but some fascinating visualization programs exist—experimental in nature—that try to create a real-world view of the virtual world of processes, memory and, of course, programs. One of these is Rudolf Hersen's ps3 (see the on-line Resources), and to take full advantage of ps3, you need a 3-D video card with acceleration.
Compiling the program is fairly simple, but it does require that you have the SDL development libraries:
tar -xjvf ps3-0.3.0.tar.bz2 cd ps3-0.3.0 make
To run the program, type ./ps3 from the same directory, and you should see a 3-D representation of your process table. When it starts, you may get something other than an ideal view, but that's the whole point of ps3. You can rotate the views in all three axes and look at the process table from above or below. If the processes are too high at the beginning, simply scale them down to something more reasonable. Each process is identified by its program name and its process ID.
Navigating the ps3 display is done entirely with the mouse. Click the left-mouse button and drag to rotate and adjust the height and speed of horizontal rotation. Click and and drag using the right-mouse button to rotate the view horizontally and vertically. The wheel on your mouse lets you zoom in and out. To quit the ps3 viewer, press the letter Q on the keyboard.
ps3 is in no way a scientifically accurate means of viewing system processes, but it is enlightening and entertaining. So now we have virtual buildings and the makings of a virtual city somewhere inside your system. All we're missing now are tanks. Well, I may have an answer to that one as well. It's called BZFlag, and this certainly calls for François to refill our glasses. Mon ami, if you please.
Trending Topics
| You Need A Budget | Feb 10, 2012 |
| The Linux powered LAN Gaming House | Feb 08, 2012 |
| Creating a vDSO: the Colonel's Other Chicken | Feb 06, 2012 |
| Your CMS Is Not Your Web Site | Feb 01, 2012 |
| Casper, the Friendly (and Persistent) Ghost | Jan 31, 2012 |
| Razor-qt 0.4 - Qt based Desktop Environment | Jan 30, 2012 |
- Fun with ethtool
- Parallel Programming with NVIDIA CUDA
- Readers' Choice Awards 2011
- 100% disappointed with the decision to go all digital.
- Linux-Based X Terminals with XDMCP
- Validate an E-Mail Address with PHP, the Right Way
- You Need A Budget
- The Linux powered LAN Gaming House
- Why Python?
- Python for Android
- BeOS was the best
1 hour 38 min ago - I use Wireshark on a daily
6 hours 9 min ago - buena información
11 hours 15 min ago - One important "bucket" that I didn't note (désolé si qqun deja d
12 hours 16 min ago - Gnome3 is such a POS. No one
21 hours 43 min ago - Gnome 3 is the biggest POS
21 hours 54 min ago - I didn't knew this thing by
1 day 3 hours ago - Author's reply
1 day 7 hours ago - Link to modlys
1 day 8 hours ago - I use YNAB because of the
1 day 8 hours ago







Comments
/dev/sdaX
You see, what you may not know is that your system keeps track of the contents of those virtual consoles (1-6) in a special device file, /dev/sdaX
Just a little slip but /dev/sdaX refers to a scsi drive not the virtual console /dev/vcs1 mentioned previously in the article.
/dev/sdaX
Hello Luke,
Well, Sacré Bleu! I knew what I was typing before hand but another device file snuck in there accidentally. You are absolutely correct to point it out. That should have been /dev/vcsX for the virtual console device. And I thought it was such a cool trick, too . . . [ insert appropriate smiley here ].
Thanks again, and take care out there.
-- Marcel
Marcel (Writer and Free Thinker at Large) Gagné
http://www.marcelgagne.com AND www.cookingwithlinux.com