News for hackers. Stuff that matters.
Re:Show HN: My x86 emulator written in JavaScript by JoshTriplett on Thursday October 17, 2013 @05:42PM (#6568327)
Very impressive.

Interesting bug: I can't seem to type '-', '=', '+', or '_' into the Linux image. Missing '-' in particular makes it hard to run commands with options.

Elaborate workaround:

    /root% eval eq$(dmesg | grep 'e820 update' | sed 's/.*) \(.\).*/\1\1/')
    /root% echo $eq
    =
    /root% eval dash$eq$(uname bad 2>&1 | grep Usage: | sed 's/.*\[\(.\).*/\1/')
    /root% echo $dash
    -
    /root% uname ${dash}a
    Linux (none) 2.6.34.14 #44 Tue Oct 15 20:50:15 CEST 2013 i586 GNU/Linux 
The first command grabs an '=' from dmesg and sets "eq" to it (without typing '='), and then the second command grabs a '-' from the usage message of uname and sets "dash" to that (without typing '-'). The last shows how to use ${dash} in a command.
Re:Show HN: My x86 emulator written in JavaScript by Sheepshow on Thursday October 17, 2013 @05:55PM (#6568407)
This is the most soul-crushing category of bug, the kind which keeps me up all night, drinking.

Build a skyscraper, and lock the keys inside for the ribbon cutting. Sorry pal you lost your funding

Land on Mars, see an alien, but your camera is out of batteries and everybody back on Earth thinks you're a quack.

Successfully perform open-heart surgery on a desert island, but muck up the stitches and cause a scar. Your patient will hold it against you the rest of his life (which you saved).

Re:Show HN: My x86 emulator written in JavaScript by shurcooL on Thursday October 17, 2013 @07:42PM (#6568904)
Luckily, he was able to come up with a workaround.

Here's a soul-crushing situation that doesn't have a workaround, as far as I can tell.

You can play the original Deus Ex on OnLive. By default, it sets the fov to a very low number. It's only possible to change it in the console (there is no UI for it). But the console is disabled. However, you can get around that by pressing T, which creates a mini console with "say " prepoulated. Press delete to erase say, and type "fov 90". So close...

But they disabled the Enter key from working.

So you can get full access to the console, type the command that would fix the FOV, but you're unable to execute it because Enter key does not get sent to the game. You're completely helpless.

Re:Show HN: My x86 emulator written in JavaScript by a1369209993 on Friday October 18, 2013 @05:07AM (#6570430)
OnLive runs on OSX. gdb (i think) also runs on OSX. It should be possible to isolate the callback used to handle keyboard input and call it with c=10. This would take anywhere from hours to weeks of debugging though.
Re:Show HN: My x86 emulator written in JavaScript by shurcooL on Friday October 18, 2013 @07:18PM (#6574587)
No, that won't work. Nothing you do client-side will help.

OnLive Client <-all input is transmitted-> OnLive Servers <-filter out Enter-> Deus Ex instance in a VM.

The enter key is filtered out on their servers. Unless you hack into their servers and change that, there is nothing you can do on the client-side. That's what makes you completely helpless.

Re:Show HN: My x86 emulator written in JavaScript by a1369209993 on Saturday October 19, 2013 @06:23PM (#6578156)
Ah, my apologies, I thought the game was running locally. (This sort of assholeness on the part of servers is basically why 'cloud computing' is such a bad idea.)
Re:Show HN: My x86 emulator written in JavaScript by shurcooL on Monday October 21, 2013 @01:59AM (#6583628)
I disagree that cloud computing is a bad idea because of this. It has advantages and disadvantages. Not being able to hack around to make changes you wish is a disadvantage, but having access to something you would not have otherwise is a much bigger advantage.
Re:Show HN: My x86 emulator written in JavaScript by to3m on Thursday October 17, 2013 @06:20PM (#6568551)
The soul-crushing bugs are the ones where you run a program, and nothing actually goes actively wrong, but the program overall just doesn't behave quite like it does on the real hardware.

Simple defects where a key is being ignored on certain systems are usually quite easy to fix ;)

Re:Show HN: My x86 emulator written in JavaScript by j1vms on Friday October 18, 2013 @10:15AM (#6571455)
Whoosh
Re:Show HN: My x86 emulator written in JavaScript by to3m on Friday October 18, 2013 @03:21PM (#6573450)
Would you like me to explain my response more clearly? :)
Re:Show HN: My x86 emulator written in JavaScript by g3 on Thursday October 17, 2013 @05:59PM (#6568431)
I've found the bug. For now, try Chromium. I'll fix this tomorrow.
Re:Show HN: My x86 emulator written in JavaScript by JoshTriplett on Thursday October 17, 2013 @06:08PM (#6568485)
Thanks! What was the bug? I'd be interested.

Also, any plans to implement GPF handling? I tried booting a test environment I have on it (which runs Python as part of the GRUB2 bootloader), but it failed primarily due to lack of support for trapping GPFs. (There are a few other issues I'd have to work around to make it work, but that's a major one that I can't easily work around.)

Re:Show HN: My x86 emulator written in JavaScript by g3 on Thursday October 17, 2013 @06:18PM (#6568543)
Chromium and Firefox send different key codes for `-` and `=` (see http://unixpapa.com/js/testkey.html).

Regarding GPFs: This is one of the few things that are not completely implemented yet, I'm working on figuring this out.

Re:Show HN: My x86 emulator written in JavaScript by laumars on Friday October 18, 2013 @04:43AM (#6570386)
You could just use octal escape sequences in printf:

    printf '\055'
returns

    -
Just change 055 for 075 (=), 053 (+) or 137 (_).

eg your $eq code can be written like this:

    eval eq$(printf '\075\075')
Re:Show HN: My x86 emulator written in JavaScript by JoshTriplett on Friday October 18, 2013 @12:15PM (#6572154)
Good thinking; that is much simpler.
Re:Show HN: My x86 emulator written in JavaScript by femto on Thursday October 17, 2013 @06:32PM (#6568615)
I found that bug too. First thing I did was think, "a system restore is a page refresh away and I've always wanted to test the effects of this", then I attempted to type "rm -r /*".
Re:Show HN: My x86 emulator written in JavaScript by valleyer on Friday October 18, 2013 @03:05AM (#6570166)
Not `dd if=/dev/random of=/dev/kmem` ?
Re:Show HN: My x86 emulator written in JavaScript by darkstalker on Friday October 18, 2013 @11:52AM (#6572031)
I can't type "/" or "\" and all the shift-<number> keys combinations are wrong. I'm using an ES layout keyboard on Firefox.
Re:Show HN: My x86 emulator written in JavaScript by Aardwolf on Friday October 18, 2013 @07:38AM (#6570814)
I can type -, +, = and _ from the alpha area of the keyboard, but none of the keys of the numpad works (not even the numbers)