Linux.com

Community Blogs



64-bit Computing

Everybody wants the latest and greatest. And in the computer world where everything seems to be outdated quarterly (let's be fair, it's slowed down quite a bit) we need to stay at the top of the world. Right now the top is 64-bit computing on x86. But what does that really mean for you and me?

The processor by default boots as a 16-bit processor (real mode) which is then transitioned into 32-bit (protected mode) by most modern operating systems. Life is well, everything seems to be just fine, but as the world pushes the boundaries so does my memory requirements. Sure my 32-bit memory address space allows for fast access to 4GB of memory, but the world is expanding and soon I'll be needing 8GB or more to keep everything running. We have a little trick called Page Address Extension (PAE) which will let us jump through a few hoops to get access to 64GB, but the page table crawling isn't particularly fast and now we just have that 64GB limit which we'll catch up to in no time (think High Performance Computing - HPC). So what do we do to plan for the future?Let's do the same thing IPv6 did to solve our IP deficit: move to 64-bit (long mode). Now we have a ceiling of somewhere in the realm of 256TB (and we shouldn't have to worry about the future for another five years or so). But watch out, this new memory limit isn't all good. You're now much more vulnerable to cache misses resulting from the increase in size for addressing. It's a good thing Intel has really large L2 caches, but don't look for anything too drastic in the L1 size for a long time.

Great, so we have more address space for memory, what else do we get? Well all you math nerds out there will appreciate the increase in precision for primitive data types, but the average person won't notice any difference. I know what you're thinking: "Is this 64-bit stuff all just a bunch of hype to sell computers?". Well, when you put it that way: yes. But the wonderful thing about the 64-bit roll-out is that AMD got to it first, so whatever they did to set the standards Intel had to follow (interesting side-note: AMD pays royalties to Intel to use 32-bit x86, but Intel pays royalties to AMD for 64-bit x86). The best part of this spec solved the biggest problem the x86 platform has suffered from since the beginning: register starvation. What does that mean? We all know that RAM is faster than your Hard Drive, and that your L2 cache is faster than RAM, and L1 is faster than L2, but the fastest memory is actually on the processor in what is known as registers. The 32-bit x86 spec has eight general purpose registers. Basically everything that happens on the system is passed between these registers and various memory, but that leaves a lot of overlap and massaging of data to get work done. AMD doubled the number of general purpose registers to 16, making it the same as RISC processors from before which consistently beats the x86 CISC architecture on performance time after time (remember kids, the best one doesn't always win). So what do these extra registers get you in the end? If you look at Apple's advertising for the move to 64-bit you get a 20% performance increase just from the additional registers (but remember, your software has to be 64-bit to take advantage of this).

So, is this 64-bit stuff really worth it? Like everything in life, it depends. Sure a fast new processor will speed up your applications, but if you're keeping all your 32-bit applications on a 64-bit operating system you'll probably see a performance decrease. The point of all this is to say that yes the future of the world is 64-bit, but you don't have to use it if you don't want to (and you probably won't as 64-bit software is few and far between - it's not always just a re-compile) and most of the time you don't want to. Windows has a long way to go before you'll see a significant 64-bit presence, Apple has a huge head-start over Microsoft, but the UI won't be fully 64-bit until Snow Leopard later this year, but that darling Linux is at the head of the game in this regard. Remember, it all depends on your applications.

 

Netbooks

The Netbook is the coolest toy I've ever seen for Linux. As someone who loves small screens on laptops (who doesn't want a super thin 12" to carry with them to meetings or to pass through security at the airport) but can't stand the insane prices, I've had to stay in the 13" realm for a while. Then along came this idea of a super-cheap 9" laptop with a tiny keyboard that just looked to cool. That is until you tried to use it - typing on that keyboard was unbearable and the large bezel around the screen made it look as cheap as it costs. But then along came these 10" models with only a slightly reduced keyboard size (95% being the norm) which peaked my interest. Only one thing stood in my way: rationalizing the purchase of another laptop. This one was pretty easy: since I ride my bike to work each day I'm afraid to have one of my nice machines in my backpack which would surely be destroyed in the event of any crash no matter how minor. Great, now I can buy one. $350 later I'm pulling out this only semi-cheap looking laptop with a pathetic three-cell battery and no CD-ROM.

What if I could have a cheap ultra-portable Windows laptop which could connect to my company's VPN (64-bit Linux just can't do it) and run Outlook (Exchange 2007 broke Evolution)? This idea kept flirting with my mind, so I decided to keep Windows XP SP3 32-bit on there. For a while. Now, I won't pretend to be a Windows expert, but I'm a pro at 2000 (which I will argue was a really good OS) and was able to really trim down the install into the most per-formant XP to ever see the light of day! Internet Explorer was unusable, Firefox was painful, but surprisingly Safari seemed perfect for the job. Things were going alright for a few days, but I had to keep restarting the machine every half-hour or so because some application I needed just won't start (and don't even get me started on the delay after clicking on the "start" menu). Maybe I just had a bad install, but XP is no good so Windows not an option (although I hear Windows 7 is good on these things, let's see what happens when that comes out).

Let's talk about the Intel Atom processor running these things. It's a 32-bit single-core processor with Hyperthreading (pseudo-fake second-core), no out-of-order execution engine, and very low power requirements. Well the low power part sounds good at least. Hyperthreading was a terrible joke I though Intel kept hidden in the closet until the Core 2 came around, so I never thought I would see this again (apparently those marketing guys have more say than the engineers again, next step 20GHz processors with a 50-stage pipeline). The lack of an out-of-order execution engine also scares me (imagine removing fuel-injection and going back to carburettor); but that would explain XP running slow with the additional branching due to module message passing.

This thing needed a monolithic kernel; this thing needed Linux. Don't bother with those "Netbook Edition" installs if you know what you're doing, the interface is made for people afraid of the word "Linux." I went ahead and installed the latest and greatest Ubuntu Desktop. I've heard several horror stories about old Ubuntu on Netbooks, but Jaunty is up to the task, especially in a corporate environment. VPN's requiring Java won't run on 64-bit Linux (yet), but 32-bit works well (although I have noticed in my environment that it loses connection every 21 minutes). OpenOffice is always a pleasure to work with, but if you install 'Basket' as a OneNote replacement, and you'll have your co-workers envy. Be careful though, if you're like me and have a Solid State Drive (SDD), you'll want to make sure to not use a journaled file system: use ext2. As there are a finite number of writes to the drive, you'll need to cut corners in this area every chance you get (but be sure to backup, we have journaled file systems for a reason). You will see some swapping with the 1GB Netbooks, I haven't seen any when I maxed it out to 2GB. That doesn't mean you shouldn't have a swap drive, but increasing memory will help the lifespan of the SSD.

There's a lot of FUD coming from Microsoft and their partners these days about Linux being a horrible option for the Netbooks (stories of the Linux options being returned more than their Windows counterparts). I'm more inclined to believe the stories about inept salespeople over-promising what these devices are capable of. From my experience, even though it is only a few weeks, Windows is a poor option for these devices, and Linux is the only viable solution (I would love to see some desktop BSD in this area though, competition is good).

So what's the verdict? These things are fun little toys on the cheap which can do a lot for you in both a personal and professional environment. It's not a full featured laptop, and shouldn't be treated like one. But if you want to surf the net, check your email, chat with friends, or run office productivity software you'll be pleasantly surprised. So will I shed a tear if I crash my bike and with it my Netbook? Yes, but it'll probably be from the broken collar bone and road rash. I already have my eyes on a super-thin six-cell Netbook from Asus, and all I need is a good excuse.

 

Funny compiz

Look at HTML code of http://www.compiz.org

Hint: search after the "style="display:none".

Read more... Comment (0)
 

SocialNerds Webteam Brainstorming

Hallo Freunde,

das SocialNerds Webteam Brainstorming hat ein Ende. (Infos auf: http://socialnerds.org/webteam)

Der Brainstormingthread (http://socialnerds.org/webteam/brainstorming) wird geschlossen.

Die Beiträge sind via http://wiki.socialnerds.org/webteam abrufbar.

 

Making My Own Desktop Manager: Starting at the Beginning

The hardest part of this whole project is the lack of people talking about X Window Managers. There are countless forums post for people asking how to start learning about Window Managers and either get no response or someone just says "read the source code of {insert open-source window manager here}".

While, as a programmer, I probably agree with learning from others' source code; but I also think there is a big gap of information missing from this equation. There are plenty of high-level explanations of the roles of Window Managers and there is source-code. That's about it.

So just to clarify, here are the roles my Window Manager will be responsible for:
  • Listening for events on the root window and all child windows
  • Size and placement of windows when they are first created
  • Show the difference between the focused/active window and all other windows
  • Iconified/Hidden states of windows
  • Resizing windows
  • Moving floating windows
  • Window decoration (If I choose to go down this route?)
  • Launching programs

I decided the next phase would be to write the simplest possible Window Manager. This window manager would allow programs to accept the programs preferred location & size and would also draw a white border around the focused/active window.

The code for this example can also be found in 'simple-wm' in my GitHub project-sandbox. (Including the MakeFile)

#include <X11/Xlib.h>
#include <stdio.h>

#include <stdlib.h>


static Window focused_win;

int handle_xerror(Display *dpy, XErrorEvent *ee) {
   int i=0, alen = sizeof(ee) / sizeof(XErrorEvent);
  for (i=0; i
<alen; i++) {
    fprintf(stderr, "An error occurred: %d\n", ee[i].error_code);
  }
  return 0;
}

int main()
{
  printf("opening display\n");
  Display *d = XOpenDisplay(NULL);

   printf("grabbing default screen\n");
  int screen = DefaultScreen(d);
  printf("default screen = %d\n", screen);

  printf("grabbing root window\n");
  Window root = DefaultRootWindow(d);

  // tell root window you'll be capturing it's events
  XSetWindowAttributes a;
  a.event_mask =   StructureNotifyMask|SubstructureNotifyMask|EnterWindowMask|LeaveWindowMask;   // root + child (sub) windows created, window-in, window-out
  XSelectInput(d, root, a.event_mask);

  // handle errors
  XSetErrorHandler(handle_xerror);

  // capture those events
  XEvent e;

  // main event loop
  for (;;) {
    XNextEvent(d, &e);

    if (e.type == CreateNotify) {
      printf("Event: create\n");
      XSelectInput(e.xcreatewindow.display, e.xcreatewindow.window, a.event_mask);
      XSetWindowBorderWidth(e.xcreatewindow.display, e.xcreatewindow.window, 1); // always set border to 1px
     }

    else if (e.type == ConfigureNotify) {
      printf("EVENT: configure\n");
    }

    else if (e.type == EnterNotify) {
      printf("EVENT: focus-in\n");
      focused_win = e.xcrossing.window;
      a.border_pixel = WhitePixel(e.xcrossing.display, screen);
      XChangeWindowAttributes(e.xcrossing.display, focused_win, CWBorderPixel, &a);
    }

    else if (e.type == LeaveNotify) {
      printf("EVENT: focus-out\n");
      a.border_pixel = BlackPixel(e.xcrossing.display, screen);
      XChangeWindowAttributes(e.xcrossing.display, e.xcrossing.window, CWBorderPixel, &a);
    }
   }
   return 0;
}


To see this window manager in action you will need to edit your .xinitrc file to launch and wait for an xterm and run the window manager form here. I realise I could launch the window manager from .xinitrc as a background process, but I want to watch the events as they happen from my logging in the host xterm shell.

So I:

  • Edited the .xinitrc file for my wmtest user (click here for my .xinitrc file)
  • Logged in as that user via SLiM
  • Started simple-wm:
    • $ /path/to/simple-wm/program&
  • Then launched another terminal window on the other side of the screen:
    • $ xterm -geometry 50x50+500+500

Notice how I didn't need to do anything in the code for the xterm window to position correctly at x=500,y=500 and size of 50charsx50chars? If you don't change the values on the ConfigureNotify event, the client window's hints are accepted! Now when I hover over the xterm window, I get a white border! Hover out and the border goes black! :)

To exit the session just type exit on the xterm shell.

 

mysqldump: error 29 - TEMP SOLUTION

On MYSQL DB with LOTS of tables, you might run into an error with 'mysqldump':

    mysqldump: Got error: 29: File .....

Solution:

    Add --skip-lock-tables to your command

System: CentOS 64bit with MySQL 5.0.45-log
 

nmap: checking port listening in one subnet

nmap -vv -p 23 157.171.250.0/24

 example above is checking any listening port for telnet in subnet 157.171.250.0/24

 

PSA: Warning, Phishers have arrived!

Two nights ago, I checked my inbox. I had a message from a user named "Izzy". Upon opening I discovered its noting but an evil phishing plot. Here is the contents of the message:

Dear Friend, I know that this is an unusual platform for us to be discussing this Kind of business but the situation has necessitated me to use this Medium to communicate you for now. But let me introduce myself to you. I am Miss. Elizabeth Mark, the manager of bill and exchange at the foreign remittance department of my Bank. In my department I discovered an abandoned sum of US$14.5M, (Fourteen Million, and Five Hundred Thousand US Dollars) at our head office Accra Ghana, that belongs to one of our foreign customers, who died along with his wife and only son in a plane crash of Alaska Airlines Flight number 261 which crashed on 31 January, 2000. The owner of this account is Mr. Morris Thompson an American and great industrialist and a resident of Alaska. It is therefore upon this discovery that I now decided to make this Business proposal to you and for our bank to release the money to You, for more detail send me an email in my private email address( This e-mail address is being protected from spambots. You need JavaScript enabled to view it or This e-mail address is being protected from spambots. You need JavaScript enabled to view it ) Yours truly, Miss. Elizabeth Mark.

 If you see something like this in your Inbox or Email please discard it. It's a scam. 

 

On Being a Female Computer Nerd

Sometimes when attempting to explain Linux to friends or family members who are not computer or tech-savvy, I find myself "dumbing down," as much as I'm able to, the explanations I give. Look, I say patiently. There's no green start button. Linux computers don't get infected by viruses. Our systems are inherently more secure than Windows, and don't require you to surrender personal information to use. The reason Internet Explorer on Windows is so slow and insecure is because it tracks all of your personal information, all the time. Linux doesn't do that.

Being a female computer nerd is tough

Being a female Linux nerd is even tougher.

 First and foremost, when asked to explain something technical about an operating system, I'm almost always handed the most incompetent people. A couple of months in a "tech support" position answering telephones proved that. For the short while I was an employee of an ISP, some fairly friendly customers always requested to speak to me directly: old ladies, on-site "engineers" of rival providers and even co-workers would request my input about specific technical problems. The problem with my job (which I loved, minus the telephone part) was that it was in Utah, a place that historically treats women as "less than" men.

As a female techie, I can honestly say that our pay is less commiserate.  Our hours are more demanding. Our challenges are all in all, tougher.

Being in the land of Utah, the questions I received were always all about the Microsoft operating system. Yet. . . Microsoft has never paid me a dime for all of their dollars of profit.  Even after I applied to work there (dear Linux community, please forgive me; it was a long time ago).

And to this day, I still don't have an official employer. Along this path which has been riddled with frustration, I actually now choose to consciously shun employers who require "Microsoft" competence as part of a job description. As in "Microsoft ____" AKA Microsoft (Anything). Especially Excel. It's just not necessary. Being a female computer nerd is tough. Somewhere and some how, we need to erase this stereotype, and open up the idea of computing as being something *more* than Microsoft-based or hyped Apple marketing. 

 

Synchronizing console sessions

Some time ago i found `screen` utility.  With it you can synchronize input and output from two or more console sessions, e.g. for remote illustrations of something.

Read more... Comment (0)
 

Hello, I'm a Linux cheerleader

On another site I write for I was recently called "nothing more than a Linux cheerleader". To that I had to respond with a "You bet I am!" How can you not call me that? I am currently wearing a Ubuntu tee shirt. I have the following tattoos on my right arm:

  • Tux penguin
  • Ubuntu Logo
  • Red hat logo

I will soon be adding to that the Enlightenment logo which will be followed by even more Linux logos.  I make no bones about it, I am proud of my operating system. I am proud of the fact that, for the last ten years I have served the Linux community as a voice and cheerleader from the side of the media. Why? The media has always been a fickle beast. Half of the media see themselves as destroyers of those they write about. They love to criticize so to pump up their own egos. The other half of the media vacillate from one side of the fence to another. Not me. My stance on Linux has only grown more fire over the years. 

Does that mean I am not critical? No. When necessary I am. I am not blind. I have come across my fair share of worthless open source software. But for the most part Linux has always worked for me - not against me.

But this isn't about me...it's really about YOU. 

How many times have you read anything about "market share" and just rolled your eyes? I can't even tell you how many times this has happened to me. Microsoft (and members of the media inside of MS's pockets) is really keen on shoving it  down the throats of the open source community that they own the market. I have a different view of this.

Microsoft owns the consumer market. This is simple math. Proportionally, very few users pay for Linux. Because of this it's impossible to keep track of the numbers. How do I count for only 1 user when I download a single ISO and load it on five PCs and then hand that disk over to someone else who will do the same? 

If I had to make a guess I would say the realistic view of per-machine installations is probably more equal than not. I am staring five machines right now that all have Linux. In my household there are 7 machines running Linux, two machines running OS X, and one running Vista (only because I have to cover Vista for another site.) I bet if we polled the whole of Linux.com the numbers would be staggering how many Linux installations there are.

To that end there needs to be some sort of system put into place to count Linux machines. I don't know the answer to this but it could look something like this:

Every time Linux is installed the final step is for the OS to send a simple packet to a centralized machine that keeps track...say the Linux counter. Instead of needing user intervention just have it happen automatically. I'm sure every distribution would be more than happy to implement this because it would give a more realistic view of what is happening with regards to installation numbers.

What do you say? Is this possible? Should this be implemented? I say GO TEAM GO! But then I am nothing more than a Linux cheerleader. ;-)

 
Page 111 of 139

Upcoming Linux Foundation Courses

  1. LFD312 Developing Applications For Linux
    16 Feb » 20 Feb - Atlanta - GA
    Details
  2. LFD331 Developing Linux Device Drivers
    16 Feb » 20 Feb - San Jose - CA
    Details
  3. LFS220 Linux System Administration
    16 Feb » 19 Feb - Virtual
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board