<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6052079401452677186</id><updated>2011-04-21T22:43:49.565-04:00</updated><category term='javascript object associative array'/><title type='text'>Fall 2008 Operating Systems</title><subtitle type='html'>This blog is here to support our goal of creating a "super project" and to help each of us share our ideas with each other.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Alan Labouseur</name><uri>http://www.blogger.com/profile/17342767736896968440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://2.bp.blogspot.com/_8pbB1753qJE/TBpB_re_9HI/AAAAAAAAAuw/ZcS9tCFNsRw/S220/headshot2.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-1607145887656272953</id><published>2008-12-16T16:33:00.002-05:00</published><updated>2008-12-16T16:39:03.799-05:00</updated><title type='text'>Missing operands</title><content type='html'>This one has had me puzzled since Project 3.  How exactly are we supposed to tell if an operand is missing?&lt;br /&gt;&lt;br /&gt;As far as I can see, we can't.  If a user enters a program, and forgets an operand, and instead enters the next instruction, that's what we're going to retrieve instead.&lt;br /&gt;&lt;br /&gt;This is either going to cause one of two things:&lt;br /&gt;&lt;br /&gt;1. Abnormal program results&lt;br /&gt;&lt;br /&gt;2. A memory access error if the value is high enough (greater than 128.)&lt;br /&gt;&lt;br /&gt;The second one is something we can prevent.  If it occurs, terminate the program.  But that is a memory access error, and something totally separate from a missing operand error.&lt;br /&gt;&lt;br /&gt;Any thoughts on this?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-1607145887656272953?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/1607145887656272953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=1607145887656272953' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/1607145887656272953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/1607145887656272953'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/missing-operands.html' title='Missing operands'/><author><name>Neal Tanner</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-2566371029221955651</id><published>2008-12-15T16:53:00.006-05:00</published><updated>2008-12-17T02:28:15.107-05:00</updated><title type='text'>What to do about User Program I/O</title><content type='html'>Rather than "Read From a File" and "Write to a File", let's recast those operations as "Read the First Block from a File" and "Write the First Block of a File".  That way we can stop worrying about the number of bytes.&lt;br /&gt;&lt;br /&gt;So...&lt;br /&gt;&lt;br /&gt;Read the First Block from a File&lt;br /&gt;X: 03&lt;br /&gt;Y: start address of file name&lt;br /&gt;A: starting address at which to begin saving the read bytes.&lt;br /&gt;&lt;br /&gt;Write the First Block of a File&lt;br /&gt;X: 04&lt;br /&gt;Y: start address of file name&lt;br /&gt;A: start address of the string to write to the first block of filename.&lt;br /&gt;&lt;br /&gt;Good luck.  If you want to implement something more robust, you are of course free to do so.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;&amp;lt;PICARD&amp;gt;&lt;br /&gt;     Make it so.   &lt;br /&gt;&amp;lt;/PICARD&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-2566371029221955651?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/2566371029221955651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=2566371029221955651' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2566371029221955651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2566371029221955651'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/what-to-do-about-user-program-io.html' title='What to do about User Program I/O'/><author><name>Alan Labouseur</name><uri>http://www.blogger.com/profile/17342767736896968440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://2.bp.blogspot.com/_8pbB1753qJE/TBpB_re_9HI/AAAAAAAAAuw/ZcS9tCFNsRw/S220/headshot2.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-3087599486346394105</id><published>2008-12-13T16:57:00.002-05:00</published><updated>2008-12-13T17:00:53.854-05:00</updated><title type='text'>Disk I/0 request query</title><content type='html'>When the currently executing process makes a disk I/O request&lt;br /&gt;o Move the current process to an I/O queue to wait while its I/O request is [required]&lt;br /&gt;being serviced.&lt;br /&gt;o Invoke the scheduler to get the next process on the Ready Queue (RQ) [required]&lt;br /&gt;o Once the I/O request is complete, take the waiting process off the I/O Queue [required]&lt;br /&gt;and put it back on the Ready Queue. (Be sure to keep track of any data&lt;br /&gt;returned from the I/O operation.)&lt;br /&gt;&lt;br /&gt;We are really confused?&lt;br /&gt;&lt;br /&gt;Do we need to use the ready queue here? Fo we call this from the shell or create our own program.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-3087599486346394105?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/3087599486346394105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=3087599486346394105' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3087599486346394105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3087599486346394105'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/disk-i0-request-query.html' title='Disk I/0 request query'/><author><name>Amosh Shakya</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-1445152960166815258</id><published>2008-12-08T02:59:00.002-05:00</published><updated>2008-12-08T03:00:59.797-05:00</updated><title type='text'>Clarification Please</title><content type='html'>&lt;div&gt;Add System Call handlers to allow the user program to perform disk I/O. [required]&lt;/div&gt;&lt;div&gt;o Read from a file&lt;/div&gt;&lt;div&gt;• X: 03&lt;/div&gt;&lt;div&gt;• Y: start address of the file name&lt;/div&gt;&lt;div&gt;• A: name number of bytes to read&lt;/div&gt;&lt;div&gt;• ?: start address to save read bytes&lt;/div&gt;&lt;div&gt;o Write to a file&lt;/div&gt;&lt;div&gt;• X: 04&lt;/div&gt;&lt;div&gt;• Y: start address of the file name&lt;/div&gt;&lt;div&gt;• A: start address of string to write to file.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What is needed from us to do for this specific task.&lt;/div&gt;&lt;div&gt;Which I think CJ touched on this topic&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-1445152960166815258?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/1445152960166815258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=1445152960166815258' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/1445152960166815258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/1445152960166815258'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/clarification-please.html' title='Clarification Please'/><author><name>anthony trivino</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_gTLgq-2tb7k/SvGnKyjiDBI/AAAAAAAAAAM/-7dhOqbpalU/S220/Picture+013%5B1%5D.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-6943080463484208555</id><published>2008-12-08T00:32:00.001-05:00</published><updated>2008-12-08T00:33:59.511-05:00</updated><title type='text'>Read System Call</title><content type='html'>I don't think we decided on what to do for the read system call. Were we going to add another register for the address to store the retrieved data or were we just gonna print it out on the console without storing. Or is this up to us?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-6943080463484208555?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/6943080463484208555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=6943080463484208555' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/6943080463484208555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/6943080463484208555'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/read-system-call.html' title='Read System Call'/><author><name>CJ</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-462273179375042873</id><published>2008-12-03T21:25:00.003-05:00</published><updated>2008-12-03T21:30:53.735-05:00</updated><title type='text'>Handling FSDD Interrupts</title><content type='html'>It seems there is much confusion on how to handle the interrupts from the FSDD.  Especially since we are&lt;br /&gt;&lt;br /&gt;Did we not, early in the year, want these file operations to be system call interrupts handled in the kernel?&lt;br /&gt;I think Alan even left comments in the base code in kernel.js as a TODO to add in these kernel functions as SYSTEM CALL ISRs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-462273179375042873?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/462273179375042873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=462273179375042873' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/462273179375042873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/462273179375042873'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/handling-fsdd-interrupts.html' title='Handling FSDD Interrupts'/><author><name>Scott</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-4260700235680267741</id><published>2008-12-03T15:49:00.002-05:00</published><updated>2008-12-03T15:56:41.691-05:00</updated><title type='text'>Getting the next available block</title><content type='html'>So, what is the most efficient, least time consuming method to go about finding the next available block.&lt;br /&gt;&lt;br /&gt;A combination of brute force/back tracking would have us search like this for an available t,s,b:&lt;br /&gt;Check 1,0,0..1,0,1...all the way to 1,0,7  now if we do not find an avail block to write to...&lt;br /&gt;Keep checking...1,1,0..1,1,1....all the way to 1,1,7 now if we still do not find an available block to write to...&lt;br /&gt;Keep checking untill all permutations/combinations of (0,1,2,3)(0,1,2,3,4,5,6,7)(0,1,2,3,4,5,6,7) are searched sequentially....&lt;br /&gt;&lt;br /&gt;And since we are searching sequentially, you can bet that our fsdd is handling writes sequentially...so the more data we write the longer it will take by the time we get to writing data to our last file.&lt;br /&gt;&lt;br /&gt;Also what this results in is contiguous blocks of data, which becomes a form of a sequential data set of sorts, rather than having uncontiguous, partitioned blocks of data.  Until that is, we decide to overwrite blocks (which, by using this method of checking sequentially for an available block, will not have to happen until we've written to the last block at 3,7,7)&lt;br /&gt;&lt;br /&gt;Plus the run time jumps up the wazzooo just to write data because you are waiting potentially for a terrible worst case of some function only Ten Eyck could really compute and determine...which usually means a ridiculously large function that grows terribly fast.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So what is a more optimal solution to this approach of obtaining the next available block?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-4260700235680267741?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/4260700235680267741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=4260700235680267741' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4260700235680267741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4260700235680267741'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/getting-next-available-block.html' title='Getting the next available block'/><author><name>Scott</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-316350746855526690</id><published>2008-12-02T15:01:00.002-05:00</published><updated>2008-12-02T15:03:59.074-05:00</updated><title type='text'>SJAX: Synchronous Javascript and XML</title><content type='html'>It's like AJAX, but with blocking and waiting for a (yes, slow... I know) response.  See &lt;a href="http://www.hunlock.com/blogs/Snippets:_Synchronous_AJAX"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-316350746855526690?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/316350746855526690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=316350746855526690' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/316350746855526690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/316350746855526690'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/sjax-synchronous-javascript-and-xml.html' title='SJAX: Synchronous Javascript and XML'/><author><name>Alan Labouseur</name><uri>http://www.blogger.com/profile/17342767736896968440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://2.bp.blogspot.com/_8pbB1753qJE/TBpB_re_9HI/AAAAAAAAAuw/ZcS9tCFNsRw/S220/headshot2.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-1343526420205737421</id><published>2008-12-02T12:43:00.002-05:00</published><updated>2008-12-02T13:04:45.193-05:00</updated><title type='text'>Filesystem Standardization?</title><content type='html'>Can we explicitly declare the standardizations for the file system Scott was talking about using (if we are going to do that.) It could be posted on the site or here by Alan, it doesn't matter to me, just so long as we are all on the same "page". Perhaps we'll have to wait til class on Friday to discuss it, but any info would be useful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-1343526420205737421?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/1343526420205737421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=1343526420205737421' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/1343526420205737421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/1343526420205737421'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/filesystem-standardization.html' title='Filesystem Standardization?'/><author><name>Austin</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/_kQ47NW2IlyY/SZ3YDBehRlI/AAAAAAAAAAY/duleD5AB3qA/S220/Mad+Face.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-42344436578744980</id><published>2008-12-01T21:20:00.002-05:00</published><updated>2008-12-01T21:27:17.272-05:00</updated><title type='text'>Yawn..</title><content type='html'>Anyone else experiencing dreadfully slow response time from Alan's server? Sometimes my AJAX calls take a few minutes to come back! :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-42344436578744980?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/42344436578744980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=42344436578744980' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/42344436578744980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/42344436578744980'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/yawn.html' title='Yawn..'/><author><name>CJ</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-2902418963809189120</id><published>2008-12-01T01:56:00.013-05:00</published><updated>2008-12-01T03:46:19.538-05:00</updated><title type='text'>Chaining asynchronous AJAX calls</title><content type='html'>As many of you have found out this project is a little tricky. Using the example AJAX calls that were provided, you may notice that they are asynchronous (funny isn't it? being that AJAX = asynchronus javascript and XML). This means that after the call is made, javascript continues executing the next (javascript) line of code without waiting for a response from the server (Alan's in this case). &lt;br /&gt;&lt;br /&gt;This is a problem when we have a chain of calls that depend on each other, such as the calls needed to create, read, write, and delete a file on our remote "hard drive". For example, to write to a file we must first look up the file in the file listing directory and get its first block. From there we must either write to that first block, or check if theres another block free (if its over 24 bytes). Before we can do any of that, we need the response from the original AJAX call. How do we tell that next command to chill out until we receive a response from the previous one?&lt;br /&gt;&lt;br /&gt;I think this is what Alan was getting at in the response to Joe's post...This is my solution, not sure if it's the best but it solves the problem.&lt;br /&gt;&lt;br /&gt;Create some kind of a data structure (not a traditional queue) to keep track of AJAX IO Requests (I stored this data structure right in my FS device driver). Create an object to represent an IO Request. This IO request object should contain these three fields (in some form)&lt;br /&gt;&lt;blockquote&gt;  - A unique FileIO Request ID (will not change throughout the IO Request Object's lifetime&lt;br /&gt;  - The type of request it is (create, read, write, delete, (and format, but probably not necessary until the final project))&lt;br /&gt;  - The stage/phase it is in - think of the IO Request object as stateful - what step is it doing in the chain of requests?&lt;br /&gt;  - Other various variables that are unique to the type of request (data to be written, file name, blocks that its going to write to...etc). I think an associative array is an appropriate way to handle these miscellaneous variables&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Then, in the FS Device Driver, I made 2 functions for each operation. The first one initialized the chain of requests, the second one was the function that gets called back by the AJAX requests.&lt;br /&gt;&lt;br /&gt;An example - createfile&lt;br /&gt;createfile(filename) would do the following -&lt;br /&gt;&lt;blockquote&gt;  - create a IORequest object and give it a unique ID (keep a variable with the last one given an increment it)&lt;br /&gt;  - set the type to create&lt;br /&gt;  - set the phase to something like ' looking up directory entry 1'&lt;br /&gt;  - in the associative array, store the filename for later&lt;br /&gt;  - kick off an AJAX read request of the first directory entry&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;The create file callback function would take the data fetched from the server as well as the IORequest ID. First it fetches the IORequest object, checks the phase, and performs whatever is necessary to complete the request, including possibly sending off another AJAX request (this callback function could be invoked multiple times with the same IO request ID). When it's done with the entire operation (entire chain of commands) it spits out a confirmation message or an error message (make sure you use the STDOUT ISR) and deletes the IO Request from the storage data structure. &lt;br /&gt;&lt;br /&gt;I think once you conceptualize it, it makes more sense to do it in a stateful fashion (I can't think of any other way to do it). &lt;br /&gt;&lt;br /&gt;The only tricky part in this is telling the AJAX request to return to the correct callback function and pass it the correct requestID.&lt;br /&gt;&lt;br /&gt;I modified the example 'readBytes' function we were given to accept a callback function, and instead of passing JQuery the function that alerts the data, it will invoke our own callback function. It looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function hdReadBytes(track, sector, block, callback)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  var getUrl = "http://www.3nfconsulting.com/msdos/GetBlock.aspx?" + &lt;br /&gt;    "u=" + escape(DISK_USER) + &lt;br /&gt;    "&amp;t=" + escape(track) + &lt;br /&gt;    "&amp;s=" + escape(sector) + &lt;br /&gt;    "&amp;b=" + escape(block);&lt;br /&gt;  $.getJSON(getUrl + "&amp;format=json&amp;jsoncallback=?", &lt;br /&gt;      callback&lt;br /&gt;     ); &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We cannot simply pass in our createFileCallback function, because the function that JQuery calls after a response will only get passed one parameter: the response from the server. We need to pass it a function that will take the response as a parameter, and then invoke our callback function with the response as well as the request ID. I did this by creating a function that creates function (sound like scheme???):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function fsDDBuildCallback(requestID, callbackFn)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  // Creates a function that we can pass to JQuery - only accepts&lt;br /&gt;  // one parameter which is the response from the server&lt;br /&gt;  var fn = function(data)&lt;br /&gt;  {&lt;br /&gt;    // JQuery is going to pass us an associative array with &lt;br /&gt;    // an element with the key 'data' that contains the file system response&lt;br /&gt;    //&lt;br /&gt;    // Pass the request ID that we're calling this from, with the server's&lt;br /&gt;    // response into the callback function that we want to invoke&lt;br /&gt;    callbackFn(requestID, data['data']);&lt;br /&gt;  };&lt;br /&gt;&lt;br /&gt;  return fn;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We would use this like this (end of createFile):&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;  // Start by reading 001, where the directory starts&lt;br /&gt;  this.hardDrive.readBytes(0, 0, 1, &lt;br /&gt;      this.buildCallback(requestID, this.createFileCallback));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The only thing to look out for, is in your callback functions, using 'this' to call a function as part of the FS Device Driver (or wherever your calling it from) won't work. This is because the function is getting evaluated within a different object (I'm guessing a JQuery object when it calls 'eval'...either that or the window object). You must refer to it as the global name (ie name it in the kernel and call it like that..._krnFSDD instead of this). Theres some really good articles out there on javascript scoping, this one I particularly liked: &lt;a href="http://alternateidea.com/blog/articles/2007/7/18/javascript-scope-and-binding"&gt;http://alternateidea.com/blog/articles/2007/7/18/javascript-scope-and-binding&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The good thing about this is that its all useful for our final project. We'll create an IO PID queue that has the PID's that called these operations. After the final write request comes back (or we may want to risk it and not wait for a confirmation), we'll context switch back into the appropriate process that was on the IO PID queue. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope that helped somebody...good luck!&lt;br /&gt;&lt;br /&gt;By the way...anybody see an easier way to do it?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-2902418963809189120?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/2902418963809189120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=2902418963809189120' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2902418963809189120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2902418963809189120'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/12/chaining-asynchronous-ajax-calls.html' title='Chaining asynchronous AJAX calls'/><author><name>Rob Fama</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-3323074719006291221</id><published>2008-11-28T22:35:00.002-05:00</published><updated>2008-11-28T22:44:55.029-05:00</updated><title type='text'>Mount/Unmount vs Swapping in FSDD's</title><content type='html'>If we are going to be making this so that we can plug in anybodies fsdd without error, why do we not just make a mount/unmount command to a specified users file system location in the database?&lt;br /&gt;&lt;br /&gt;One- this elminitates from having to restart the OS and re-loading the fsdd so that its a "hot-swappable" drive so to speak, in imaginary OS land.&lt;br /&gt;&lt;br /&gt;Two- it creates a global fsdd for everybody and gets everyone on the same page.  I know I know, what distributed pc OS has the ability to hot swap a harddrive? Idk of any, but think of this as something like z/VM or linux on z, and just swapping in and out DASD volumes...&lt;br /&gt;&lt;br /&gt;Think about it, your FSDD is up and running, and you are mounted at your own directory. well if you want to write to someone elses, you can issue a mount command and this opens up data communications as well.  The only thing that sucks is write locks would have to be put in place to keep everything synchronized and people from writing to the same directory at once, or grabbing data that has just been overwritten.&lt;br /&gt;&lt;br /&gt;Just a thought...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-3323074719006291221?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/3323074719006291221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=3323074719006291221' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3323074719006291221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3323074719006291221'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/11/mountunmount-vs-swapping-in-fsdds.html' title='Mount/Unmount vs Swapping in FSDD&apos;s'/><author><name>Scott</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-9003717209940765917</id><published>2008-11-22T22:42:00.003-05:00</published><updated>2008-11-22T23:07:03.695-05:00</updated><title type='text'>JQuery not syncronizing?</title><content type='html'>Not sure if going to explain properly but been working on getting/setting blocks and have a problem with getting. Setting is no problem since you don't need any response from the web service. But getting is a problem. The jquery will report the result in a  krnTrace fine, but when trying to actually save the data seem to have a problem. It is going past the jquery while it waits and calling the rest of the code. I've even added alerts to give the jquery time to finish but still no luck.&lt;br /&gt;&lt;br /&gt;Currently the only thing able to figure which might work is adding the get block to return to a queue, then later time can retrieve off of it. This might work, but trying to implement this seems a little more complicated then would seem. Thinking work liek a deli line, giving each request a unique id, then somewhere would have to look for that id, or wait for it to pop up? I'm not sure up to this since haven't tried the queue yet, going to do this now. Wondering if anyone else actually got getblock to store to a variable you can retrieve later, and not just display in the krntrace.&lt;br /&gt;&lt;br /&gt;edit...&lt;br /&gt;Well after testing out the queue seems like the scope inside the json function doesn't reach outside tot he class variable... Which would explain why I am not able why when I used a global variable to store the same thing I was krnTracing, I was unable to retrieve.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-9003717209940765917?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/9003717209940765917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=9003717209940765917' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/9003717209940765917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/9003717209940765917'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/11/jquery-not-syncronizing.html' title='JQuery not syncronizing?'/><author><name>Joe</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-2636789713033297439</id><published>2008-11-21T12:50:00.021-05:00</published><updated>2008-12-02T02:27:47.263-05:00</updated><title type='text'>Disk I/O Time, another queue!!1</title><content type='html'>&lt;em&gt;Update:&lt;/em&gt;  I s'pose I should update this.  As Alan points out in a later post, this isn't for iP4, which deals with the kernel-level stuff and the FS/disk drivers.  This stuff comes into play when we introduce syscalls for disk I/O.  Rob's newer, and much more technical post, mentions I/O queue stuff as well.&lt;br /&gt;--&lt;br /&gt;&lt;br /&gt;One of the issues brought up after class today was about the amount of time that disk reads and writes are going to take.  Because it's going over the Internet, the entire request is probably going to take more than, say, 0.5 sec, or whatever the clock tick interval is.  So, if a program is trying to write to disk, it might not finish before the next CPU cycle executes.&lt;br /&gt;&lt;br /&gt;Obviously, this poses a problem.  One solution would be just to "pause" the CPU, by setting whatever flag for &lt;code&gt;cpuExecuting&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt;.  This isn't very realistic, though, as what normally happens in "real" OSs (if there is such a thing), is that the currently running process (the one just just made the disk I/O request) is moved to a queue to wait while its I/O request is being serviced, something like the &lt;span style="font-style: italic;"&gt;I/O queue&lt;/span&gt; (IOQ).&lt;br /&gt;&lt;br /&gt;So, with the CPU open to execute another process, we just invoke the scheduler to get the process on the front of the Ready Queue (RQ) to start/continue executing.  The OS continues to run as normal.  Once the I/O request is complete -- that is (I think), the JSONP callback method finishes, we look for the corresponding process in the IOQ, and move it back to the RQ.  From there, the scheduler continues running as normal.  I'm not sure how we keep track of what process made what disk I/O request, and associating the JSONP callback with a process or whatnot, but we'll figure that out somehow.&lt;br /&gt;&lt;br /&gt;The order of PCBs on the IOQ doesn't really mean all that much at this point, it'll just be the order of requests for disk I/O.  When that request is serviced, we may have to search through the IOQ for the process we're looking for before moving it back to the RQ.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-2636789713033297439?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/2636789713033297439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=2636789713033297439' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2636789713033297439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2636789713033297439'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/11/disk-io-time.html' title='Disk I/O Time, another queue!!1'/><author><name>The Danner</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_Wy83_tUor3E/STTk-2lR4kI/AAAAAAAAACA/1muzcALeEqM/s1600-R/gas_gague.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-7978545801205428374</id><published>2008-11-18T09:18:00.002-05:00</published><updated>2008-11-18T09:23:54.176-05:00</updated><title type='text'>Totally and completely off topic:</title><content type='html'>This has nothing to do with the project, but I figured A-train would get a kick out of it. You know how he mentioned the MOS 6502 processor powered Bender on Futurama?&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.asciimation.co.nz/bender/index.html"&gt;This guy&lt;/a&gt; made a Bender to hold his beer brewing bucket, and controls it with none other than an MOS 6502 processor.&lt;br /&gt;&lt;br /&gt;The processor details are on the second page, complete with a &lt;a href="http://www.asciimation.co.nz/bender/cpucircuit.html"&gt;circuit diagram&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Okay, back to work now. Nothing to see here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-7978545801205428374?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/7978545801205428374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=7978545801205428374' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/7978545801205428374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/7978545801205428374'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/11/totally-and-completely-off-topic.html' title='Totally and completely off topic:'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-1274721583853794974</id><published>2008-11-06T14:51:00.003-05:00</published><updated>2008-11-06T14:52:57.462-05:00</updated><title type='text'>Gracefully handle errors in the CPU?</title><content type='html'>Did we ever decide on what this means? I would assume to terminate the process and display an error message. It seems like it would be really dangerous to the user to just continue on to the next operation...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-1274721583853794974?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/1274721583853794974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=1274721583853794974' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/1274721583853794974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/1274721583853794974'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/11/gracefully-handle-errors-in-cpu.html' title='Gracefully handle errors in the CPU?'/><author><name>Rob Fama</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-6267873972156855767</id><published>2008-11-05T16:54:00.002-05:00</published><updated>2008-11-05T16:55:40.768-05:00</updated><title type='text'>Branch OP Code</title><content type='html'>How exactly does this work?  I understand what it's doing, but I'm not completely clear on how the EF operator it is taking works.&lt;br /&gt;&lt;br /&gt;If someone could kindly explain, it would be appreciated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-6267873972156855767?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/6267873972156855767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=6267873972156855767' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/6267873972156855767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/6267873972156855767'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/11/branch-op-code.html' title='Branch OP Code'/><author><name>Neal Tanner</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-3654495686684540955</id><published>2008-11-03T16:29:00.007-05:00</published><updated>2008-11-04T00:56:30.798-05:00</updated><title type='text'>Displaying output while having an active prompt</title><content type='html'>I came up with a somewhat sleezy hack to the problem Bedell mentioned in the earlier post.&lt;br /&gt;&lt;br /&gt;The problem was, allowing the user to enter text while there is output coming back from jobs currently running in the CPU. While he typed, he would get the output strings mixed in with his typing and it would be hard to read.&lt;br /&gt;&lt;br /&gt;In short, this is how it works:&lt;br /&gt;&lt;br /&gt;1. An interrupt comes in to display output to std out.&lt;br /&gt;2. Clear the current line&lt;br /&gt;3. Display the output&lt;br /&gt;4. Break to the next line&lt;br /&gt;5. Re display the prompt&lt;br /&gt;6. Display what the user had currently been typing again.&lt;br /&gt;&lt;br /&gt;In code this translates to: (in &lt;span style="font-weight:bold;"&gt;kernel.js&lt;/span&gt; in your interrupt handler)&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;          _StdOut.clearCurrentLine();&lt;br /&gt;          _StdOut.putText(params);&lt;br /&gt;          _StdOut.advanceLine();&lt;br /&gt;          _OsShell.putPrompt();&lt;br /&gt;          _StdOut.putText(_StdIn.buffer);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is a little sloppy and violates a bunch of laws, using calls from _StdOut and _OsShell, but like I said its a hack that is probably good enough for iProject3.&lt;br /&gt;&lt;br /&gt;We already have methods available to do everything above except for clearing the current line.&lt;br /&gt;&lt;br /&gt;To add support for clearing the current line, we need to first add this to &lt;span style="font-weight:bold;"&gt;console.js&lt;/span&gt; in your constructor:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;    this.clearCurrentLine = consoleClearCurrentLine;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and add this as one of your methods:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function consoleClearCurrentLine()&lt;br /&gt;{&lt;br /&gt;  this.CurrentXPosition = 0;&lt;br /&gt;  DRAWING_CONTEXT.clearLine(this.CurrentYPosition);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now add this to &lt;span style="font-weight:bold;"&gt;canvastext.js&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;CanvasTextFunctions.clearLine = function(ctx, y)&lt;br /&gt;{&lt;br /&gt;  ctx.clearRect(0, y - DEFAULT_FONT_SIZE, CANVAS.width, DEFAULT_FONT_SIZE + FONT_HEIGHT_MARGIN);&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and add this to the method CanvasTextFunctions.enable (at the bottom of the file):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;    ctx.clearLine = function(y) { return CanvasTextFunctions.clearLine(ctx, y); };&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And that should be it, unless I forgot something. It's a bit ugly, but it does the trick.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-3654495686684540955?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/3654495686684540955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=3654495686684540955' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3654495686684540955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3654495686684540955'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/11/displaying-output-while-having-active.html' title='Displaying output while having an active prompt'/><author><name>Rob Fama</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-4851289691333932634</id><published>2008-11-01T16:22:00.014-04:00</published><updated>2008-11-01T17:02:15.982-04:00</updated><title type='text'>CPU cycles, Interrupt handling, and saving the stack</title><content type='html'>Thinking about Rob's question and Dan's answer (prior post, below) along with our discussions yesterday in class and after, I decided to write a small version of the solution we collectively came up with. Taking the original "baseline" project from week 1,  I added or changed the following major areas:&lt;br /&gt;&lt;br /&gt;The hardware simulation creates the CPU and wires up the CPU pulse to call krnOnCPUClockPulse() in the kernel.&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function simBtnStartOS_click(btn)&lt;br /&gt;{&lt;br /&gt;// Disable the start button...&lt;br /&gt;btn.disabled = true;&lt;br /&gt;// .. enable the Emergency Halt and Reset buttons ...&lt;br /&gt;document.getElementById("btnHaltOS").disabled = false;&lt;br /&gt;document.getElementById("btnReset").disabled = false;&lt;br /&gt;// .. set focus on the OS console display ...&lt;br /&gt;document.getElementById("display").focus();&lt;br /&gt;// ... Create and initialize the CPU.  Then set the clock pulse simulation to call into the Kernel.&lt;br /&gt;_CPU = new cpu();&lt;br /&gt;_CPU.init();&lt;br /&gt;hardwareClockID = setInterval(krnOnCPUClockPulse, CPU_CLOCK_INTERVAL);&lt;br /&gt;// .. and call the OS Kernel Bootstrap routine.&lt;br /&gt;krnBootstrap();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Instead of an event loop, we let the CPU pulse trigger OS events. This synchronizes everything pretty nicely.&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function krnOnCPUClockPulse()&lt;br /&gt;{&lt;br /&gt;  // Update the OS clock.  (It's useful for meaningful log entries and perhaps other things in the future.)&lt;br /&gt;  _OSclock++;  &lt;br /&gt;  if (_KernelInterruptQueue.getSize() &gt; 0)    // Process a pending interrupt, if any.&lt;br /&gt;  {&lt;br /&gt;      var interrput = _KernelInterruptQueue.dequeue();&lt;br /&gt;      krnInterruptHandler(interrput.irq, interrput.params);  // Used to be named krnInterruptDispatcher.&lt;br /&gt;  }&lt;br /&gt;  else if (_CPU.isExecuting)                  // If not, then run a CPU cycle is there is anything to process.&lt;br /&gt;  {&lt;br /&gt;      _CPU.cycle();&lt;br /&gt;  }  &lt;br /&gt;  else                                        // If not, then just be idle.&lt;br /&gt;  {&lt;br /&gt;      krnTrace("Idle");&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We no longer need an explicit interrupt for CPU pulses.  But the keyboard interrupt needs to work in a slightly different way, now enqueueing an interrupt object on the kernel's interrupt queue rather than calling krnInterruptHandler() directly.&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function simOnKeypress(event)&lt;br /&gt;{&lt;br /&gt;    if (event.target.id == "display")&lt;br /&gt;    {&lt;br /&gt;        event.preventDefault();&lt;br /&gt;        // Note the pressed key code in the params (Mozilla-specific).&lt;br /&gt;        var params = new Array(event.which, event.shiftKey);&lt;br /&gt;        // Enqueue this interrupt on the kernal interrupt queue so that it gets to the Interrupt handler.&lt;br /&gt;        _KernelInterruptQueue.enqueue( new Interrput(KEYBOARD_IRQ, params) );&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A bare-bones CPU object.&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function cpu()&lt;br /&gt;{&lt;br /&gt;  this.PC    = 0;     // Program Counter&lt;br /&gt;  this.Acc   = 0;     // Accumulator&lt;br /&gt;  this.Xreg  = 0;     // X register&lt;br /&gt;  this.Yreg  = 0;     // Y register&lt;br /&gt;  this.Zflag = 0;     // Z-ero flag (Think of it as "isZero".)&lt;br /&gt;  this.isExecuting = false;&lt;br /&gt;&lt;br /&gt;  this.init = function()&lt;br /&gt;  {&lt;br /&gt;      this.PC    = 0&lt;br /&gt;      this.Acc   = 0;&lt;br /&gt;      this.Xreg  = 0;&lt;br /&gt;      this.Yreg  = 0;&lt;br /&gt;      this.Zflag = 0;    &lt;br /&gt;      this.isExecuting = false;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  this.pulse = function()&lt;br /&gt;  {&lt;br /&gt;      // TODO: Do we need this? Maybe not.&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  this.cycle = function()&lt;br /&gt;  {&lt;br /&gt;      krnTrace("CPU cycle");&lt;br /&gt;      // Do real work here.  Set this.isExecuting appropriately.&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I tested this by setting CPU_CLOCK_INTERVAL = 10 so the clock pulses 100 times per second.  I then altered simLog() to show entries every 100,000 ticks, or every 1000 seconds, or about once every 16.67 minutes.  (That way I could run it a long time without lagging the browser with a huge log.) &lt;br /&gt;&lt;br /&gt;As of this writing, I'm up to 800,000 clock cycles and Firefox on my Mac is still running just fine. It's responsive.  (It's taking between 5% and 7% of my real processor time.) My OS is responsive as well.  I can type shell commands and they execute fine as well.  This means we can definitely interact with the shell in kernel mode while the CPU is executing user code at the same time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-4851289691333932634?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/4851289691333932634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=4851289691333932634' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4851289691333932634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4851289691333932634'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/11/cpu-cycles-interrupt-handling-and.html' title='CPU cycles, Interrupt handling, and saving the stack'/><author><name>Alan Labouseur</name><uri>http://www.blogger.com/profile/17342767736896968440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://2.bp.blogspot.com/_8pbB1753qJE/TBpB_re_9HI/AAAAAAAAAuw/ZcS9tCFNsRw/S220/headshot2.png'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-1407080824877860543</id><published>2008-10-28T21:48:00.006-04:00</published><updated>2008-10-29T00:33:13.983-04:00</updated><title type='text'>Context switching through interrupts???</title><content type='html'>Bedell and I are discussing the idea of context switching through interrupts, and either I'm overlooking something, or this may present a platform specific issue (JS).&lt;br /&gt;&lt;br /&gt;The way I understand it, is we use the shell to kick off the job scheduler. The job scheduler calls the CPU, which when its done with its desired of clock cycles in RR, it calls an interrupt to do a context switch. The kernel then calls the job scheduler, which switches the process, runs the process, calls the context switch after desired clock cycles etc etc etc. &lt;br /&gt;&lt;br /&gt;My problem with this, is that we're pretending that the CPU is hardware. As much as we close our eyes and bang our red shoes together, its not. Unless Javascript has some secret capability for multi-threading, this brings up a huge problem. &lt;br /&gt;&lt;br /&gt;What is our browser call stack going to look like? We're never returning from any of those calls (interrupts, task scheduler, and cpu calls - which are all methods, even the cpu stuff), so ultimately we're going to have way too many calls stacked up in this huge loop. &lt;br /&gt;&lt;br /&gt;For example, lets say we load 3 programs into memory with 100 instructions each, and set our RR quantum to 1 and kick off our scheduler. Thats 300 context switches, and for every context switch we have to make 1 call from task scheduler, 1 call from cpu to kernel interrupt, and 1 call back to the task scheduler. thats 300 * 3 = 900 calls. &lt;br /&gt;&lt;br /&gt;What if we wanted to run programs that actively computed things until the user closed them out, for example a text editor. This would go on for too long, and eventually Firefox would probably crash/light on Fire (no pun intended). &lt;br /&gt;&lt;br /&gt;Now maybe we're not going to run any programs with 100 instructions, or no programs that exist in memory indefinitely, but it still seems a bit sloppy.&lt;br /&gt;&lt;br /&gt;Right before iProject2 was due I had a conversation with Danner and Bedell about something similar. The way I thought we had decided seemed the most logical involved polling. The solution was to have the task scheduler call the CPU for the desired number of clock cycles, and then the CPU returns (probably with some kind of status message for done, awaiting user input, etc). The task scheduler then checks if there were any other interrupts (a flag in the kernel?) and then either handles the interrupts, or does a context switch, passes control back to the CPU, rinse and repeat. &lt;br /&gt;&lt;br /&gt;This also (I think) solves the problem with how do we acknowledge a hardware interrupt when the CPU is in use. By polling for that interrupt flag before every context switch, we can determine if we should switch to something more important. (This is assuming Firefox can handle an event while Javascript is already crunching in the background - it is multithreaded).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Any thoughts on this or am I overlooking something obvious?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-1407080824877860543?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/1407080824877860543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=1407080824877860543' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/1407080824877860543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/1407080824877860543'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/10/context-switching-through-interrupts.html' title='Context switching through interrupts???'/><author><name>Rob Fama</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-3807351409561681165</id><published>2008-10-27T12:11:00.002-04:00</published><updated>2008-10-27T12:13:47.220-04:00</updated><title type='text'>Memory</title><content type='html'>Ok, I'm a bit confused about this whole memory thing, and what is supposed to be doing what.&lt;br /&gt;&lt;br /&gt;Let me review what I know first.&lt;br /&gt;&lt;br /&gt;In the Hardware simulation we have:&lt;br /&gt;The actual Memory object&lt;br /&gt;A hardware memory manager&lt;br /&gt;&lt;br /&gt;In the Kernel object:&lt;br /&gt;A software memory manager&lt;br /&gt;&lt;br /&gt;Memory is going to consist of 384 bytes, divided into 3 pages of 128 bytes each.&lt;br /&gt;&lt;br /&gt;So, here comes the questions...&lt;br /&gt;&lt;br /&gt;What handles the pages?  Are they part of Memory, or one of the memory managers?&lt;br /&gt;&lt;br /&gt;What are these two memory managers doing, and how do they talk to each other?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-3807351409561681165?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/3807351409561681165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=3807351409561681165' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3807351409561681165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3807351409561681165'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/10/memory.html' title='Memory'/><author><name>Neal Tanner</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-8442536790389062782</id><published>2008-10-08T00:35:00.002-04:00</published><updated>2008-10-08T00:38:39.588-04:00</updated><title type='text'>TextArea</title><content type='html'>I am trying to show my contents of memory.  However when I set the value to each indexed word in memory, it just keeps overwriting the string value on the first line of the textarea.&lt;br /&gt;&lt;br /&gt;I tried moving down a line by using \n and even \r\n and it still will not move down a line in my text area.&lt;br /&gt;&lt;br /&gt;Does anyone have any hints or tips for this?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-8442536790389062782?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/8442536790389062782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=8442536790389062782' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/8442536790389062782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/8442536790389062782'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/10/textarea.html' title='TextArea'/><author><name>Scott</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-4403397103886890763</id><published>2008-10-07T14:12:00.002-04:00</published><updated>2008-10-07T14:14:48.219-04:00</updated><title type='text'>Process Control Blocks</title><content type='html'>I've been doing some reading about process control blocks (PCB) and I've come across something I don't completely understand.&lt;br /&gt;&lt;br /&gt;I've seen this in a couple of places, and they all mention that the PCB holds the register contents.&lt;br /&gt;&lt;br /&gt;The thing that confuses me is: Don't the registers also hold their contents?&lt;br /&gt;&lt;br /&gt;When is the PCB responsible for holding register contents? Is it only when the CPU has switched away from the process to another process?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-4403397103886890763?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/4403397103886890763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=4403397103886890763' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4403397103886890763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4403397103886890763'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/10/process-control-blocks.html' title='Process Control Blocks'/><author><name>Neal Tanner</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-5187699871670903922</id><published>2008-10-07T09:34:00.003-04:00</published><updated>2008-10-07T09:54:26.206-04:00</updated><title type='text'>Memory Management Unit</title><content type='html'>You folks won't really need the MMU until &lt;span style="font-style: italic;"&gt;i&lt;/span&gt;Project 3, but it's worth thinking about know.&lt;br /&gt;&lt;br /&gt;I've been pondering:&lt;br /&gt;The CPU is (obviously) hardware, executing user code in user mode. The user code communicates with the OS via system calls (also known as software interrupts).  But what about mapping virtual memory addresses to physical ("real") memory addresses? The user code knows nothing about this -- it cannot -- so there can be no system calls for it. How does it work? &lt;br /&gt;&lt;br /&gt;Does the CPU somehow ask the OS? No. The CPU asks the MMU.  But where's the MMU?&lt;br /&gt;&lt;br /&gt;The MMU is a hardware element, either separate from the CPU, or on some systems, like the Intel 80x86 where x &gt;=2, integrated with the CPU. It's &lt;span style="font-style: italic;"&gt;not&lt;/span&gt; part of the OS as far as real memory is concerned. There is an OS portion for &lt;span style="font-style: italic;"&gt;virtual&lt;/span&gt; memory management, but we'll get to that later on in the semester.&lt;br /&gt;&lt;br /&gt;Put your MMU.js file in the simulation directory and consider it as part of the hardware.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-5187699871670903922?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/5187699871670903922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=5187699871670903922' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/5187699871670903922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/5187699871670903922'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/10/memory-management-unit.html' title='Memory Management Unit'/><author><name>Alan Labouseur</name><uri>http://www.blogger.com/profile/17342767736896968440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://2.bp.blogspot.com/_8pbB1753qJE/TBpB_re_9HI/AAAAAAAAAuw/ZcS9tCFNsRw/S220/headshot2.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-5272783261137460820</id><published>2008-10-03T13:30:00.005-04:00</published><updated>2008-10-03T17:17:17.179-04:00</updated><title type='text'>Better on keypress fix</title><content type='html'>This will set focus to your canvas when you click Start, and also will fix the '/', backspace, and space bar problems where firefox was grabbing them.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;in index.html add tabindex = "1" to your canvas class&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&amp;lt;canvas id="display"&lt;br /&gt;                    width="500px"&lt;br /&gt;                    height="500px"&lt;br /&gt;                    tabindex="1"&amp;gt;&lt;br /&gt;&amp;lt;/canvas&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;then in hardwareSimulation.js in function simOnKeypress(event) change&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;if (event.target.id == "")&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to &lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;if (event.target.id == "display")&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Also make sure you add the "()" to the end of event.preventDefault in that if block.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-5272783261137460820?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/5272783261137460820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=5272783261137460820' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/5272783261137460820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/5272783261137460820'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/10/better-on-keypress-fix.html' title='Better on keypress fix'/><author><name>Joe</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-2446894383876886245</id><published>2008-09-26T22:00:00.003-04:00</published><updated>2008-09-26T22:14:34.468-04:00</updated><title type='text'>Keyboard device driver</title><content type='html'>Since there's been some discussion about how to implement this, I'll toss my hat in the ring, and explain how I did it.&lt;br /&gt;&lt;br /&gt;I did use a two dimensional array.  The array is initially indexed on the keyCode values.  Then once the correct keyCode is found, position 0 is devoted to the 'unshifed value', while position 1 is the 'shifted' value.&lt;br /&gt;&lt;br /&gt;Code looks something like this.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt; &lt;br /&gt;function declareKeyboardArray()&lt;br /&gt;{&lt;br /&gt;    keyCodeArray[65] = ['a', 'A'];&lt;br /&gt;    keyCodeArray[66] = ['b', 'B'];&lt;br /&gt;    keyCodeArray[67] = ['c', 'C'];&lt;br /&gt;}//end function&lt;br /&gt;&lt;br /&gt;//KeyCode tests look like this&lt;br /&gt;//Only tested for the three values I declared above&lt;br /&gt;if ( (keyCode &gt;= 65) &amp;amp;&amp;amp; (keyCode &lt;= 67) )&lt;br /&gt;{&lt;br /&gt;    if(isShifted)&lt;br /&gt;    {&lt;br /&gt;        outputChr = keyCodeArray[keyCode][1];&lt;br /&gt;    }//end if&lt;br /&gt;    else&lt;br /&gt;    { //Key is not shifted&lt;br /&gt;        outputChr = keyCodeArray[keyCode][0];&lt;br /&gt;    }//end else&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-2446894383876886245?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/2446894383876886245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=2446894383876886245' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2446894383876886245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2446894383876886245'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/keyboard-device-driver.html' title='Keyboard device driver'/><author><name>Neal Tanner</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-8013723110674313416</id><published>2008-09-26T14:40:00.004-04:00</published><updated>2008-10-20T21:16:57.003-04:00</updated><title type='text'>JavaScript and Hexadecimal</title><content type='html'>Thank the heavens, JavaScript supports hexadecimal variables.&lt;br /&gt;&lt;br /&gt;You declare them just as you would any other variable, and the value you assign must be prefixed by "0x" just as any other hex number representation.&lt;br /&gt;&lt;br /&gt;Here are some tests I ran on an online interpreter (&lt;a href="http://mochikit.com/examples/interpreter/"&gt;http://mochikit.com/examples/interpreter/&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;  &lt;br /&gt;&gt;&gt;&gt; var hex = 0x10;&lt;br /&gt;&gt;&gt;&gt; hex;&lt;br /&gt;16&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; var hex = 0x10;&lt;br /&gt;&gt;&gt;&gt; var dec = parseInt(hex,16);&lt;br /&gt;&gt;&gt;&gt; dec;&lt;br /&gt;22&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; var hex = 0x10;&lt;br /&gt;&gt;&gt;&gt; var dec = parseInt(hex,10);&lt;br /&gt;&gt;&gt;&gt; dec;&lt;br /&gt;16&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; var hex = 0x10;&lt;br /&gt;&gt;&gt;&gt; var dec = parseInt(hex,10);&lt;br /&gt;&gt;&gt;&gt; var hex2 = dec.toString(16);&lt;br /&gt;&gt;&gt;&gt; hex2;&lt;br /&gt;"10"&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; var hex = 0x10;&lt;br /&gt;&gt;&gt;&gt; var dec = parseInt(hex,10);&lt;br /&gt;&gt;&gt;&gt; var hex2 = dec.toString(16);&lt;br /&gt;&gt;&gt;&gt; var dec2 = parseInt(hex2,16);&lt;br /&gt;&gt;&gt;&gt; dec2;&lt;br /&gt;16&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-8013723110674313416?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/8013723110674313416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=8013723110674313416' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/8013723110674313416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/8013723110674313416'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/javascript-and-hexadecimal.html' title='JavaScript and Hexadecimal'/><author><name>Joe Casey</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-5907598525917829732</id><published>2008-09-24T11:16:00.002-04:00</published><updated>2008-09-24T11:20:34.975-04:00</updated><title type='text'>deviceDriverKeyboard error</title><content type='html'>In case anyone hasn't finished the keyboard driver, I figure I'll point out an error in the code we were given. In krnKbdDispatchKeyPress function, the second if statement checks for keycodes between 65 and 90, and 97 to 123. The second set is not needed, since the keycode for letters will always be between 65 and 90. The check for isShifted corrects for lowercase.&lt;br /&gt;&lt;br /&gt;97 - 123 happens to include 109, if anyone was wondering why the "-_" key was giving them "m" when shifted, and an unprintable character when not.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-5907598525917829732?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/5907598525917829732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=5907598525917829732' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/5907598525917829732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/5907598525917829732'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/devicedriverkeyboard-error.html' title='deviceDriverKeyboard error'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-659397095028936783</id><published>2008-09-22T20:35:00.007-04:00</published><updated>2008-09-22T22:26:00.399-04:00</updated><title type='text'>Scrolling with getImageData and putImageData</title><content type='html'>I never got the canvas working properly for the first assignment. This is the scrolling code I have:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;if ((this.CurrentYPosition +&lt;br /&gt;       DEFAULT_FONT_SIZE +&lt;br /&gt;       FONT_HEIGHT_MARGIN) &gt;=&lt;br /&gt;    (CANVAS.height-20))&lt;br /&gt;{&lt;br /&gt;    var img;&lt;br /&gt;    img = DRAWING_CONTEXT.getImageData(&lt;br /&gt;        0,&lt;br /&gt;        (DEFAULT_FONT_SIZE + FONT_HEIGHT_MARGIN),&lt;br /&gt;        CANVAS.width,&lt;br /&gt;        (CANVAS.height - 20 -&lt;br /&gt;          (DEFAULT_FONT_SIZE + FONT_HEIGHT_MARGIN)));&lt;br /&gt;    &lt;br /&gt;    //copy subtracts taskbar and line height.&lt;br /&gt;    consoleClearScreen();&lt;br /&gt;    DRAWING_CONTEXT.putImageData(img, 0, 0);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This works perfectly, the only issue is that there is a six second lag whenever the screen scrolls. Any hints where I'm going wrong?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-659397095028936783?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/659397095028936783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=659397095028936783' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/659397095028936783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/659397095028936783'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/scrolling-with-getimagedata-and.html' title='Scrolling with getImageData and putImageData'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-3225681343534578394</id><published>2008-09-19T01:08:00.011-04:00</published><updated>2008-10-03T13:32:37.343-04:00</updated><title type='text'>Partial "FIX": Firefox reaction to certain keys</title><content type='html'>I think found the issue:&lt;br /&gt;&lt;br /&gt;In &lt;span style="font-family:courier new;"&gt;hardwareSimulation.js&lt;/span&gt;&lt;br /&gt;  &lt;span style="font-family:courier new;"&gt;function simOnKeypress()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Line:&lt;br /&gt;  &lt;span style="font-family:courier new;"&gt;event.preventDefault;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;preventDefault&lt;/span&gt; is a &lt;span style="font-family:courier new;"&gt;function&lt;/span&gt;, so all that line does is access the property, returning the function code itself.&lt;br /&gt;&lt;br /&gt;The fix: add parens:&lt;br /&gt;  &lt;span style="font-family:courier new;"&gt;event.preventDefault&lt;em&gt;&lt;strong&gt;&lt;span style="color:#cc0000;"&gt;()&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The only annoyance about this is it also disables F5, and &lt;span style="font-family:courier new;"&gt;event.which&lt;/span&gt; returns a code of 0.&lt;br /&gt;&lt;br /&gt;See a more recent post for the proper fix for this.&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;The "legacy" solution:&lt;br /&gt;&lt;br /&gt;In this case, though, &lt;span style="font-family:courier new;"&gt;event.keyCode&lt;/span&gt; has something meaningful, so you can use this to selectively enable (or rather, not disable, horray for double negatives) F5 to be handled by Firefox (if so desired):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;if (116 != event.keyCode) // F5 =&gt; keycode of 116&lt;br /&gt;{&lt;br /&gt;    event.preventDefault();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Browsers are lovely...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-3225681343534578394?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/3225681343534578394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=3225681343534578394' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3225681343534578394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3225681343534578394'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/fix-firefox-reaction-to-certain-keys.html' title='Partial &quot;FIX&quot;: Firefox reaction to certain keys'/><author><name>The Danner</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_Wy83_tUor3E/STTk-2lR4kI/AAAAAAAAACA/1muzcALeEqM/s1600-R/gas_gague.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-7069893330365784765</id><published>2008-09-18T12:22:00.002-04:00</published><updated>2008-09-18T12:24:47.579-04:00</updated><title type='text'>Firefox reaction to certain keys</title><content type='html'>I've noticed in my testing that Firefox has programmed responses to certain keys.  The ones that are really a problem are single quote and /.   Pressing either of these launches the Quick Find feature on me.&lt;br /&gt;&lt;br /&gt;Backspace also fires the back button on the browser.  I do have a workaround for that at least.  Just open the OS project in a new tab.&lt;br /&gt;&lt;br /&gt;Anybody else encountered these, or have a workaround?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-7069893330365784765?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/7069893330365784765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=7069893330365784765' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/7069893330365784765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/7069893330365784765'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/firefox-reaction-to-certain-keys.html' title='Firefox reaction to certain keys'/><author><name>Neal Tanner</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-4564300167148533474</id><published>2008-09-17T17:36:00.002-04:00</published><updated>2008-09-17T17:40:39.905-04:00</updated><title type='text'>StdIn and StdOut</title><content type='html'>This has been bugging me, since I started looking at the code.&lt;br /&gt;&lt;br /&gt;From what I remember of C programming, you usually read from the StdIn stream, and write to the StdOut stream.&lt;br /&gt;&lt;br /&gt;At the moment, all the console window output is being written to the _StdIn reference to the console window.  Should we be using _StdOut instead?&lt;br /&gt;&lt;br /&gt;I realize this might not matter too much right now, but it might become important, as this project gets more complex&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-4564300167148533474?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/4564300167148533474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=4564300167148533474' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4564300167148533474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4564300167148533474'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/stdin-and-stdout.html' title='StdIn and StdOut'/><author><name>Neal Tanner</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-4455210264591233276</id><published>2008-09-16T13:32:00.002-04:00</published><updated>2008-09-16T13:35:26.705-04:00</updated><title type='text'>Scrolling</title><content type='html'>Any ideas on scrolling besides keeping an array of all the lines on the screen, then redrawing each time? I tried canvas.translate, but I can't make it work. I found something about scrollbars, but that sounded like a Javascript function, and not quite what he wants us to be doing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-4455210264591233276?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/4455210264591233276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=4455210264591233276' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4455210264591233276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4455210264591233276'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/scrolling.html' title='Scrolling'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-2980400397093502144</id><published>2008-09-15T21:43:00.002-04:00</published><updated>2008-09-15T21:45:34.371-04:00</updated><title type='text'>whereami command</title><content type='html'>So, I meant to stop by and ask Prof Labouseur about this, but I forgot.&lt;br /&gt;&lt;br /&gt;Is there actually a way to get geographical location with the "whereami" command? I assume some sort of IP address lookup? How does one go about doing that?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-2980400397093502144?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/2980400397093502144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=2980400397093502144' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2980400397093502144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2980400397093502144'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/whereami-command.html' title='whereami command'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-565251055596221889</id><published>2008-09-15T17:30:00.004-04:00</published><updated>2008-09-15T17:42:14.804-04:00</updated><title type='text'>Keycodes in Mozilla</title><content type='html'>Ignore this, I didn't refresh the window before posting.&lt;br /&gt;&lt;br /&gt;(Shoot, why is it saying NerfTheWarmech instead of Kris? I need to make a different account.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-565251055596221889?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/565251055596221889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=565251055596221889' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/565251055596221889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/565251055596221889'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/keycodes-in-mozilla.html' title='Keycodes in Mozilla'/><author><name>Kris</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-2357427592304348978</id><published>2008-09-15T16:51:00.003-04:00</published><updated>2008-09-15T17:03:38.125-04:00</updated><title type='text'>Punctuation charcodes</title><content type='html'>So, it turns out as Luis and I were testing punctuation in &lt;span style="font-style: italic;"&gt;deviceDriverKeyboard.js&lt;/span&gt; that the charcodes for punctuation are suffering from a wonderful &lt;span style="font-weight: bold;"&gt;ascii&lt;/span&gt; to &lt;span style="font-weight: bold;"&gt;unicode&lt;/span&gt; conversion...&lt;br /&gt;&lt;br /&gt;i.e. charcode for period (.) in ascii is 190&lt;br /&gt;           charcode for period (.) in unicode is 46&lt;br /&gt;&lt;br /&gt;In the krnKbdDispatchKeyPress function....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_2OiVZtY_Zzk/SM7MQ1BIdiI/AAAAAAAAAAQ/AIan92Y6sjQ/s1600-h/example.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_2OiVZtY_Zzk/SM7MQ1BIdiI/AAAAAAAAAAQ/AIan92Y6sjQ/s320/example.bmp" alt="" id="BLOGGER_PHOTO_ID_5246355205415007778" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This test threw alerts on the screen when period (.) was pressed on the console the first alert displayed the ascii charcode that was pressed...190 and then the second alert displayed the symbol 190 equates into unicode which is a (3/4) fraction symbol. (Kudos to Luis on testing).&lt;br /&gt;&lt;br /&gt;I am working out an efficient way to convert if at all possible these charcodes to make punctuation friendly...&lt;br /&gt;&lt;br /&gt;Any ideas of how to attack this?  Or is there a workaround I am not seeing?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-2357427592304348978?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/2357427592304348978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=2357427592304348978' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2357427592304348978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/2357427592304348978'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/punctuation-charcodes.html' title='Punctuation charcodes'/><author><name>Scott</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_2OiVZtY_Zzk/SM7MQ1BIdiI/AAAAAAAAAAQ/AIan92Y6sjQ/s72-c/example.bmp' height='72' width='72'/><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-7774555149598923755</id><published>2008-09-13T13:11:00.007-04:00</published><updated>2008-09-13T15:17:38.708-04:00</updated><title type='text'>Log</title><content type='html'>As it was mentioned in class, the textarea style log tends to lag the page up once it gets filled with a lot of text. Another thing that annoyed me was that new entries to the log were entered at the bottom, so the log would get longer but you couldn't see it without scrolling. So, I changed my log to use a div instead of a text area. Also modified the code so that newest entries to the log were placed at the top. If you would like a log like mine, here is what you have to do...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In 'index.html' find the text area with id 'taLog'. Delete the text area and replace with a div instead. Give the div an id and name of 'divLog' and a class of log.&lt;br /&gt;&lt;br /&gt;Next in hardwareSimulation.js, in the simInit() function, replace:&lt;br /&gt;&lt;pre class="javascript" name="code"&gt;&lt;br /&gt;    // Clear the log text box.&lt;br /&gt;    document.getElementById("taLog").value="";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;With..&lt;br /&gt;&lt;pre class="javascript" name="code"&gt;&lt;br /&gt;    // Clear the log text box.&lt;br /&gt;    document.getElementById("divLog").innerHTML="";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Also, in the simlog function, replace this&lt;br /&gt;&lt;pre class="javascript" name="code"&gt;&lt;br /&gt;    // Update the log console.&lt;br /&gt;    taLog = document.getElementById("taLog");&lt;br /&gt;    taLog.value = taLog.value + str;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;With..&lt;br /&gt;&lt;pre class="javascript" name="code"&gt;&lt;br /&gt;    // Update the log console.&lt;br /&gt;    divLog = document.getElementById("divLog");&lt;br /&gt;    divLog.innerHTML =&lt;br /&gt;        "&amp;lt;div&amp;gt;" + str + "&amp;lt;/ div &amp;gt;" +&lt;br /&gt;        divLog.innerHTML;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Lastly, in the .css file, add this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="css" name="code"&gt;&lt;br /&gt;.log&lt;br /&gt;{&lt;br /&gt;  height: 500px;&lt;br /&gt;  width: 400px;&lt;br /&gt;  background: white;&lt;br /&gt;  overflow: scroll;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;em&gt;ed: syntax highlighting supports CSS too!&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Now you should have an improved log!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-7774555149598923755?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/7774555149598923755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=7774555149598923755' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/7774555149598923755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/7774555149598923755'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/log.html' title='Log'/><author><name>CJ</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-3611745722664196374</id><published>2008-09-11T23:38:00.004-04:00</published><updated>2008-09-12T19:23:27.064-04:00</updated><title type='text'>Using for...in when adding methods to Array</title><content type='html'>If you are going to use add methods to the base object Array (using prototype), you should be aware of the for...in iterator.&lt;br /&gt;&lt;br /&gt;To get a better idea of what I'm talking about, I added several functions to some JS base classes. Here is an example of adding the contains method to Array:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;/*&lt;br /&gt; * Uses Array#indexOf to check if there was a matching element.&lt;br /&gt; * Returns true if found, false otherwise.&lt;br /&gt; */&lt;br /&gt;function contains(element)&lt;br /&gt;{&lt;br /&gt;    return (this.indexOf(element) != -1);&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;Array.prototype.contains = contains;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So I happily went along using this to parse shell args...until I started getting all these funny errors. It turns out that the for...in statement was causing this. Taken from &lt;a href="http://www.w3schools.com/jS/js_loop_for_in.asp"&gt;http://www.w3schools.com/jS/js_loop_for_in.asp&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;The for...in statement is used to loop (iterate) through the elements of an  array or through the properties of an object.&lt;/p&gt; &lt;p&gt;The code in the body of the for ... in  loop is executed once for each element/property.&lt;/p&gt;&lt;/blockquote&gt;This means it not only iterates through each element in the array, but whatever properties we have added to it (this includes methods). It would iterate through all elements and then through all added properties (in this case methods).&lt;br /&gt;&lt;br /&gt;If you are going to extend Array, we probably want to change those for loops to a traditional for loop.&lt;br /&gt;&lt;br /&gt;These for...in loops were used in the following locations:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="bash"&gt;&lt;br /&gt;scripts/utils.js:24:    for (var i in str)&lt;br /&gt;scripts/os/queue.js:44:    for (i in this.q)&lt;br /&gt;scripts/os/shell.js:116:    for (var i in tempList)&lt;br /&gt;scripts/os/shell.js:238:    for (i in _OsShell.commandList)&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-3611745722664196374?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/3611745722664196374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=3611745722664196374' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3611745722664196374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/3611745722664196374'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/using-forin-when-adding-methods-to.html' title='Using for...in when adding methods to Array'/><author><name>Rob Fama</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-374001416286179798</id><published>2008-09-11T18:55:00.010-04:00</published><updated>2008-09-13T16:10:09.289-04:00</updated><title type='text'>Syntax Highlighting Test</title><content type='html'>This is a test&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function ontest()&lt;br /&gt;{&lt;br /&gt;  alert("This is only a test.");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;See?&lt;br /&gt;You have to use the XHTML "pre" tag in your post and give it a name and class, like so:&lt;br /&gt;&lt;textarea name="code" class="javascript"&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;  function ontest()&lt;br /&gt;  {&lt;br /&gt;    alert("This is only a test.");&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/textarea&gt;&lt;br /&gt;Very Cool.  Thanks Dan.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;ed: It supports a number of different languages; &lt;a href="http://code.google.com/p/syntaxhighlighter/wiki/Languages" target="_blank"&gt;see here&lt;/a&gt; for the full list.  Use the alias as the &lt;span style="font-family:courier new;"&gt;class&lt;/span&gt;.&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-374001416286179798?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/374001416286179798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=374001416286179798' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/374001416286179798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/374001416286179798'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/syntax-highlighting-test.html' title='Syntax Highlighting Test'/><author><name>Alan Labouseur</name><uri>http://www.blogger.com/profile/17342767736896968440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://2.bp.blogspot.com/_8pbB1753qJE/TBpB_re_9HI/AAAAAAAAAuw/ZcS9tCFNsRw/S220/headshot2.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-6653222353606924582</id><published>2008-09-08T13:35:00.080-04:00</published><updated>2008-09-17T02:12:11.812-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript object associative array'/><title type='text'>JavaScript "Associative Arrays"</title><content type='html'>JavaScript has support for "associative arrays", similar to what other languages (e.g. Perl, Ruby) have built in. They're used extensively in jQuery-land by the name of "Options Objects". They aren't, strictly speaking, associative arrays, but rather plain old JavaScript &lt;span style="font-family:courier new;"&gt;Object&lt;/span&gt;s. See &lt;a href="http://blog.persistent.info/2004/08/javascript-associative-arrays.html"&gt;here&lt;/a&gt; for an explanation.&lt;br /&gt;&lt;br /&gt;In any case, using them is simple, and makes storing and passing data around easier.  Keys and values can be of any type (&lt;span style="font-family:courier new;"&gt;string&lt;/span&gt;, &lt;span style="font-family:courier new;"&gt;number&lt;/span&gt;, &lt;span style="font-family:courier new;"&gt;Regexp&lt;/span&gt;, &lt;span style="font-family:courier new;"&gt;function&lt;/span&gt;, etc.), and an individual object doesn't have to be homogeneous.  The keys usually work best if they're all &lt;span style="font-family:courier new;"&gt;string&lt;/span&gt;s (numbers can also be useful).&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;// create a new, empty object&lt;br /&gt;var associativeArray = {};&lt;br /&gt;&lt;br /&gt;associativeArray["key1"] = "value1";&lt;br /&gt;associativeArray["key2"] =&lt;br /&gt;    /\w+/g; // Regular expression&lt;br /&gt;associativeArray["timeSliceQuantum"] = 10;&lt;br /&gt;associativeArray["theAnswer"] = 42;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The key-value pairs can also be declared inline:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;var anotherAssociativeArray2 = {&lt;br /&gt;  "a" : "alpha",&lt;br /&gt;  "b" : "beta",&lt;br /&gt;  "c" : "charliehorse"&lt;br /&gt;  // etc.&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Accessing uses array syntax:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;// access a value with a literal&lt;br /&gt;var someVar =&lt;br /&gt;    associativeArray["key1"]; // =&gt; "value1"&lt;br /&gt;&lt;br /&gt;// access a value by a variable key&lt;br /&gt;var someKey2 = "key2";&lt;br /&gt;var anotherVar = associativeArray[someKey2];&lt;br /&gt;  // =&gt; /\w+/g&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can also iterate over all the key-value pairs using a for-each-like syntax (note: see Rob's post above about using the for-each on regular arrays):&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;for (key in associativeArray)&lt;br /&gt;{&lt;br /&gt;  alert("Key: " + key +&lt;br /&gt;        ", Value: " + associativeArray[key]);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The order that they are returned in here is implementation dependent.  It may be in the order they were added (I think it is on most browsers), or it may not.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;That's (pretty much) all you need to know to start using them.&lt;/span&gt;  Come back here if you can't find a Calculus book late at night (sorry Alan, I'm stealing your lines again).&lt;br /&gt;&lt;br /&gt;-----&lt;br /&gt;Below is extra stuff that isn't really necessary, but useful to be aware of.&lt;br /&gt;&lt;br /&gt;Accessing keys that weren't set returns &lt;span style="font-family:courier new;"&gt;undefined&lt;/span&gt;:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;var someValue = associativeArray["pandaBears"];&lt;br /&gt;   // =&gt; undefined&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;One gotcha: it's better (in my opinion) to specify keys as string literals (doesn't matter for values):&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;var apple = {&lt;br /&gt;  "one" : "1",&lt;br /&gt;  "two" : 2&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;...but, it's much more common to use the non-string version:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;var apple = {&lt;br /&gt;  one : "1",&lt;br /&gt;  two : 2&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Both have the same effect, but if there's a &lt;em&gt;variable&lt;/em&gt; with the name of "one" in the current scope, it will be ignored as a &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;key&lt;/span&gt;; "one" will be interpreted as a string literal and used as the key. Variables are properly handled as &lt;span style="FONT-WEIGHT: bold; FONT-STYLE: italic"&gt;values&lt;/span&gt;, though:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;var two = "2";&lt;br /&gt;var apple = {&lt;br /&gt;  "one" : "1", // "one" =&gt; "1"&lt;br /&gt;  two : two    // "two" =&gt; "2"  !!!!!&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;// Set keys with a variable this way:&lt;br /&gt;var three = "thr33";&lt;br /&gt;apple[three] = "c"; // "thr33" =&gt; "c"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So, JavaScript associative arrays in a nutshell. They're awesomeness. Here's a snippet that covers more or less everything:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;// Literal declaration:&lt;br /&gt;var someKey3 = "key3";&lt;br /&gt;var someValue3 = "value3";&lt;br /&gt;&lt;br /&gt;var aa = {&lt;br /&gt;  key1 : "value1" , // "key1" =&gt; "value1"&lt;br /&gt;  "key2" : "value2" , // "key2" =&gt; "value2"&lt;br /&gt;  someKey3 : someValue3&lt;br /&gt;      // "weird" case: "someKey3" =&gt; "value3"&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Array-like notation:&lt;br /&gt;var someKey5 = "key5";&lt;br /&gt;&lt;br /&gt;aa["key4"] = "value4";&lt;br /&gt;aa[someKey5] = "value5"; // "key5" =&gt; "value5"&lt;br /&gt;&lt;br /&gt;// Yes, you can put functions as values, too.&lt;br /&gt;aa["callbackFunction"] = function () {&lt;br /&gt;    return 42;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;alert(aa[someKey5]); // =&gt; "value5"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Iteration:&lt;br /&gt;for (key in aa)&lt;br /&gt;{&lt;br /&gt;  var value = aa[key];&lt;br /&gt;  alert(key + " = " + value);&lt;br /&gt;}&lt;br /&gt;/* Alerts should say:&lt;br /&gt;&lt;br /&gt;value5&lt;br /&gt;key1 = value1&lt;br /&gt;key2 = value2&lt;br /&gt;someKey3 = value3&lt;br /&gt;key4 = value4&lt;br /&gt;key5 = value5&lt;br /&gt;callbackFunction = function() { return 42; }&lt;br /&gt;&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-6653222353606924582?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/6653222353606924582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=6653222353606924582' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/6653222353606924582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/6653222353606924582'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/javascript-associative-arrays.html' title='JavaScript &quot;Associative Arrays&quot;'/><author><name>The Danner</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_Wy83_tUor3E/STTk-2lR4kI/AAAAAAAAACA/1muzcALeEqM/s1600-R/gas_gague.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-4345991089569942708</id><published>2008-09-06T21:58:00.012-04:00</published><updated>2008-09-13T14:50:36.251-04:00</updated><title type='text'>Code Enhancements from Class One</title><content type='html'>globals.js:&lt;br /&gt;- Updated the version number.&lt;br /&gt;- Removed ENTER_PRESSED_IRQ constant.&lt;br /&gt;&lt;br /&gt;shell.js&lt;br /&gt;- Refactored shellHandleInput so that the parsing part is in its own routine called shellParseInput.&lt;br /&gt;- Created a new "inner" class called UserCommand:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function UserCommand()&lt;br /&gt;{&lt;br /&gt;   // Properties&lt;br /&gt;   this.command = "";&lt;br /&gt;   this.args = [];&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;This is passed back from shellParseInput.&lt;br /&gt;- Tested a lot to see that I didn't break anything that was previously working.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-4345991089569942708?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/4345991089569942708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=4345991089569942708' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4345991089569942708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4345991089569942708'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/code-enhancements-from-class-one.html' title='Code Enhancements from Class One'/><author><name>Alan Labouseur</name><uri>http://www.blogger.com/profile/17342767736896968440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://2.bp.blogspot.com/_8pbB1753qJE/TBpB_re_9HI/AAAAAAAAAuw/ZcS9tCFNsRw/S220/headshot2.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6052079401452677186.post-4973903129673469559</id><published>2008-09-06T21:05:00.005-04:00</published><updated>2008-09-06T21:08:16.504-04:00</updated><title type='text'>Welcome to the Fall 2008 Operating Systems blog</title><content type='html'>The idea here is that we can use this blog to share ideas and techniques to enhance all of our projects.  Feel free to post code too, but try and keep it to small snippets.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6052079401452677186-4973903129673469559?l=cmsc422mscs515.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cmsc422mscs515.blogspot.com/feeds/4973903129673469559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6052079401452677186&amp;postID=4973903129673469559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4973903129673469559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6052079401452677186/posts/default/4973903129673469559'/><link rel='alternate' type='text/html' href='http://cmsc422mscs515.blogspot.com/2008/09/welcome-to-fall-2008-operating-systems.html' title='Welcome to the Fall 2008 Operating Systems blog'/><author><name>Alan Labouseur</name><uri>http://www.blogger.com/profile/17342767736896968440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://2.bp.blogspot.com/_8pbB1753qJE/TBpB_re_9HI/AAAAAAAAAuw/ZcS9tCFNsRw/S220/headshot2.png'/></author><thr:total>0</thr:total></entry></feed>
