Tuesday, April 27, 2010

Sixaxis

So I connected the code from operating systems to the JSIO object. The good news is that when I run JSIO.sixaxis(), the code runs and opens a channel to the controller. On the command line the program states that it is waiting for input. The bad news is that when I press a button it crashes saying "illegal instruction".

I think that it is a permissions issue with reading the joystick input from /dev/input/js0. I remember this happening the first time around and Andres had to allow special permissions. I can get this.

Saturday, April 24, 2010

Connecting to the IO stream

I am trying to get my native object to call the code I created for Operating Systems. The code reads input from a PS3 Sixaxis controller. This would show how I can communicate with low level code through my native object.

The problem is that:
1) I'm not sure where to put that .c file.
1.1) I could just dump it in the js directory but that doesn't seem right.
2) I'm not sure where in the make file to add it or which make file to add it to
3) The code prints to standard out. Would I need to have a shell open? How would I see the output?
4) Making small changes then recompiling is insanely time consuming because the compile time is about 15min.

I'm trying to figure this out but it may take a while.

Thursday, April 8, 2010

SUCCESS!

Got it to work. There is now a native JSIO object in Firefox. Sweetness.

Wednesday, April 7, 2010

Native Object

I added my own custom JSIO native object to the Firefox codebase. It is an object called JSIO and can run the sqrt method from the Math class. Compilation was successful. However, when I try to launch the newly compiled Firefox, it runs the other version on my computer.

When reading the startup script, I noticed that if the script cannot find the correct startup file in its directory, it looks for other versions of it on the disk. So there must be a problem there. I am in the process of tracking it down.

Spring Break

I was on a cruise to Mexico for the last week so I wasn't able to get any work done.

Thursday, March 18, 2010

Compiler Flashback

Still in the process of tracing where in the Firefox code the JavaScript gets turned into C. I have gotten to the JavaScript parser and identified the correct token for the "Math" object. Just need to keep following from there.

Thursday, March 4, 2010

More design

I have stubbed out the JavaScriptIO object with pseudo code for the necessary methods. Layed out the way I want the object to function at the user level. Continued refinement of all aspects. I also determined that the "handler" object must be of type nsIDOMEventHandler. More research is required on the specifics of this object (mozilla's page is light on documentation).

I have also been reviewing my old code from Operating Systems that read IO from a PS3 controller. I'm starting to piece together the way this will be wired.

Tuesday, February 23, 2010

Design

I started the high-level design work last week. This included mapping out what functions would be needed, including short descriptions of their purpose, parameters, and return values. I am in the process of transferring this preliminary design from scratch paper to an electric copy. More refinement will be taking place during this process. Along with heavily borrowing from the structure of XMLHttpRequest.

Not much progress has been made since then. I have been getting a lot done on my 402 project and not really focusing on this. No worries though, JavaScriptIOn's time shall come!

Tuesday, February 9, 2010

Decisions

I have decided that I will be creating the extension for the Firefox web browser. This is because I feel that Firefox has a larger community and because it has been around for a longer period of time, there is a greater chance that people will be able to answer my questions.

So from here I need to start the actual design of what the prototypes will do. In order to do this, I need to make sure that I have a thorough understanding of the I/O process in the browser. Hopefully I cant find source code to aid in this endeavor.

Tuesday, January 26, 2010

Directories

I'm in the process of understanding the structure of Firefox, how it links to OS libraries, and figuring out where my code will live. Some notable directories are:

/content --> data structures for representing web pages
/dom --> interfaces for DOM objects, connection btwn JS and DOM object implementations, some other DOM implementations
/extensions --> houses the different extensions to Firefox
/js/src --> the JavaScript engine
/js/src/xpconnect --> calling C++ from JS and JS from C++
/forms --> render tree of HTML forms (may not be important)
/parser/htmlparser --> pretty self explanatory

/content and /parser/htmlparser will be good ways to learn how the browser goes through html and builds a page. I think its obvious that understanding /js/src and /js/src/xpconnect are essential to this project.

There is much more reading to be done and then on to Chrome!!! Then I can actually start my design.

Tuesday, January 19, 2010

It begins....

This is the first entry in my study journal for JavaScript I/O. I'm thinking I like the name I came up with for the domain (JavaScriptIOn (eh? get it?)). It's got a nice ring.

Ok so step one is done, now to determine the best OS/browser for the project.