My real-time operating system
ericw.ca
ericw.ca
As for drivers, the OS really only interfaces with 8250 UARTs; both the VT100 terminal and the Marklin digital interface for the trains were connected via RS-232 serial ports. There is also, embedded in the kernel, a micro VGA driver for displaying debug messages.
I don't exactly have a specific open source license in mind. Right now I suppose you could say it's public domain. I'd be happy for it to stay that way, unless somebody would like to convince me otherwise?
It's a little depressing to hear you say it took you three months working really hard, because it means it would probably take me about the same time. (I have no reason to think I'm any smarter than you are.) Maybe I should stick to AVRs for real-time stuff...
I'll plead ignorance with your second sentence. AVRs? And why should it depress you that it took me three months? (Keeping in mind that I was taking other classes at the time, and that there was a ton of competition for lab space.)
If what you want is for the code to always have your name on it, you should use a 4-clause BSD license (the original one with the advertising clause).
It's not really a license, it just lets you certify that you are putting your work in the public domain.
AVRs are these fun little cheap microcontrollers; the Arduinos and Chalkroaches, among other things, use them. Writing enough code to drive a couple of on-board UARTs and switch between some real-time processes on an ATMega AVR would be a thing to do in an evening or a week, not three months. So three months to do the same thing due to the unnecessary complexities of PC hardware is kind of depressing! It's a little less depressing if you were only working on it, like, 8 hours a week or something.
That said, it only took a little over a month to build the OS itself, while the other two months I spent working on the train control program. All the equipment is notoriously flaky so coping with real-world brokenness was probably the biggest time sink.
... That and rage at the crappy, broken, unreliable sensors we had at the time. Damn hardware always messing with pretty software abstractions.
What was your gratuitous fluff process to "prove" that the OS was mostly real-time-ish?
When I did 452 we had to do something on-screen, to demonstrate responsiveness. I did the "water demo effect" (similar to http://www.derschmale.com/demo/pixelbender-water/PixelBender...). It had to animate without hitching under load, which I guess correlates with your response timing tests (the arbitrary threshold being 60 or 30 Hz in this case).
Anyhoo, I meant "process" in terms of OS-level process, and "fluff", because mine was just lame graphical fluff. :)
btw, planning any more co-op terms before you graduate? Drop me a line.
That said, I think your display better demonstrates real-time-ness than my somewhat-less-than-rigorous measurements. By the time you account for all the assumptions I made to get semi-complete numbers, a working demonstration of a real-time process is far more convincing!
The one I had as a kid looked like this: http://www.rubylane.com/shops/seniormovingspecialists/item/T... (though it was previously my dad's)
The only thing I can think of as a next step is to install micro-webcams in the engines and have that virtual-world headgear to see the scenery from the model's viewpoint.
Amazing!
By the way: Why are model railroads still expensive? Shouldn't the Japanese or Koreans (etc) have invaded the market by now with affordable, high-quality goods?
You could do some really cool stuff, like a hardware box for train control that has wi-fi, OLED, and a web server. Combined with some custom equipment, like the engine/webcam idea or others and it could be a killer app/platform.
On the down-side, you need to be really close to the customers, you need to know what sells and what doesn't, and you need tight and immediate feedback as you try new ideas. You also need a way to communicate to lots of them at the same time -- repeatedly.
I think it's a great startup idea. I'd be concerned about those challenges though. The best situation would be to launch as part of a partnership with well-trafficked, locally-run hobby stores. Perhaps with the cooperation/endorsement of a large hobbiest club and good press from the model train magazines.
I don't think any of that is cheap or easy, but there's always obstacles.
The webcam idea may make it viral. Perhaps you can even implement controlling the trains via the net, so that you get a kind of train simulation. Though you would have to be in touch with customers to see if this is an idea that sells.
Would I want to surf home from work and play with my train set? Both as a switchboard operator and as a virtual engineer/passenger? Would I want my friends to share in this experience with me? Running other trains, or coming along for the ride? Making movies of the experiences?
Heck yes. I'd even want a link into FaceBook where people could tell what's going on in my model world in case they wanted to join in.
Model trains are virtual worlds. The more you can make it like a complete MMORPG with social hooks the more viral it becomes (in my opinion)