• 27 Sep 2009 /  Technology
    Microsoft's BarrelFish Multi-Kernel Operating System Architecture.

    Microsoft's BarrelFish Multi-Kernel Operating System Architecture.

    Microsoft has a new pet-project: Barrelfish, a multi-kernel operating system (via OS News). As a bit of back story, a kernel is the meat of an operating system. The kernel is largely responsible for enabling other software to make use of hardware.

    In the research team’s article The Multikernel: A new OS architecture for scalable multicore systems they write “We investigate a new OS structure, the multikernel, that treats the machine as a network of independent cores, assumes no inter-core sharing at the lowest level, and moves traditional OS functionality to a distributed system of processes that communicate via message-passing,”.

    This is really good stuff! From a hardware perspective, this is exactly where the future is headed. When I took “Distributed & Network Programming” I remember the class getting Dr. Allan off on a tangent about how a single computer these days is really a distributed system.

    A “distributed system” is generally thought of multiple computers networked together and working together. This idea was popularized when “a computer” was a pretty straight forward idea. A computer consisted of a processor, some main memory, possibly some persistent memory, and some input/output. Today’s computers are much more complex. A video card often has it’s own dedicated main-memory and set of multiple-processors. Hard disk drives are beginning to contain embedded systems to encrypt data saved on the disks. Even main memory is not a straightforward concept these days, not with virtual memory which requires and additional piece of hardware called a memory management unit. A “personal computer” is a series of smaller computers (video cards, hard drives, processors, etc…) networked together. This will be a continuing trend, which will require much more complex operating systems to manage the hardware. This is why I’m so excited over BarrelFish!

    I think the Dinosaur Book will be needing a new chapter! (aaaaawww yeeeaaahhh… the Dinosaur Book – you know it!)

    I hope Microsoft Open-Sources BarrelFish like they did Singularity, which was their research OS
    in which the kernel, device drivers, and applications were all written in managed code.

    Tags: , , , , ,

  • 22 Sep 2009 /  Code, Technology

    Here’s yet another old C# code snipped from my antiquated and dead blog. But throwin’ this out there for anyone who might find it helpful.

    [cc lang="csharp" tab_size="2"]
    try
    {
    string newTime;
    System.Net.Sockets.TcpClient t =
    new System.Net.Sockets.TcpClient(”time-a.nist.gov”, 13);
    System.IO.StreamReader rd = new System.IO.StreamReader(t.GetStream());
    newTime = rd.ReadToEnd();

    string[] times = newTime.Split(’ ‘); // Parses The String
    rd.Close();
    t.Close();
    Console.WriteLine(”Todays Date Is: ” + times[1]);
    }
    [/cc]

    I read somewhere that in order for this code to work, the TCP client has to be installed and enabled in Windows Vista. The TCP client is not, be default, enabled in Vista. To install it, Control Panel — Programs and Features — Turn Windows Features On or Off — TCP Client.

    However, I tried this after unchecking my TCP client and it still worked – so maybe it’s just an old wive’s tale! I’d suggest trying it without the TCP client installed – but don’t count on it working if you’re planning on distributing this without further research.

    The second line after the opening try { has ” time-a.nist.gov”, which is the time server. You can swap this out with some of the other time servers below.If you were feeling ambitious, you might try creating a class that will try a random time server on it’s first try and then randomly try other time servers if the first x fail.

    Name | IP | Location
    time-a.nist.gov | 129.6.15.28 | NIST, Gaithersburg, Maryland
    time-b.nist.gov | 129.6.15.29 | NIST, Gaithersburg, Maryland
    time-a.timefreq.bldrdoc.gov| 132.163.4.101 | NIST, Boulder, Colorado
    time-b.timefreq.bldrdoc.gov | 132.163.4.102 | NIST, Boulder, Colorado
    time-c.timefreq.bldrdoc.gov | 132.163.4.103 | NIST, Boulder, Colorado
    utcnist.colorado.edu | 128.138.140.44 | University of Colorado, Boulder
    time.nist.gov | 192.43.244.18 | NCAR, Boulder, Colorado
    time-nw.nist.gov | 131.107.1.10 | Microsoft, Redmond, Washington
    nist1.datum.com | 209.0.72.7 | Datum, San Jose, California
    nist1.dc.certifiedtime.com | 216.200.93.8 | Abovnet, Virginia
    nist1.nyc.certifiedtime.com | 208.184.49.9 | Abovnet, New York City
    nist1.sjc.certifiedtime.com | 208.185.146.41 | Abovnet, San Jose, California

    Tags: , , , ,

  • 21 Sep 2009 /  Code, Technology

    This is an older post, from another [now dead] blog of mine, but I thought I’d throw it up here as well.

    When working in C#, if you are trying to load a jpeg file and you use the System.Drawing.Image.FromFile method on a file that you do not have the proper permissions for, you will get an “Out of Memory” exception. Somewhat misleading – but that is the error resulting from improper permissions.

    I found a web site that claimed that you create a FileStream object from your file and then use the FromStream method on the Image object.

    My solution for loading a file was as follows
    [cc lang="csharp"]
    private void addPhotoButton_Click(object sender, EventArgs e)
    {
    DialogResult newPhoto;
    Image newPhotoImage;
    string newPhotoFileName;
    newPhoto = openFileDialogAddPhoto.ShowDialog();
    if(newPhoto == DialogResult.OK)
    {
    newPhotoFileName = openFileDialogAddPhoto.FileName;
    FileStream photoStream =
    new FileStream(newPhotoFileName,
    FileMode.Open, FileAccess.Read);
    newPhotoImage = Image.FromStream(photoStream);
    }
    }
    [/cc]

    Tags: , ,