Browsing All Posts published on »May, 2011«

A nasty string initialization bug in C

May 31, 2011

5

Today I encountered a bug that was quite difficult to find regarding strings. In order for strings to work they must be null-terminated, and this implies that an array of characters can contain a string with a length equal to the array size minus one, because there must be space for the null character. I […]

Inline assembly instructions in GCC

May 17, 2011

1

In embedded software programming there’s often the need to use assembly-level instructions to reach all the functionalities of the processing core. But when the developing is done almost exclusively in C, it is sometimes a burden, often an added complexity and possibly a nuisance to code separate assembly files containing the needed functions. Other than […]

QEMU raw images real size

May 8, 2011

3

Today I noticed a nice thing about using “raw” hard disk images with QEMU: the images are sparse files. What does it mean? Sparse files are an useful feature of many file system formats that saves space in case of files that contain chunks of zero data. My host’s file system is formatted with ext4, […]

Follow

Get every new post delivered to your Inbox.

Join 445 other followers