Linked by Hadrien Grasland on Fri 28th Jan 2011 20:37 UTC
OSNews, Generic OSes It's recently been a year since I started working on my pet OS project, and I often end up looking backwards at what I have done, wondering what made things difficult in the beginning. One of my conclusions is that while there's a lot of documentation on OS development from a technical point of view, more should be written about the project management aspect of it. Namely, how to go from a blurry "I want to code an OS" vision to either a precise vision of what you want to achieve, or the decision to stop following this path before you hit a wall. This article series aims at putting those interested in hobby OS development on the right track, while keeping this aspect of things in mind.
Permalink for comment 460246
To read all comments associated with this story, please click here.
HLL FTL
by Innominandum on Mon 31st Jan 2011 02:32 UTC
Innominandum
Member since:
2005-11-18

Just in case you guys don't believe me: I compiled and disassembled a small segment of code that happened to be on my screen, under GCC 4.5.2:

x^=(x<<13), x^=(x>>17), x^=(x<<5)

Which resulted in:

8B45F0 mov eax,[rbp-0x10]
C1E00D shl eax,0xd
3145F0 xor [rbp-0x10],eax
8B45F0 mov eax,[rbp-0x10]
C1E811 shr eax,0x11
3145F0 xor [rbp-0x10],eax
8B45F0 mov eax,[rbp-0x10]
C1E005 shl eax,0x5
3145F0 xor [rbp-0x10],eax

Ouch. 6 memory references. It runs at an average of 20 cycles on my AMD Phenom 8650. The obvious 2 memory reference replacement runs an average of 8 cycles, more than twice as fast.

This is basic stuff that even a neophyte ASM programmer would not miss.

Edited 2011-01-31 02:35 UTC

Reply Score: 1