Monday, October 25, 2010

One, two, three... testing!

Many of you already know I've been busy with a 'top secret' electronics project. Especially Jakub has been nagging me to reveal something. Today I can share with you this photo of some mysterious tests that I've been performing. The results were satisfactory. That's all I will say for now. Mwahahaha!

For those less versed in electronics let me describe the action for you. What you see in the picture are three joined-up breadboards. On the breadboards we see some DIL ICs plus a bunch of wires and other stuff. The thing on the middle breadboard is a surface-mounted IC soldered to a home-made PCB which has pins on the bottom side and allows one to plug the chip into the breadboard.

And yes, the thing on the left side is a Logitronik II because George says every mad scientist should have a Logitronik II in their basement.

Monday, August 9, 2010

Reading for week 32

The guys from the (presumably dead) TUNES project seem to have liked writing essays more than actually writing code. (At least I was not able to find any). Compared to their cloud-castle project, Sysel seems boring and pure mainstream ^_^.

They seem to have a clear opinion on microkernel OS design (calling it an abstraction inversion) which I recommend reading.

While cannot agree with everything therein, the article (or manifesto or whatever it is) accurately points out the principal weaknesses of microkernel design as such (as well as the faults in existing microkernel-based designs).

Thursday, July 29, 2010

Ensnared by the magic box

The magical Pandora's box surely worked its magic on me. I am now on the waiting list for the Pandora Console having just pre-ordered (and pre-payed) it. Now I just have to bear with the incredibly looong waiting time. (Supposing I do receive the console, it will be a pleasant surprise if I receive it this calendar year. Surprise me.)

When I bought the Neo FreeRunner it was mostly for the sake of porting HelenOS to it as I am not really into smartphones. It is still a cool device, though, thanks to the integrated Wireless Ethernet, GPS and accelerometers (and the openness, of course).

With Pandora the situation is a little different. I really like old games and this is the retro gaming device. The real selling point for me is the keyboard (although it probably is not a great one). Pandora also has gamepad controls, but I don't really like gamepads, anyway. It also has integrated WiFi (just imagine the multiplayer possibilities!) So I definitely want to use it on gaming (you could call it love at first sight).

Porting HelenOS to Pandora should be relatively easy now, I should think, as I've already fixed the bugs that prevented HelenOS from running on a real ARM processor (despite working in emulators). Also, Pandora uses U-Boot just as FreeRunner does, so bootloader should not be a problem either.

Anyway it will be long before I have my Pandora, so I still have plenty of time to improve FreeRunner support :-)

Thursday, June 17, 2010

Watchen sie die blinkenlichten

Turn on CC (captions) in the player before starting the video.

Friday, June 4, 2010

GCC: plus plus or not plus plus?

It appears that GCC has green light to start using C++ in their code. The idea seem to have been under consideration for about two years. This time, however, it has been approved by the GCC steering commitee and the FSF.

The surrounding discussion is is pretty much the old battle between C++ proponents (who point out its many merits) and opponents (who point out its many flaws). Concerns about speed and the need to teach GCC devs to use C++. Concerns about 'misuse of C++ features.' I find the slowness argument especially amusing since Clang/LLVM is written in C++ and it does not appear to be suffer from severe performance problems.

And of course there are those who suggest only to use a subset of C++ that would not incur performance penalty nor contain features that are 'easily misused'. I hear many software projects claiming to use C++ are actually written in different, mutually incompatible subsets of C++ (using or not using exceptions, RTTI, templates, etc.) This seems to be encouraged by the historically bad conformance of C++ compilers to the language standard.

Looking away from the rather amusing bickering, does this change affect me, a mere mortal user? Well normally I couldn't care less. When I compile GCC on Linux this certainly does not present any problem. From HelenOS point of view, this is more interesting.

To make HelenOS self-hosting, we need to be able to have some compiler which can be compiled within the system. Question is, which compiler should it be? Today GCC is still a hot candidate -- it is probably the only compiler supporting all the CPU architectures and other features we need. Another selling point was it being written in C -- which it will now lose. In the future it would be necessary to implement or port the C++ standard library (and STL) to HelenOS in order to compile GCC in it.

This makes GCC drop closer to Clang/LLVM on our suitability ladder. (Clang/LLVM is also written in C++). Practically the only remaining deficiency of Clang/LLVM w.r.t GCC is that unlike LLVM itself, which should have good support for several architectures, Clang currently only has good support for i386/x86_64. It should not be hard to improve Clang support for other targets, but still there must be sufficient demand to drive the development (Apple does not need it).

Another player in the field is the Portable C Compiler. It is written in C, but it is a relatively small project and supports only a few CPU architectures. (Interestingly neither LLVM nor PCC support Intel Itanium architecture). I have some misgivings against depending on such project whose future is not very certain.

In any case, the choice of a (first) C compiler to run in HelenOS remains open for now.

Friday, March 5, 2010

Hash or dash?

I am pleased to say that SBI (Sysel Bootstrap Interpreter) is making good progress. You can already create object instances, play with the variadic built-in function Exec, raise and handle exceptions, etc.

Now I know you might think I am just being silly, but I still haven't decided on how to write comments. Basically I am oscillating between hash (as you saw in previous posts) and dash (--), i.e. double hyphen, for denoting comments.

Hash is easier for me to type, because I can type hash with my left hand and use arrow keys with my right hand at the same time. For double hyphen I either need to use the little finger of my right hand, or lift the hand and move it towards the minus key.

From aesthetic point of view... I just don't know. Most of the time I seem to prefer dash, although it clashes with the bullet point hyphens in the BSD license in the HelenOS format (but an alternative form could be used for that).

What I am quite confident with is that the commonly used comments should be single-line comments, where comments blocks would be created by typing in a series of single-line comments. Multi-line comments would only be used for disabling sections of code (typically for debugging purposes).

Doc-blocks will be started by a special single-line comment (such as ## or ---) and continued by regular single-line comments (such as # or --).

An interesting idea here pertains to the way of denoting the 'brief' part of the doc block. The common methods include: (1) up to the first period (.), (2) the first paragraph, (3) the first paragraph if marked with some special tag (such as @brief). Another way which came to my mind is that if the 'brief' part spanned more than one line, all these lines would use the same doc-comment mark. Example:


## First line of doc brief and
## this is the second line.
#
# This is no longer part of
# the brief.


or


--- First line of doc brief and
--- this is the second line.
-
- This is no longer part of
- the brief.



Do you like one of these comment styles better than the other? If so, why? Or would you recommend yet another one? Let's hear ye!

Tuesday, February 23, 2010

Watch out HelenOS, here comes Sysel!

It is alive! I had to put in some hacks to avoid name conflicts and I had to implement fgets() in the HelenOS C library, but SBI now works in HelenOS. It's not really a big deal, as SBI still doesn't do so much, but it's still nice.

If you're eager to try it, check out this Bazaar branch.

Build the system as usual and boot it. There are some really trivial demos in the sysel/ directory. Just run SBI with the source file pathname as argument. For example:


# sbi sysel/hello.sy


Well... back to work!