Category: Operating Systems


This one of those posts where it’s more for ‘me’ and those Googling around. Today, I wanted to install FreeBSD on a memory stick for a server and then configure it in VMware before plugging into the internal USB slot of my server.

Installation was a breeze, booting was a little more difficult as the VMware BIOS doesn’t support booting off USB devices attached to it. To work around this I did the following

$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *320.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            254.3 GB   disk0s2
   3:       Microsoft Basic Data BOOTCAMP                65.4 GB    disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS OSX External            499.6 GB   disk1s2
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *16.0 GB    disk2
   1:                    FreeBSD                         16.0 GB    disk2s1
$ /Library/Application\ Support/VMware\ Fusion/vmware-rawdiskCreator create /dev/disk2 1 SIXTEENGIG buslogic

So you can see in the diskutil list that the disk is on /dev/disk2 – what we then do is use vmware-rawdiskCreator to make a vmdk file represents it (something that Fusion won’t let you do in the UI). You then have to create a NEW VM and attach it to that, you cannot simply attach to an existing VM.

Then you have a nice bootable USB VM!

How do you take a fast operating system and make it impossibly slow to use? That’s easy, install AVG.

Last night, I installed AVG on my Samsung NC-10 thinking that would be good and useful to have some protection. How wrong could I be? Upon reboot the Resident Shield took 100% CPU on the Intel Atom 1.6GHz chip that the NC-10 has and consequently making the entire machine unusable.

Time to try another anti-virus I think. To think that Windows recommended AVG as well…

Today I managed to get time to upgrade my MacBook Pro and Samsung NC10 netbook to Windows 7. Overall, everything went very smoothly however one feature that is on by default caused me much pain; I hate the fact that when I shake the mouse loosely all my windows minimise!

I spent some time hunting for the control panel item to turn it off. Typing in ‘Shake’ into the Control Panel search suggest the ‘Change how your mouse works’ in ‘Ease of Access’. However, there’s no option to turn off shake in there… or is there?

It turns out that ‘Prevent windows from being automatically arranged when moved to the edge of the screen’ means what it says AND disables the mouse shake gesture. Thanks Microsoft for making that intuitive – why do I have to turn both off. I like the arranging feature, I hate the shake feature.

mousefun

I always like to get this freebie when it comes out. I already had the CD’s of 2008.5 and 2008.11. Now I have 2009.6! I booted it up inside a VirtualBox and I am impressed so far. The stability of the Solaris kernel combined with the userland that you come to expect from Sun. I still feel that the tools around it need a bit of work. Then, one has to remember this isn’t Ubuntu.

Either way, if you haven’t asked for your free CD and are interested in trying out this quite nice OS to develop on, go grab the CD from the Open Solaris CD Order Form. It costs nothing, even the P&P is free.

I think the first thing to say is this post is not a slating of Joyent. They are an amazing company and I have never had a problem beyond little things like back end network routing and the like.

So, about two weeks ago, I raised a ticket:

We would like to shut down the accelerator mentioned above as it is surplus to our requirements.

So. The ticket referenced an accelerator with an ‘i’ in it. We got a nice reply that confirmed the request:

I’ve just set xxxxi to be closed on the 17th.

So that’s all good. I verify against my spreadsheets and ensure that it’s all correct. It is, so I think nothing of it. Until this morning! This morning xxxxl (obviously the x’s are censoring the exact numbers/letters) was turned off! Obviously, as we have a large amount of accelerators with Joyent, I picked up the Batphone and gave them a call.

The reply was:

xxxxi was shut down as requested in ticket xxxxx

But xxxxi was up. xxxxl was down. Nope they’d shut the wrong one down. I can imagine what happened. The ticket system is disjointed with the system that manages the accelerators. Somebody typo’d the entry of which one to shut down.

I guess I’ll find out more when it’s not 3am in the morning. Easier to discuss this stuff when people have had a good night’s sleep! Now to try and explain it all to the big boss man!

So, you’re writing a game, and you want to take a screenshot. The most common code sample you’ll probably find around the web will look something like this:

LPDIRECT3DSURFACE9 pd3dsBack = NULL;
LPDIRECT3DSURFACE9 pd3dsTemp = NULL;
if (SUCCEEDED(device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &pd3dsBack)))
{
    D3DSURFACE_DESC desc;
    pd3dsBack->GetDesc(&desc);
    if (SUCCEEDED(device->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &pd3dsTemp, NULL))
    {
        if (SUCCEEDED(device->GetRenderTargetData(pd3dsBack, pd3dsTemp)))
        {
            LPD3DXBUFFER pBuf;
            D3DXSaveSurfaceToFileInMemory(&pBuf, D3DXIFF_BMP, t, NULL, NULL);
        }
        pd3dsTemp->Release();
    }
    pd3dsBack->Release();
}

Now what’s wrong with that? You’ll end up with a BMP in pBuf and then you can do stuff with it, like save it. Or you can use the more direct D3DXSaveSurfaceToFile to save direct to disk (although, handy hint, push the buffer to a thread and save it outside of the rendering loop… no pause in the renderer then.

This code only works with non-multisampled displays too. There is way around that, that’s outside the scope of this post. So… what’s wrong using D3DX to save a picture? Let’s consider these issues that I have come up against:

  • It’s slow – very very slow. If you try and save a PNG it’ll take upwards of a second. JPG is faster!? BMP is fastest.
  • It sometimes doesn’t even take the shot – you’ll just get a bunch of zeroes

Yep, something isn’t quite right there. I’m using the November 2008 SDK and I get a bunch of zeroes from the surface in certain circumstances. Why? Well that’s a very good question. I have no idea why. However, if I make use of LockRect and copy the right bits out that way I get a 100% success rate of reading back the BackBuffer.

So, the surface clearly always has the data, but D3DX fails to read it properly. Obviously, without the source code to D3DXSaveSurfaceToFileInMemory I can’t do any more research into the matter. Taksi has some interesting samples on the topic (although it’s geared to copying the pitch data as well and in fact converting pitch, which you won’t always need to do).

HP Proliant ML115 G5

So, yesterday I got myself one of these: HP Proliant ML115 G5 for a cool £109 inc. VAT! Bargain! Has a Dual-core AMD Opteron 1214, 512MB of RAM (which I popped in a £50 OCZ 4GB kit to get that up to a good level) and a 160GB SATA HDD.

Why? Well my old home server (which ran Solaris) popped it’s cloggs a couple of weeks ago and I wanted my desktop computer back!

It’s a nice little machine but has a few issues that people Googling and coming across this might like to hear solutions too:

  1. VMware ESXi 3.5 Update 2 DOES work on this machine. You have to boot it off of a USB pendrive though. Thankfully there is a USB port on the motherboard inside the case! So you can embed a pendrive in there.
  2. FreeBSD 7.0 RELEASE will NOT run. You have to get the latest STABLE snapshot CD (June ‘08 onwards) and it will then work.
  3. OpenSolaris 2008.05 snv_86 will NOT boot. The only one that will is snv_95, and even then it won’t detect the network card. It’s expected to be all fixed in snv_97 if the bug reports are to believed (when that will appear, nobody knows).
  4. Solaris 10u5 will NOT run on this machine either, for the same reasons as OpenSolaris.

Personally, I recommend the ESXi route – especially as Update 2 is finally fixed. Other than the fact that non-Windows OS’s have issues on this server, it’s a lovely quiet little box. I mean, almost silent – even with 4 SATA disks inside. The build quality is top notch. For the price, grab a couple and use them for testing out network virtualization setups… one idea I have is on as an iSCSI server and the other as a diskless ESXi. Maybe you could use 3 and test out VMotion :)

ACPI on Open Solaris

They’ve known about this one for over a year – yet they still haven’t fixed it. It appears that if you have an Abit AB-9 QuadGT motherboard the thermal zone monitor (tzmon) will constantly spaff errors at you. To fix this as a once off you can do:

modinfo | fgrep tzmon
# Grab the number from the first column, mine was 124
modunload -i 124

Problem solved. If you want it fixed between reboots, you’ll need to edit the tzmon.conf and then perform an init 6 (don’t just reboot!).

Open Solaris 2008.5 is out

It seems Open Solaris 2008.5 has made an appearance on the Internet. I just installed it onto a new HDD to discover a few odd things.

The main one is lack of things in the SMF database. I had to import the Apache 2.2 manifest into SMF myself. That seems a little odd.

lpackham@opensolaris:~# svccfg
svc:> import /var/svc/manifest/network/http-apache22.xml
svc:> exit
lpackham@opensolaris:~# svcs -a | fgrep apa
disabled       10:56:04 svc:/network/http:apache22
lpackham@opensolaris:~#

Somewhat irritating – but at least it now works.

Yes it does indeed – So I did this in the end:

cd /opt/local/bin
mv ginstall ginstall.old
ln -s /usr/bin/install ginstall

Everything works for me now :)

Powered by WordPress and Motion by 85ideas.