Roy's Blog

A Hacker's musings on Code | Tech | Life

After starting the year with curses work, I decided to do some more!

Currently we lack Soft Label Key functions as specified by POSIX. What are these? Glad you asked! Soft Label Keys ripoff a line from the bottom of the screen and allow for up to 8 keys to be displayed there. You can define labels for them, colours, etc.

"BIG WHOOP!" I hear you say. "My app already does this, why should I care?"

Because SLK also works with the terminfo database to work out if the terminal natively supports labels (via plab_norm, label_on, etc)! This means a line doesn't have to be ripped off from the screen so no real-estate is lost. Sadly, no terminal actually seems to support these markings. But if one is ever made, it should work fine.

Now, not many curses apps actually use the SLK functions, probably for this very reason. But some do, and it is a standard so I've coded NetBSD to support this natively.

Sadly, this has uncovered a bug in the NetBSD curses library where cursor movement in a one line window at the bottom of the screen appears to push the window up. This is very visible with SLK and will have to be fixed for any apps that actually use it, but the SLK implementation itself is sound as resizing the terminal forces a redraw and it looks fine.

Discuss this Post

Long trip up to Nunsmere Hall for a long over due but fantastic family lunch. The entire Marples and Coulbeck tribes actually managed to make it - not a single person missing!

Marples vs Coulbeck

We need to do this thing more often, especially in such a nice place where everyone was friendly and the food was just awesome. I think I managed to talk with everyone and have time to play with the kids. Speaking of the kids, they were absolute little gems the whole journey - 4 hours up and 4 hours down. Much better behaved than I was at a similar age no doubt ;)

Discuss this Post

So over the holidays, I managed to get in some good quality family time and find some time to work on some Open Source stuff. I meant to work mainly on dhcpcd, but it turned out I spent most of my time working on NetBSD curses library so that Python Curses now works with it. Now, most people reading this blog may not care much for NetBSD or for curses, but it's important because ncurses is used pretty much everywhere by default ..... aside from NetBSD. And most readers should know, I go out of my way to promote interoperable software even when it's at a detriment to my own projects. That's just how I roll.

There is a apparently a thing called PD Curses but I don't know anywhere that actually uses it by default. If you know, please email me @ roy@marples.name or . I do know that the pkgsrc curses framework supports it.

And this is the thing I'm currently doing. As NetBSD curses supports more POSIX functions (and a few ncurses extensions, sadly) more and more packages now work alongside NetBSD curses, so I'm plowing through pkgsrc again moving things to the curses framework. This is important, because there is logic in devel/ncurses to use NetBSD curses when passing certain criteria, but sadly this always brings ncurses as a possibility to be linked or it's header used, both of which are quite bad for NetBSD curses so there is a method to my madness.

One interesting thing though is that since I started comitting my curses patches, it turns out that Sabotage Linux is using NetBSD curses and made it portable. I'm chatting with one of their devs and we're starting to merge of a few of their patches back into NetBSD.

Discuss this Post

My brother got me some very tasty presents for Christmas (and my up-coming Birthday), namely the GIGABYTE BRIX J1900 and a Samsung EVO 750 250G. Santa also brought me 8G of Crucial memory. Putting them all together is a nice new machine to install NetBSD Xen! The key part is this is a low end CPU, but critically supports Intel VT-x virtualization technology.

There were some challenges. Firstly, I couldn't find a way to get into the BIOS. Neither F12, F2 or Del hammering during the boot process worked. While there is a mouse cursor to move and click, it booted too fast to actually use it. Actually, pressing the BSS on screen button did briefly display a keyboard to enter the SSID, but it then booted instead. This meant I couldn't enable PXE boot, so a USB install is needed. This lead onto the next problem ..... NetBSD-7 is too old, you need a recent -current for the USB ports to work. No matter, making a NetBSD USB install was quite trivial, the only challenge being to find a pre-built image. Luckily I found http://daily-builds.netbsd.org/pub/NetBSD-daily/HEAD/ and browsed to the dates images folder to get the install img for amd64.

From this point, installation was trivial. But here are some notes:

  • Allocating 5G to / is enough to install a -current base and compiler, pkgsrc checkout and build xentools.
  • No idea if I need it, but I allocated 1G swap.
  • I setup XEN backing using LVM, so the rest of the disk is allocated to that.
  • I needed to reboot twice to get LVM/Xen to start recognising the assigned LV.
  • The NetBSD Xen How To needs some love in places.

The speed of this box compared to my current Shuttle XS35 is impressive. While I have less disk space (quite a lot less), it should still be enough to replace it entirely and power my email, web and other stuff. As it's Xen, I am hoping that I can use this box to do my open source work on other OS's easily and support more OS's than my exiting laptop allowed (max 4 partitions) which means a faster turnaround time for support.

Discuss this Post

New ISP

tech

As I blogged previously about changing ISP, it has finally happened. The engineer who installed it was very friendly, polite and helpful whilst doing professional job. A credit to the company.

From 16/0.6mbs to 200/20mbs thanks to Virgin Media! OK, it's not quite 200 down, it's quite variable actually. So far, it's normally around 150mbs at peak times, compared to my old service which was rock steady. Probably because I was on low contention service so my max available was pretty much guaranteed. However, it's always 20+ up! And lets be fair, even 50mbs down is x3 better than what I had previosuly, but it's yet to dip under 120mbs. This will be awesome for work conference calls with video :)

Also, one unexpected feature of the Virgin Media SuperHub is the Modem mode (I turned off Router mode as my existing NetBSD router and Unifi wireless AP is better) is that it's not a PPP based modem. At least, not facing me. So I have to run dhcpcd on it to get my address, which makes me feel all warm and fuzzy as it's my personal software! A much easier setup than PPP as well as the MTU for routes can stay at 1500 and not be "adjusted" for PPPoE over PPPoA as is the norm in the UK.

Still, this is only day one, the service could go tits up, but so far the experice is very very nice :)

Discuss this Post