Graph mode and how to write own apps

Mar 10, 2008 at 3:45 AM
Edited Mar 10, 2008 at 3:48 AM
I build World.proj successfully. Start apps: "Hello", "WebServer" on 80 port, "Play" wavs, etc.
How to run Slide application? It needs graph mode.
I don't know how run my own app (my own "Hello World!"). Write apps in Windows XP in C# (VS2005) and send to Singularity (Virtual PC 2007). Method?
Coordinator
Mar 17, 2008 at 9:02 PM
all more or less from a command prompt...

copy an existing project like ...\base\Applications\Hello\ to ...\base\Applications\MyProj\
cd ...\base\Applications\MyProj\
rename .cs and .csproj files, edit them for content.
msb MyProj.csproj (until it compiles)
back to ...\base
edit distro\tiny.proj and add a line for your app
<Application Include="$(SINGULARITY_ROOT)\Applications\MyProj\MyProj.proj"/>
msb distro\tiny.proj

if all goes well you should be able to run MyProj from the command prompt

special feature: script files present in ...\base\distro\Scripts during the build are then available at the command prompt once you're running
Mar 18, 2008 at 9:43 AM
Thanks, and what about the graph mode?

For running the pong and slide applications graph mode is required. How do you get these applications to run? The reason seems that the device /dev/video is not present, but I have no idea of how to get this device.
Coordinator
Mar 20, 2008 at 1:19 AM
well that's a bit of a mess.
1) (save a copy then) edit ...\base\Distro\LegacyPCDistro.xml and get rid of the <remove> and </remove> lines
from:
<driverRegistryConfig>
<remove>
<driver name="S3Trio64" />
</remove>
to:
<driver name="S3Trio64" />
this gets you the graphics driver

2) pushd ...\base\Applications\Slides
notepad Slides.csproj and add resources for the other bitmaps there (or some of your own!)
change:
<BinaryResource Include="Slide.bmp">
<ClassName>Slides</ClassName>
<Namespace>Microsoft.Singularity.Applications</Namespace>
<FieldName>Content</FieldName>
<OutputAsArray>true</OutputAsArray>
</BinaryResource>
to:
<BinaryResource Include="Slide1.bmp">
<ClassName>Slides</ClassName>
<Namespace>Microsoft.Singularity.Applications</Namespace>
<FieldName>Content</FieldName>
<OutputAsArray>true</OutputAsArray>
</BinaryResource>
<BinaryResource Include="Slide2.bmp">
<ClassName>Slides</ClassName>
<Namespace>Microsoft.Singularity.Applications</Namespace>
<FieldName>Content</FieldName>
<OutputAsArray>true</OutputAsArray>
</BinaryResource>
<BinaryResource Include="Slide3.bmp">
<ClassName>Slides</ClassName>
<Namespace>Microsoft.Singularity.Applications</Namespace>
<FieldName>Content</FieldName>
<OutputAsArray>true</OutputAsArray>
</BinaryResource>
<BinaryResource Include="Slide4.bmp">
<ClassName>Slides</ClassName>
<Namespace>Microsoft.Singularity.Applications</Namespace>
<FieldName>Content</FieldName>
<OutputAsArray>true</OutputAsArray>
</BinaryResource>
<BinaryResource Include="Slide5.bmp">
<ClassName>Slides</ClassName>
<Namespace>Microsoft.Singularity.Applications</Namespace>
<FieldName>Content</FieldName>
<OutputAsArray>true</OutputAsArray>
</BinaryResource>
<BinaryResource Include="Slide.bmp">
<ClassName>Slides</ClassName>
<Namespace>Microsoft.Singularity.Applications</Namespace>
<FieldName>Content</FieldName>
<OutputAsArray>true</OutputAsArray>
</BinaryResource>
and save

3) the code dropped to the RDK may have an issue with 24-bit BMPs so edit each and every bmp and save as 256-color. i'll look into this more, may just be my VPC?

4) edit Slides.sg, public static int Main(string[] args), look for KEY_DOWN. comment out that block. not sure what's up with the keyboard qualifiers.
/*if ((key & (uint)Keyboard.Qualifiers.KEY_DOWN) == 0) {
continue;
}*/

5) msb Slides.csproj
make sure you see a line that starts
C:\codeplex\SINGUL~1\base\Build\mkasm.exe ...
and
C:\codeplex\SINGUL~1\base\Build\csc.exe ...
this tells you the bitmaps you fixed are being resourced. touch Slides.csproj and rebuild if this doesn't happen.

6) popd to ...\base
msb Distro\World.proj

now when you run you should be able to type
slides
at the Singularity> prompt and see your 8-bit pix.
right-arrow (and page up/down etc) navigate slides.
we'll check on lower bit-depths.
Mar 26, 2008 at 2:35 AM
Thanks! It works.
Coordinator
Mar 27, 2008 at 6:46 PM
Edited Mar 27, 2008 at 8:01 PM
Here's a fix for Pong. the keyboard reader really wanted its own thread and SendPollKey() didn't make the RDK liftoff.

1) as above (save a copy then) edit ...\base\Distro\LegacyPCDistro.xml and get rid of the <remove> and </remove> lines
from:
<driverRegistryConfig>
 
Coordinator
Mar 27, 2008 at 7:03 PM
Edited Mar 27, 2008 at 7:59 PM
patch text part 1/4
~~~~~~~~~~~~~~
49c49
Coordinator
Mar 27, 2008 at 7:37 PM
Edited Mar 27, 2008 at 7:58 PM
patch text part 2/4
~~~~~~~~~~~~~~
109,113c163,170
Coordinator
Mar 27, 2008 at 7:54 PM
Edited Mar 27, 2008 at 7:58 PM
patch text part 3/4
~~~~~~~~~~~~~~
164,182d200
Coordinator
Mar 27, 2008 at 7:57 PM
patch text part 4/4
~~~~~~~~~~~~~~
463d449
Coordinator
Mar 27, 2008 at 8:12 PM
Edited Mar 27, 2008 at 10:11 PM
...a fix for Pong above. (long!)
Aug 6, 2008 at 9:57 PM
Hi, what i have to do with this numbers? i dont understand that. Thx
Jan 7, 2009 at 2:06 PM
Hi, could you explain how to implement Pong in singularity. 
Also please explain what these are
patch text part 1/4
~~~~~~~~~~~~~~
49c49

patch text part 2/4
~~~~~~~~~~~~~~
109,113c163,170
<
patch text part 3/4
~~~~~~~~~~~~~~
164,182d200

patch text part 4/4
~~~~~~~~~~~~~~
463d449

Coordinator
Jan 10, 2009 at 12:00 AM
it looks like the text of my patch was removed. sorry for the wasted time.
my response needs to be updated to reflect RDK drop #2.
the good news is there's much less to do.
more soon.
Mar 6, 2009 at 12:35 PM
Edited Mar 6, 2009 at 12:39 PM

Hi,

I've been trying to get the pong app running on the rdk drop 2. The only problem is that there is a limit to the number of connections ( only 1) that we can have active to the LegacyKeyborad driver and someone is already using that connection (the tty/shell ?). Just as a small test I commented the limit checking code(from the driver) but it doesn't really work. I was thinking to add some "focus" code into the driver so that the last app that gets a channel up and running should get the keyboard events.

Also the error returned in pong is misleading as it sais that the contract is not supported.

Any fast hack is welcomed.

Coordinator
Mar 20, 2009 at 12:46 AM
Hi humbi83 - there are plans to retire the LegacyKeyboard driver and replace it with newer facilities (internal bugs 11, 35). Description reads: "Applications should not open /dev/keyboard directly but rather use the .NET Console class. Driver now only accepts a single client." If you'd like to help with migrating some apps to use the .NET Console class, please feel free and submit a patch - otherwise we'll get to this in a subsequent incremental release. Hope this helps.
--
Derrick Coetzee
Microsoft Research Operating Systems Group developer

Mar 21, 2009 at 7:29 PM
Hi,

Thank you for the info. Currently my development laptop is down and waiting for a new gfx board. I'll try to apply your suggestions. Can you please tell me how can I get to the description of internal bugs? For the moment I'm interested in getting to know the development environment and I'd like to also help you in my incursions.

All the best,
Alex.
Mar 23, 2009 at 6:57 AM
Hi,

One question, is there e plan to extend/replace the LegacyKeyboard driver? I don't think that just the Console.Read() can replace the functionality exposed by the driver (key combinations & key press states).

All the best,
Alex.
Coordinator
Mar 31, 2009 at 4:05 AM
Hi Alex - our internal bug database is unfortunately not publically available - I may migrate this database to CodePlex for the sake of visibility but this would require permission from management. There is not a current plan to add new functionality to the LegacyKeyboard driver - in order to deal with sharing it between apps we would require a focus model, which may involve significant design. You are right that this imposes some limitations - any contributor is welcome to take a crack at this themselves. I hope this helps.
--
Derrick Coetzee
Microsoft Research Operating Systems Group developer

Mar 31, 2009 at 2:23 PM
Thank you for the info.

I've implemented the "focus" part and it seems that it works, also some other modification in order to get to a wanted(by me) core functionality.

I was wandering if I can contribute to open issues and add additional code without entering in conflict with planned features in the next releases.

All the best,
Alex.