Profile

Steve Kerrison
63 followers|108,569 views

Stream

Steve Kerrison

Shared publicly  -

For some reason I always edit my .vimrc in nano﻿
1

Steve Kerrison

Shared publicly  -

Today I've been writing a netfilter-queue for modifying IP packets. Every time I do something involving Ethernet, IP, TCP and what-not, I'm reminded how crazy the headers are. For example, you can add up to 40 bytes of IP option data to an IP header (allocated in 4 byte chunks) via a 4-bit length field. Each option has a field to specify that particular option's type (8-bit), and length (8-bit). The length field denotes the number of bytes in that option header. A single option could be, at most, 40 bytes including its type and length fields, so we have a couple more bits than we need there in the length. Bit of an imbalance between the 4-bit IP header length and 8-bit option field length, and a couple of wasted bits that might have been better spent on a more expressive type field.

Oh well, at least IPv6 is a fair bit nicer!﻿
1

Oooh and now I've run into a bug in old Netgear routers where an IP Option header can lock it up. Nice.﻿

Steve Kerrison

Shared publicly  -

So I'm debugging a piece of code, where the problem is obviously me corrupting some memory somewhere. But, in the process of working out where that is, I see the strangest piece of library code for strlen.

The C equivalent of what it's doing:

size_t n = 1;
do {
x = y[n];
y++;
} while (x);

Where x is a char and y is a char pointer. I guess incrementing n and incrementing y are functionally equivalent in this case, but I like how the compiler (I hope it was the compiler and not hand-written) chose to increment the base rather than the offset. It actually costs an extra instruction in the end because it has to do a bit of pointer arithmetic to work out the string length.

Or have I gone crazy? That is also plausible﻿
1

Oh I should add that it does the comparison of position 0 in the string before hitting that loop, so don't worry, it is still correct :)﻿

Steve Kerrison

Shared publicly  -

So here's a thought: Does having a laptop + external monitor combo actually help you avoid eye fatigue?

Here's my point... in such a setup the laptop screen is more than likely a different distance from your eyes than the external monitor. So, as you switch focus between the two monitors, you're exercising your eye rather than holding the same depth. Granted, it's not quite "focus on macro and then infinity" like you're supposed to do in order to give your eyes a "break" from computer use, but maybe it's enough to increase eye-endurance?﻿
1

If the projection size was appropriate for its distance, I guess so!﻿

Steve Kerrison

Shared publicly  -

Need a quick way of turning a LaTeX equation into an SVG for importing into something that has a crap equation editor, or none at all? Don't know what software to install? Don't bother, use this instead:

http://latex.codecogs.com/svg.latex?EQUATIONGOESHERE

e.g.

http://latex.codecogs.com/svg.latex?E_p%20=%20\sum_i%20\left(%20B_i%20\times%20N_i%20\right)%20+%20\sum_{i,j}%20\left(O_{i,j}%20\times%20N_{i,j}%20\right)%20+%20\sum_k%20E_k﻿
1

Steve Kerrison

Shared publicly  -

The hacking continues. Here's one of our 16-core boards and a peripheral board with some RAM on it (there's a version with an Ethernet adapter slapped onto it too - with a proper version of that on the way as well).

The peripheral board is connected (via a hacked cable for pin compatibility) to the bottom-right corner of the 16-core "Swallow" board. From there it can initialise all the cores in the grid and setup the routing tables. The cores are now sitting waiting to be sent programs via X-Link - no more programming over super-slow JTAG.

The JTAG plugged into the Swallow board is just to monitor stuff for debugging. The green wire is just adding a pull-up and the yellow is to allow the peripheral board to issue a reset to the Swallow grid.

The code, which still needs a fair bit of work to be usable, is on Github - https://github.com/stevekerrison/sw_swallow_xlinkboot - and was built in such a way that means parts of it will be useful for booting other large arrays of XMOS chips in this way (those parts will probably get forked into their own project once the API is stable enough).﻿
1
1
In his circles
69 people
Have him in circles
63 people

Steve Kerrison

Shared publicly  -

Just replaced Nautilus with Nemo. Ahhh, that's better.﻿
1

Steve Kerrison

Shared publicly  -

The data ring on the Xeon Phi is 64 bytes wide? That's a lot of metal going around in a circle!﻿
1

Steve Kerrison

Shared publicly  -

PHP's function signature for array_filter:

array array_filter ( array $input [, callable$callback = "" ] )

PHP's function signature for array_map:

array array_map ( callable $callback , array$arr1 [, array \$... ] )

Just one example of why PHP is stupid.﻿
1

Steve Kerrison

Shared publicly  -

Five ways of generating random  numbers in a shell, with particular thought given to BSD systems where you sometimes have sh, and not a lot else. http://dannyman.toldme.com/2008/07/04/shell-sh-bash-random-splay/﻿
1

Steve Kerrison

Shared publicly  -

Please can this be the default gzip implementation?﻿
1

Steve Kerrison

Shared publicly  -

Anyone want a job? See if you fit the bill for this...﻿
1
People
In his circles
69 people
Have him in circles
63 people
Work
Occupation
PhD student - Energy modelling & optimisation of software - μ Research Group, University of Bristol
Story
Tagline
PhD student in the Microelectronics Research Group - University of Bristol
Introduction
I'm working in the area of energy modelling & optimisation of software. I'm researching within the University of Bristol's Microelectronics Research Group and have also been working closely with Bristol-based semiconductor company XMOS.

You'll occasionally see me on the linux-media mailing list, particularly where DVB-T2 devices are concerned.
Basic Information
Gender
Male