From f64b4fe1106b701d11c2d7f6c134bebc28d62784 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Mon, 21 Nov 2016 08:51:17 -0800 Subject: [PATCH] Pulled the blog posts into the other branches --- _posts/2013-11-20-a-blog-thats-not-a-blog.md | 56 ++++ _posts/2014-01-01-new-year-new-directions.md | 19 ++ _posts/2014-03-30-running-on-azure.md | 56 ++++ .../2014-03-31-browser-compatibility-woes.md | 47 ++++ ...04-01-the-latest-in-emulator-technology.md | 23 ++ _posts/2014-04-12-whats-new-in-1.13.0.md | 26 ++ _posts/2014-04-14-node-express-safari.md | 156 +++++++++++ _posts/2014-04-30-heading-to-new-york.md | 45 ++++ _posts/2014-05-12-chrome-kicks-butt.md | 33 +++ _posts/2014-06-14-halt-and-catch-liar.md | 81 ++++++ .../2014-06-26-more-under-the-hood-changes.md | 18 ++ _posts/2014-07-30-ega-support.md | 48 ++++ _posts/2014-08-01-pc-tech-journal-1987.md | 32 +++ _posts/2014-08-28-supporting-the-80286.md | 53 ++++ .../2014-09-02-minor-fixes-and-additions.md | 32 +++ ...4-09-13-the-ibm-pc-at-alive-and-booting.md | 71 +++++ _posts/2014-09-30-pcjs-coding-conventions.md | 246 ++++++++++++++++++ _posts/2014-10-12-pcjs-released-on-github.md | 27 ++ _posts/2014-10-13-the-8mhz-ibm-pc-at-5170.md | 34 +++ ...-17-improved-support-for-pc-at-machines.md | 58 +++++ .../2014-10-23-improved-pc-dos-700-support.md | 27 ++ _posts/2014-10-26-javascript-negativity.md | 83 ++++++ ...-28-limited-support-for-xdf-disk-images.md | 23 ++ _posts/2014-12-04-os2-10.md | 55 ++++ ...-canvas-performance-and-contenteditable.md | 71 +++++ _posts/2015-01-17-pcjs-uncompiled.md | 48 ++++ _posts/2015-01-28-new-pcjs-control-panel.md | 23 ++ _posts/2015-02-22-compaq-deskpro-386.md | 30 +++ _posts/2015-02-23-early-80386-cpus.md | 116 +++++++++ .../2015-03-26-javascript-idiosyncrasies.md | 210 +++++++++++++++ .../2015-04-16-compaq-deskpro-386-update.md | 154 +++++++++++ .../2015-05-20-pc-tech-journal-collection.md | 26 ++ .../2015-06-01-debugging-the-ibm-vga-rom.md | 142 ++++++++++ ...nge-case-of-the-ega-graphics-scroll-bug.md | 186 +++++++++++++ _posts/2015-07-17-windows-95.md | 204 +++++++++++++++ ...15-09-21-windows-95-in-your-web-browser.md | 39 +++ ...5-10-27-windows-95-and-early-80386-cpus.md | 218 ++++++++++++++++ .../2015-12-10-rebuilding-the-pcjs-website.md | 124 +++++++++ _posts/2015-12-27-revisiting-os2.md | 48 ++++ _posts/2016-01-23-early-os2-artifacts.md | 39 +++ _posts/2016-02-08-super-bowl-winner-pcjs.md | 57 ++++ .../2016-02-17-saving-disks-and-machines.md | 130 +++++++++ _posts/2016-02-24-remembering-compaq.md | 95 +++++++ _posts/2016-03-06-touching-windows.md | 48 ++++ ...3-12-demos-of-windows386-and-windows-3x.md | 34 +++ _posts/2016-04-30-the-intel-8080-cpu.md | 56 ++++ _posts/2016-05-04-the-sharpening.md | 95 +++++++ _posts/2016-08-03-the-vt100-terminal.md | 66 +++++ ...cting-an-ibm-pc-to-a-dec-vt100-terminal.md | 85 ++++++ ...-06-introducing-pdpjs-a-pdp-11-emulator.md | 53 ++++ _posts/2016-10-21-booting-pdp-11-basic.md | 34 +++ ...08-you-should-have-voted-for-the-pdp-11.md | 69 +++++ _posts/2016-11-13-curious-pdp-11-features.md | 94 +++++++ 53 files changed, 3943 insertions(+) create mode 100644 _posts/2013-11-20-a-blog-thats-not-a-blog.md create mode 100644 _posts/2014-01-01-new-year-new-directions.md create mode 100644 _posts/2014-03-30-running-on-azure.md create mode 100644 _posts/2014-03-31-browser-compatibility-woes.md create mode 100644 _posts/2014-04-01-the-latest-in-emulator-technology.md create mode 100644 _posts/2014-04-12-whats-new-in-1.13.0.md create mode 100644 _posts/2014-04-14-node-express-safari.md create mode 100644 _posts/2014-04-30-heading-to-new-york.md create mode 100644 _posts/2014-05-12-chrome-kicks-butt.md create mode 100644 _posts/2014-06-14-halt-and-catch-liar.md create mode 100644 _posts/2014-06-26-more-under-the-hood-changes.md create mode 100644 _posts/2014-07-30-ega-support.md create mode 100644 _posts/2014-08-01-pc-tech-journal-1987.md create mode 100644 _posts/2014-08-28-supporting-the-80286.md create mode 100644 _posts/2014-09-02-minor-fixes-and-additions.md create mode 100644 _posts/2014-09-13-the-ibm-pc-at-alive-and-booting.md create mode 100644 _posts/2014-09-30-pcjs-coding-conventions.md create mode 100644 _posts/2014-10-12-pcjs-released-on-github.md create mode 100644 _posts/2014-10-13-the-8mhz-ibm-pc-at-5170.md create mode 100644 _posts/2014-10-17-improved-support-for-pc-at-machines.md create mode 100644 _posts/2014-10-23-improved-pc-dos-700-support.md create mode 100644 _posts/2014-10-26-javascript-negativity.md create mode 100644 _posts/2014-10-28-limited-support-for-xdf-disk-images.md create mode 100644 _posts/2014-12-04-os2-10.md create mode 100644 _posts/2014-12-05-canvas-performance-and-contenteditable.md create mode 100644 _posts/2015-01-17-pcjs-uncompiled.md create mode 100644 _posts/2015-01-28-new-pcjs-control-panel.md create mode 100644 _posts/2015-02-22-compaq-deskpro-386.md create mode 100644 _posts/2015-02-23-early-80386-cpus.md create mode 100644 _posts/2015-03-26-javascript-idiosyncrasies.md create mode 100644 _posts/2015-04-16-compaq-deskpro-386-update.md create mode 100644 _posts/2015-05-20-pc-tech-journal-collection.md create mode 100644 _posts/2015-06-01-debugging-the-ibm-vga-rom.md create mode 100644 _posts/2015-06-05-the-strange-case-of-the-ega-graphics-scroll-bug.md create mode 100644 _posts/2015-07-17-windows-95.md create mode 100644 _posts/2015-09-21-windows-95-in-your-web-browser.md create mode 100644 _posts/2015-10-27-windows-95-and-early-80386-cpus.md create mode 100644 _posts/2015-12-10-rebuilding-the-pcjs-website.md create mode 100644 _posts/2015-12-27-revisiting-os2.md create mode 100644 _posts/2016-01-23-early-os2-artifacts.md create mode 100644 _posts/2016-02-08-super-bowl-winner-pcjs.md create mode 100644 _posts/2016-02-17-saving-disks-and-machines.md create mode 100644 _posts/2016-02-24-remembering-compaq.md create mode 100644 _posts/2016-03-06-touching-windows.md create mode 100644 _posts/2016-03-12-demos-of-windows386-and-windows-3x.md create mode 100644 _posts/2016-04-30-the-intel-8080-cpu.md create mode 100644 _posts/2016-05-04-the-sharpening.md create mode 100644 _posts/2016-08-03-the-vt100-terminal.md create mode 100644 _posts/2016-08-19-connecting-an-ibm-pc-to-a-dec-vt100-terminal.md create mode 100644 _posts/2016-10-06-introducing-pdpjs-a-pdp-11-emulator.md create mode 100644 _posts/2016-10-21-booting-pdp-11-basic.md create mode 100644 _posts/2016-11-08-you-should-have-voted-for-the-pdp-11.md create mode 100644 _posts/2016-11-13-curious-pdp-11-features.md diff --git a/_posts/2013-11-20-a-blog-thats-not-a-blog.md b/_posts/2013-11-20-a-blog-thats-not-a-blog.md new file mode 100644 index 000000000..ac6a73677 --- /dev/null +++ b/_posts/2013-11-20-a-blog-thats-not-a-blog.md @@ -0,0 +1,56 @@ +--- +layout: post +title: "A Blog That's Not A Blog" +date: 2013-11-20 11:00:00 +category: News +permalink: /blog/2013/11/20/ +--- + +As you may have noticed (or not), the [JSMachines](http://jsmachines.net/) website had a very modest makeover +recently. + +Originally, the site was a smattering of HTML files, along with some XML files that I was rendering as HTML +using some simple XSL stylesheets. However, I was tired of having one set of files for the website to explain +things and a different set of files on [GitHub](http://github.com) that explained other things -- many +of those things being the SAME things. + +So this month, I decided to eliminate all the HTML files. As you browse the site, you're simply navigating +folders from the **GitHub** project and reading the project's **README.md** files. + +There's a single PHP script responsible for transforming a folder's default document (either **README.md** +or **machine.xml**) to HTML, as well as displaying the current directory across the top and a directory listing +down the left-hand side. + +The same script provides support for a subset of the [Markdown](http://daringfireball.net/projects/markdown/) +syntax, which is more than sufficient to handle all the site's **README.md** files. I probably should +have used a third-party Markdown library, but this was more educational, and it was easy to add extra features, +like the ability to embed JavaScript machines with a single Markdown-style link; eg: + + [IBM PC](/devices/pcx86/machine/5150/mda/64kb/ "PCjs:ibm5150") + +The script takes care of the rest, adding the appropriate stylesheets and PCjs scripts automatically. + +I had more grandiose plans, including a command-line prompt written in JavaScript that would allow you to +navigate the site exactly as you would an IBM PC hard drive from a "DOS prompt", and I may try something +like that later, but don't hold your breath. + +I've tried to improve the organization of all the [Machine Configuration Files](/devices/pcx86/machine/) as well. +The variety of configurations was getting out of hand. It's a bit tidier now, but there's still room for +improvement. + +My workflow is improving, too. I'm more comfortable with [GitHub](http://github.com) now, +and I recently switched from Eclipse to JetBrains' [WebStorm](http://www.jetbrains.com/webstorm) (well, +actually [PhpStorm](http://www.jetbrains.com/phpstorm), since it's a superset of WebStorm, although I did start +with WebStorm), and the new development environment is feeling pretty good now. I've had zero problems with +[JetBrains](http://www.jetbrains.com) products and I'm seriously impressed with their quality and completeness, +so I have no qualms about moving from the "free" Eclipse platform to the $99 PhpStorm IDE. + +The nice thing about the new GitHub-centric approach is that it's easy to "push" changes to both the repository +and the website. I update one or more **README.md** files, "Commit and Push" from the IDE, then "pull" from GitHub +on the web server. + +This so-called blog is more of the same: **README.md** files in a series of folders. The only question now: +will this actually evolve into a series...? + +*[@jeffpar](http://twitter.com/jeffpar)* +*November 20, 2013* diff --git a/_posts/2014-01-01-new-year-new-directions.md b/_posts/2014-01-01-new-year-new-directions.md new file mode 100644 index 000000000..0758c2455 --- /dev/null +++ b/_posts/2014-01-01-new-year-new-directions.md @@ -0,0 +1,19 @@ +--- +layout: post +title: New Year, New Directions +date: 2014-01-01 11:00:00 +category: Goals +permalink: /blog/2014/01/01/ +--- + +Initial goals for 2014 include + +- Setting up a new web server running node.js, using either AWS, Google Compute Engine or Windows Azure; +- Porting this project to work with node.js, which includes rewriting all the PHP code as server-side JavaScript; +- Deciding whether to separate PCjs from C1Pjs for the new web site, or simply make PCjs.org a mirror of jsmachines.net; +- Deciding how best (or even whether) to accomodate PCjs running from both **node** and **non-node** web servers. + +I guess we'll learn more as the year progresses. + +*[@jeffpar](http://twitter.com/jeffpar)* +*January 20, 2014* diff --git a/_posts/2014-03-30-running-on-azure.md b/_posts/2014-03-30-running-on-azure.md new file mode 100644 index 000000000..02521f5ec --- /dev/null +++ b/_posts/2014-03-30-running-on-azure.md @@ -0,0 +1,56 @@ +--- +layout: post +title: Running on Azure +date: 2014-03-30 11:00:00 +category: Web Servers +permalink: /blog/2014/03/30/ +--- + +Publishing a Node-based site to [Azure](http://azure.com) was painless, thanks to their friendly web portal and +GitHub integration. Getting a fully operational site, however, took a bit more time. + +Unfortunately, because Azure's underlying server technology is Windows-based (IIS), some of the same Windows/Unix +portability problems that have plagued us for decades still plague us today: **carriage returns** and **backslashes**. + +Even though all PCjs text files in my project contain only linefeeds, IIS would serve them up with CR/LF +instead. I first noticed this on the client side, when an XML file retrieved via *XMLHttpRequest()* came back +full of CR/LFs, and later on the server side, when *fs.readFile()* returned a Markdown file filled with CR/LFs. + +I wondered if the CR/LF transformation had happened when Azure pulled all my files from GitHub, because +while I can understand some whitespace inconsistencies across web servers, I would never expect file system calls +on the server to modify file contents. + +I finally confirmed that the files were indeed modified on the server, by using Azure's FTP browser. For example, +[us83-buttons-minimal.xml](/devices/pcx86/keyboard/us83-buttons-minimal.xml) is currently 622 bytes locally, but on the +Azure server, the reported size is 632 bytes -- one extra CR for each of the file's 10 lines. After a little more +digging, I [learned something new](http://git-scm.com/book/ch7-1.html#Formatting-and-Whitespace) about **Git**: it +has a setting called `core.autocrlf` which, for me on OS X, defaults to `input` (meaning "convert CR/LF to LF on commit +but do NOT convert LF back to CR/LF on check-out"). But Azure apparently sets this to `true`, causing all LFs to be +converted to CR/LF. + +Regarding slashes, even when path components contained only slashes, *path.join()* would return paths with +backslashes. And unfortunately, this behavior varies from Node module to module. For example, I use the NPM +[glob](https://www.npmjs.org/package/glob) module, and even when the input path to *glob()* contains backslashes, +its output paths do not. + +In the process of fixing those portability issues, I also had some trouble getting Azure logging to work as +documented. Setting `loggingEnabled: true` in **/IISNode.yml** would generate logs in **/site/wwwroot/iisnode/**, +but the logs were numerous and poorly organized. + +And the Azure command-line tool that was *supposed* to enable real-time log-streaming to the console: + + azure site log tail pcjs + +would happily report: + + Welcome, you are now connected to log-streaming service + +but it would NEVER display anything but deployment information. Instead, I had to browse the log files using Azure's +"FTP DIAGNOSTIC LOGS" link on the web portal -- which presents the logs as one big, ugly, fragmented mess: + +![Azure Logs](/blog/images/iisnode-logs.jpg) + +Sigh. But at least the site is up and fully operational now. + +*[@jeffpar](http://twitter.com/jeffpar)* +*March 30, 2014* diff --git a/_posts/2014-03-31-browser-compatibility-woes.md b/_posts/2014-03-31-browser-compatibility-woes.md new file mode 100644 index 000000000..a58e37b90 --- /dev/null +++ b/_posts/2014-03-31-browser-compatibility-woes.md @@ -0,0 +1,47 @@ +--- +layout: post +title: Browser Compatibility Woes +date: 2014-03-31 11:00:00 +category: JavaScript +permalink: /blog/2014/03/31/ +--- + +While JavaScript has been doing a good job of delivering on the old "write once, run everywhere" promise that its +[unrelated namesake](http://www.java.com) coined, the "hook once, deliver everywhere" promise seems less fulfilled. + +Not that anyone ever made such a promise. + +Specifically, I'm talking about DOM events. Take the HTML5 <canvas> element, for example. If I give +it a `contenteditable="true"` attribute, it will play nicely with my JavaScript app in a Mobile Safari browser, +by popping up the device's soft keyboard in response to the canvas element receiving focus (ie, when you tap on it). + +The Silk browser on a Kindle Fire, however, is another story -- it acts like it has no idea what `contenteditable` +means. Even if I display an actual <input> text field alongside the <canvas>, and attach all the same +input event handlers to the text field instead of the canvas, the Kindle Fire's soft keyboard will pop up, but my +input event handlers still won't fire. + +I've done what testing I can with the Android SDK and the "Android Virtual Device Manager", and in general, support +looks fine -- you click/tap on the PC's screen, the soft keyboard pops up, and typing works. So I guess Silk is just +an outlier. I'm not sure what I'll do about it yet (or even what I can do). + +![PCjs in AVD](/blog/images/avd-tablet.jpg) + +--- + +Here's another issue I've yet to resolve. + +When Apple released iOS 7.0, PCjs went from being a rock-solid web application on +2nd/3rd/4th-generation iPads to a very flaky web application. It's still rock-solid on 5th-generation iPads +(the iPad Air and iPad Mini w/Retina Display), and so I suspect a bug in Apple's JavaScript engine that's specific +to their older A5 processor. + +It may be possible to work around the bug, but I haven't yet isolated exactly what code +sequence(s) are failing. For now, this is the most serious unresolved PCjs bug I'm aware of. + +--- + +If you're having a problem (or trouble with a device) that I've not already mentioned, [let me know](mailto:Jeff@pcjs.org). +Thanks. + +*[@jeffpar](http://twitter.com/jeffpar)* +*March 31, 2014* diff --git a/_posts/2014-04-01-the-latest-in-emulator-technology.md b/_posts/2014-04-01-the-latest-in-emulator-technology.md new file mode 100644 index 000000000..a33a6b948 --- /dev/null +++ b/_posts/2014-04-01-the-latest-in-emulator-technology.md @@ -0,0 +1,23 @@ +--- +layout: post +title: The Latest in Emulator Technology +date: 2014-04-01 11:00:00 +category: JavaScript +permalink: /blog/2014/04/01/ +--- + +Announcing **InternetJS: The Internet Emulator**, the world's smallest JavaScript application capable of emulating the entire Internet. +And like all PCjs applications, there's nothing to install. It runs safely and securely from any web browser. + +Check out the ALPHA release demo below. + + + +Disclaimer: InternetJS may not be suitable for everyone. Ask your doctor if InternetJS is right for you. Side-effects may include: + +- Increased awareness +- Loss of appetite after eating large meals +- Inability to forget things you never wanted to remember + +*[@jeffpar](http://twitter.com/jeffpar)* +*April 1, 2014* diff --git a/_posts/2014-04-12-whats-new-in-1.13.0.md b/_posts/2014-04-12-whats-new-in-1.13.0.md new file mode 100644 index 000000000..811ca4011 --- /dev/null +++ b/_posts/2014-04-12-whats-new-in-1.13.0.md @@ -0,0 +1,26 @@ +--- +layout: post +title: "What's New in 1.13.0" +date: 2014-04-12 11:00:00 +category: Releases +permalink: /blog/2014/04/12/ +--- + +The latest version adds support for "software manifests", which you can read more about [here](/apps/). Basically, manifests +are simple XML files that describe a piece of software (an application, an operating system, whatever). They can also +link to a PCjs machine configuration capable of running the software, along with a "ready-to-run" machine state file. +Conversely, a PCjs machine XML file can refer back to the manifest, to obtain a list of disk images. + +Here are some [Demos](/apps/pc/) of "ready-to-run" apps on [PCjs](/docs/about/). + +There have been lots of server-side changes recently, including API improvements that make it easy (well, *easier*) +to dynamically create diskette images from a list of files, or even an entire folder (including all subfolders), +as long as the total size of all the files will fit on a PCjs-supported diskette image. Support for creating hard disk +images is still on the "TODO" list (the original **convdisk** PHP script supported hard disk images, but that functionality +hasn't been ported to the newer **diskdump** Node module yet). + +Almost nothing has changed in the PCjs client-side code (which is where the emulator runs), except for changes to use +the new **diskdump** API. + +*[@jeffpar](http://twitter.com/jeffpar)* +*April 12, 2014* diff --git a/_posts/2014-04-14-node-express-safari.md b/_posts/2014-04-14-node-express-safari.md new file mode 100644 index 000000000..d9f395245 --- /dev/null +++ b/_posts/2014-04-14-node-express-safari.md @@ -0,0 +1,156 @@ +--- +layout: post +title: "Node + Express != Safari" +date: 2014-04-14 11:00:00 +category: Browsers +permalink: /blog/2014/04/14/ +--- + +There's something very odd going on with between Node+Express and Safari, resulting in blank web pages. +Don't believe me? Just ask [Google](https://www.google.com/#q=node+express+safari+blank+page). + +[{{ site.pcjs.domain }}]({{ site.url }}/) contains a lot of XML files that are rendered as web pages using XML +stylesheets. And occasionally Safari -- and ONLY Safari -- will render those XML files as blank pages. + +For example, here's the +[machine.xml](/devices/pcx86/machine/5150/mda/64kb/machine.xml) file that's also embedded on the +[{{ site.pcjs.domain }}]({{ site.url }}/) home page. + +When Safari fetched that XML file from an Apache web server (what I used before switching to Node), +the request would look like: + + Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 + Cache-Control: max-age=0 + User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14 + +and the response would look like: + + Date: Mon, 14 Apr 2014 22:11:20 GMT + Last-Modified: Sun, 13 Apr 2014 01:59:06 GMT + Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.4.24 mod_ssl/2.2.26 OpenSSL/0.9.8y + Etag: "37a10b3-492-4f6e2e96b2e80" + Content-Type: text/xml + Connection: Keep-Alive + Accept-Ranges: bytes + Keep-Alive: timeout=5, max=100 + Content-Length: 1170 + +with a status code of 200 ("OK"). And no matter how many times I hit Safari's Reload button, the response was the same. + +Now with Node+Express, the same exact request would look like: + + Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 + User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14 + +with a response of: + + Date: Mon, 14 Apr 2014 22:16:42 GMT + Etag: "1170-1397354346000" + Last-Modified: Sun, 13 Apr 2014 01:59:06 GMT + X-Powered-By: Express + Content-Type: application/xml + Cache-Control: public, max-age=0 + Connection: keep-alive + Accept-Ranges: bytes + Content-Length: 1170 + +HOWEVER, as soon as I used Safari's Back button to return to the home page, and then pressed the Forward button to return to +the XML file, the XML request changed to: + + Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 + Cache-Control: max-age=0 + If-None-Match: "1170-1397354346000" + If-Modified-Since: Sun, 13 Apr 2014 01:59:06 GMT + User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14 + +with a response of 304 ("Not Modified") and the following response headers: + + Date: Mon, 14 Apr 2014 22:18:26 GMT + Cache-Control: public, max-age=0 + Etag: "1170-1397354346000" + Last-Modified: Sun, 13 Apr 2014 01:59:06 GMT + Connection: keep-alive + Accept-Ranges: bytes + X-Powered-By: Express + +And here's where the "blank page" problem occurs: pressing Safari's Reload button. Again, the request looks the same as before, +and the response is still 304 ("Not Modified"), but the page is blank, and the response now looks like: + + Date: Mon, 14 Apr 2014 22:21:15 GMT + Cache-Control: public, max-age=0 + Last-Modified: Sun, 13 Apr 2014 01:59:06 GMT + Connection: keep-alive + Accept-Ranges: bytes + X-Powered-By: Express + Etag: "1170-1397354346000" + +and no matter how many times I press Reload, the response is the same (except for an updated *Date*), and the page is still blank. + +So, here's the kludge I've added to my Express server code, to prevent Safari from displaying blank pages for those XML files: + +{% highlight javascript linenos %} + /* + * The Safari "blank page" problem continues to plague us. Our first work-around was for directory + * "index.html" documents, which we resolved by always sending the document ourselves, along with an + * "ok" (200) response, instead of letting next() handle it, which would result in a "not modified" + * (304) response. + * + * However, the problem also extends to any XML files that we serve to an initial Safari request + * (eg, the machine.xml and manifest.xml files that we style as web pages). Safari includes + * "Cache-Control max-age=0" in the request, and if the response is "Cache-Control public, max-age=0" + * along with a 304 response code, Safari may once again display a blank page. + * + * This problem appears limited to the initial resource request for a particular URL. When these XML + * files are requested by Safari while loading another web page, Safari's caching logic is different + * (eg, it doesn't include the same "Cache-Control" setting). + */ + if (sBaseName == "machine.xml" || sBaseName == "manifest.xml") { + var sAgent = req.headers['user-agent']; + if (sAgent && sAgent.indexOf("Safari/") >= 0 && sAgent.indexOf("Chrome/") < 0 && sAgent.indexOf("OPR/") < 0) { + var sCacheControl = req.headers['cache-control']; + if (sCacheControl && sCacheControl.indexOf("max-age=0") >= 0) { + fs.readFile(sPath, {encoding: "utf8"}, function doneReadFile(err, sData) { + if (err) { + next(); // alternatively: res.status(404).send("Cannot GET " + req.path); + } else { + /* + * HACK: Express may still modify our response, turning our 200 status code into a 304 + * and adding an Etag, unless we ALSO change the req.method from "GET" to something else. + * Supposedly, we could also use app.disable('etag'), but I'm not sure that would prevent + * Express from changing the status code, and I'm tired of testing work-arounds for this + * irritating behavior in Safari. + */ + req.method = "NONE"; + res.set("Content-Type", "application/xml"); + res.status(200).send(sData); + } + }); + return; + } + } + } +{% endhighlight %} + +I should add that this problem wasn't limited to XML files. It's a problem for the first resource requested by +Safari for any URL on the site (eg, URLs that default to "index.html" files). + +I'm also rather surprised that no one yet seems to have figured out exactly what's going on here between Node+Express +and Safari. Or maybe they have, and I haven't been keeping my Node.js config up-to-date. I've tried to avoid changing +too many variables. + +Lots of people have run into this problem. For example, on +[StackOverflow](http://stackoverflow.com/questions/18811286/nodejs-express-cache-and-304-status-code), someone +concluded that the [node-fresh](https://github.com/visionmedia/node-fresh) module should be changed. And for a while, +it was changed, until the change was [reverted](https://github.com/visionmedia/node-fresh/issues/8) -- along with a +lengthy discussion about why the change was wrong and that this was really a bug in Safari. + +This "blank page" behavior may well be a bug in Safari, but that doesn't mean Express server components can't +or shouldn't provide a work-around for that behavior in the meantime. It also seems that some people who decided +this was a bug in Safari did not actually reproduce the bug themselves. + +I don't know the right answer, but I do know that the current situation adversely affects users of other Node-powered +websites, who will probably get blank pages when they shouldn't, and other developers, who must all discover/debug/work-around +this problem on their own. + +*[@jeffpar](http://twitter.com/jeffpar)* +*April 14, 2014* diff --git a/_posts/2014-04-30-heading-to-new-york.md b/_posts/2014-04-30-heading-to-new-york.md new file mode 100644 index 000000000..b76da214a --- /dev/null +++ b/_posts/2014-04-30-heading-to-new-york.md @@ -0,0 +1,45 @@ +--- +layout: post +title: Heading to New York +date: 2014-04-30 11:00:00 +category: JavaScript +permalink: /blog/2014/04/30/ +--- + +Lots of tinkering has been going on here at pcjs.org the past couple of weeks, but with nothing substantial to show for it. +Fixing lots of little problems requires only small bits of time, whereas buckling down and tackling "the next BIG thing" for +PCjs requires a much more serious time commitment, with limited interruptions. + +And I certainly can't start on "the next BIG thing" now, because I'm heading to New York tomorrow, for [EmpireJS](http://2014.empirejs.org), +my first JavaScript conference *and* my first trip to New York in about 20 years. + +I'm going to the conference partly because it was a great excuse to finally visit New York again (and with the whole family, +since all three of us are computer nerds), but also to get a more up-close-and-personal sense of where this whole JavaScript +renaissance is headed. + +Is it headed for a fiery crash? This recent blog post +("[you have ruined javascript](http://codeofrob.com/entries/you-have-ruined-javascript.html)") +suggests it already has for some people. Is it drowning in the Sea of Endless Proliferation, as this still-relevant two-year-old +[parody](http://www.webmonkey.com/2012/05/jokes-for-nerds-html9-responsive-boilerstrap-js/) implies? Excerpt: + +> *If you’re feeling overwhelmed by the endless proliferation of responsive grids, adaptive images, HTML boilerplates, +CSS frameworks and JavaScript whirligigs then what you need is the HTML9 Responsive Boilerstrap JS.* + +> *To install HTML9 Responsive Boilerstrap JS just “attackclone the grit repo pushmerge, then rubygem the lymphnode js shawarma +module — and presto!”* + +> *If you’re wondering what H9RBS.js actually is, well, you can abandon any hopes of one day being hip. But if you must know, +H9RBS.js is a “flexible, dependency-free, lightweight, device-agnostic, modular, baked-in, component framework MVC library +shoelacestrap to help you kickstart your responsive CSS-based app architecture backbone kitchensink tweetybirds.”* + +Seriously, I'm concerned about how the JavaScript language (rather than the endless procession of frameworks) is going to evolve, +and whether it even can. Two examples: at a high-level, we have Microsoft pushing [TypeScript](http://www.typescriptlang.org/), +and at a much lower level, we have Mozilla pushing [asm.js](http://asmjs.org). And while I like aspects of both those efforts, +I'm relunctant to go very far down either of those paths right now, because I don't want to get suckered. Inevitably, someone will +see a *different* shiny object along another fork in the road, and everyone will chase after that instead. + +Will [EmpireJS](http://2014.empirejs.org) answer any of these big questions? It doesn't really matter. I just expect to learn stuff, +and learning is fun! + +*[@jeffpar](http://twitter.com/jeffpar)* +*April 30, 2014* diff --git a/_posts/2014-05-12-chrome-kicks-butt.md b/_posts/2014-05-12-chrome-kicks-butt.md new file mode 100644 index 000000000..ce7c6727d --- /dev/null +++ b/_posts/2014-05-12-chrome-kicks-butt.md @@ -0,0 +1,33 @@ +--- +layout: post +title: Chrome Kicks Butt +date: 2014-05-12 11:00:00 +category: JavaScript +permalink: /blog/2014/05/12/ +--- + +I haven't been closely monitoring the performance of PCjs across various browsers. Most of my browser testing has +been limited to "Does the latest version still work in all current web browsers?" + +However, at some point during the last couple months, Chrome's performance suddenly jumped through the roof. On my +2.8GHz Intel Core i7 MacBook Pro, Chrome v34.0.1847.131 easily punches through the 120Mhz barrier on a PCjs machine +running PC-DOS 2.00. + +That's roughly a 3x-4x increase over previous versions of Chrome. Safari used to be the performance champ, capable +of running a PCjs machine at a top speed of around 70-80MHz, while Chrome was less than half that, and Firefox was +slower still. + +Chrome has now leap-frogged Safari in a big way, almost doubling Safari's speed. And with Chrome's superior +Developer Tools, Chrome is clearly the "Browser of Choice," whether you're just playing with PCjs or actually +debugging it. + +Firefox is a bit of a disappointment, given all the hoopla over [asm.js](http://asmjs.org/) and other investments +that Mozilla is making. I've taken a "wait-and-see" attitude toward asm.js, because PCjs is hand-coded JavaScript, +and I'm not prepared to build a preprocessor that converts the code to asm.js semantics solely for the benefit of a +single browser. + +Chrome's approach to making regular JavaScript run faster seems to be a winning strategy so far, at least for apps +like PCjs. + +*[@jeffpar](http://twitter.com/jeffpar)* +*May 12, 2014* diff --git a/_posts/2014-06-14-halt-and-catch-liar.md b/_posts/2014-06-14-halt-and-catch-liar.md new file mode 100644 index 000000000..2a33cb5a8 --- /dev/null +++ b/_posts/2014-06-14-halt-and-catch-liar.md @@ -0,0 +1,81 @@ +--- +layout: post +title: Halt and Catch Liar +date: 2014-06-14 11:00:00 +category: TV Shows +permalink: /blog/2014/06/14/ +--- + +I had high hopes for the new AMC series "[Halt and Catch Fire](http://www.amctv.com/shows/halt-and-catch-fire)," +but it has proven to be an utter disappointment. I think I can suspend my disbelief as well as anyone, but this +show requires you to completely turn your brain off in order to be believed. I'm also baffled by the show's +high [IMDb score](http://www.imdb.com/title/tt2543312/), which is currently 8.4 (out of 10). Either AMC has figured +out how to game the system, or viewers are easily turned on by clichés, like the know-it-all Hot Programmer, +the self-assured Sales Guy, and the non-plot-advancing sex that they almost instantly engage in. + +The premise: ex-IBM Sales Guy waltzes into a fictional computer company, smooth-talks his way into a top +marketing position without so much as a resumé, and then immediately risks all, including a huge potential lawsuit +with IBM, because he has dreams of building IBM clones that are "2x fast" at "1/2 price" -- with *handles*! + +And the first thing they must do to achieve this dream is clone the IBM PC ROM BIOS, which the show pretends +was so secret that you couldn't even tell which chips on the IBM PC motherboard contained the ROM. Never mind +that IBM published the entire ROM BIOS listing in their Technical Reference Manual, which also included system +diagrams identifying every chip in the machine. I think if you're going to weave facts into your fiction, +the least you can do is get your facts right. + +And centerpiece of this whole conceit -- the cloning of the IBM PC ROM BIOS. What a farce! Check out this +scene from Episode 2, where Brilliant Engineer looks at Hot Programmer's whiteboard in awe. Apparently, he +is easily awed, because he did the same thing when Sales Guy wrote "2x fast, 1/2 price" on an earlier whiteboard. + +["Halt and Catch Fire" Scene from Episode 2](/blog/images/halt-and-catch-liar.jpg) + +So if you deconstruct the code on this whiteboard, you quickly notice that while it IS assembly language, it is +NOT the sort of assembly language you would find in a ROM BIOS, let alone ANYTHING that would leave you in awe. + +Here are some excerpts: + + Initialization + MOV AX,CX ; set up DS + MOV DS,AX + MOV SS,AX ; and SS + LEA AX,BEGINSTACK + MOV SP,AX + MOV AL,OUTINT + ... + TSTART + LEA AX,BEGTRACE + MOV POINT,AX + MOV AL,YES ; TURN TRACE ON + MOV TFLAG,AL + MOV AL,NO ; NOT WRAPPED + MOV WRAP,AL + MOV AX,CS ; CONVERT ADDRESS FOR OUTPUT + LEA SI,LOADCS + CALL HEXPRT + MOV AX,100H + LEA SI,LOADIP + CALL HEXPRT + LEA DX,SIGNIN + MOV AH,9 + INT DOSINT + LEA DX,OUTPUT + MOV AL,OUTPUT (?) + MOV AH,25H ; Set Interrupt Vector + INT DOSINT ; Have DOS place the interrupt... + ... + +This is clearly **NOT** code for a PC ROM BIOS, because no PC BIOS would ever issue a DOS interrupt. +A BIOS is designed to be called *by* DOS, not the other way around. + +This turns out to be code largely copied from a file I found online: [PCTRACE.ASM](http://ftpmirror.your.org/pub/misc/dos/RbbsInABoxVol1No2_640/files/007P/PCTRACE.ZIP-contents/PCTRACE.ASM) + +Another curiosity is that searching for this resulted in a "[Googlewhack](http://en.wikipedia.org/wiki/Googlewhack)" +of sorts: + +![Googlewhack](/blog/images/googlewhack.jpg) + +Technically, a Googlewhack (a two-word search that yields exactly one result) must use two words found in an actual +dictionary. But dictionaries are so passé. + +*[@jeffpar](http://twitter.com/jeffpar)* +*June 14, 2014* diff --git a/_posts/2014-06-26-more-under-the-hood-changes.md b/_posts/2014-06-26-more-under-the-hood-changes.md new file mode 100644 index 000000000..e6d718aa9 --- /dev/null +++ b/_posts/2014-06-26-more-under-the-hood-changes.md @@ -0,0 +1,18 @@ +--- +layout: post +title: More Under-The-Hood Changes +date: 2014-06-26 11:00:00 +category: Releases +permalink: /blog/2014/06/26/ +--- + +v1.13.7 of PCjs contains a few minor improvements, mostly in terms of rendering video modes a little more +efficiently. The rest of the changes to the website involved beefing up support for both "software manifests" +and "document manifests." + +To that end, there's a new [/pubs/](/pubs/) directory for old documents, and [/disks/pcx86/](/disks/pcx86/) contains +more disk images, with more on the way. I have a TON of old diskette images, and it has taken more time to organize +them and create manifests than I would like. + +*[@jeffpar](http://twitter.com/jeffpar)* +*June 26, 2014* diff --git a/_posts/2014-07-30-ega-support.md b/_posts/2014-07-30-ega-support.md new file mode 100644 index 000000000..2425209e2 --- /dev/null +++ b/_posts/2014-07-30-ega-support.md @@ -0,0 +1,48 @@ +--- +layout: post +title: EGA Support +date: 2014-07-30 11:00:00 +category: Video +permalink: /blog/2014/07/30/ +--- + +PCjs v1.14.0 now includes basic EGA support. It emulates the EGA hardware well enough to pass the IBM EGA BIOS +diagnostics and run [Windows 1.01](/devices/pcx86/machine/5160/ega/640kb/win101/) in color. Check out our +[Windows 1.01 "Server Array"](/devices/pcx86/machine/5160/ega/640kb/array/) demo. + +[Windows 1.01 "Server Array" Demo](/blog/images/win101-array-demo.jpg) + +EGA support is added to a **machine.xml** file using two XML elements; eg: + +```xml +