Better HN
topnewbestaskshowjobs
Log inSign up

theunamedguy

838 karma · joined Jun 30, 2014 (12y ago) · 104 submissions

Submissions

1.

Technicality(chiark.greenend.org.uk ↗)

12 points · by theunamedguy · 1y ago · discuss

comment 3y ago · link · parent

Porting complex applications (especially those written in C) from x86 to ARM can be pretty non-trivial.

I can't speak to the GIMP code in particular, but I've done several x86->ARM source ports of other complex software, and each time there are things which work on x86 and don't work on ARM, resulting in nasty crashes, or worse.

See here for one of those (not AArch64, but ARM nonetheless): https://news.ycombinator.com/item?id=22176285

comment 4y ago · link · parent

We live in an age where combining music, software, and signal processing can let you do some amazing things. I can imagine a high-fidelity simulation of this instrument's timbre before it's ever built, by using the mechanical CAD model to produce an acoustic model, and then modeling the response of the wood to an incident acoustic wave.

comment 4y ago · link · parent

Finally, something that I can speak to!

I once ported Quake 1 to the Rockbox operating system for MP3 players, which enabled it to run on the Apple iPod: https://www.youtube.com/watch?v=r6V-4AZ7pkA

The whole world of software ports basically boils down to "anything is possible, given enough memory, pixels, and time". The actual process of porting anything is sometimes incredibly tedious (e.g. "scour the entire source code for unaligned memory accesses, and manually rewrite all of them"), but also gives a chance to do some very clever things (like, "use the piezo speaker to beep out the address of a fault, because nothing else works on the device after a crash").

What made me do it was 1) the satisfaction I got from seeing my work produce something which, at first glance, shouldn't exist (Quake... on an MP3 player?), all while 2) learning deeply about software close to the bare metal, which is fairly hard to do early in one's career. There's of course also the factor of having lots of free time - I did my port when I was still a student with not very many responsibilities, so I could afford to spend entire evenings and weekends poring through mountains of C code. Nowadays, not so much...

comment 4y ago · link · parent

Finally, something that I can speak to!

I once ported Quake 1 to the Rockbox operating system for MP3 players, which enabled it to run on the Apple iPod: https://www.youtube.com/watch?v=r6V-4AZ7pkA

The whole world of software ports basically boils down to "anything is possible, given enough memory, pixels, and time". The actual process of porting anything is sometimes incredibly tedious (e.g. "scour the entire source code for unaligned memory accesses, and manually rewrite all of them"), but also gives a chance to do some very clever things (like, "use the piezo speaker to beep out the address of a fault, because nothing else works on the device after a crash").

What made me do it was 1) the satisfaction I got from seeing my work produce something which, at first glance, shouldn't exist (Quake... on an MP3 player?), all while 2) learning deeply about software close to the bare metal, which is fairly hard to do early in one's career. There's of course also the factor of having lots of free time - I did my port when I was still a student with not very many responsibilities, so I could afford to spend entire evenings and weekends poring through mountains of C code. Nowadays, not so much...

6.

Porting Quake to an iPod Classic Is No Easy Task(hackaday.com ↗)

1 points · by theunamedguy · 4y ago · discuss

comment 5y ago · link · parent

There is no way this could work. The EDA tool (e.g. KiCAD) is only the first step of the fabrication process - you generate Gerbers from your KiCAD board layout, which are a highly standardized format that can be viewed in a variety of independent pieces of software. There are also multiple stages of design validation - both in the design phase, and then in the physical phase of actually inspecting your fabricated boards. The chances of any "malicious" circuitry slipping in are next to nil.

comment 5y ago · link · parent

A big shoutout to Alyssa here. For those of you who don't know, she is doing this work as a college student.

comment 5y ago · link · parent

This runs on the clickwheel iPod nano, by the way: https://www.youtube.com/watch?v=OV8etSGH86M

comment 5y ago · link · parent

This is getting at the idea behind the Fourier transform. 3b1b did an excellent video with exactly this visualization:

https://www.youtube.com/watch?v=spUNpyF58BY

The idea is that wrapping a function around a circle at the right frequency (i.e. length per spiral) will cause peaks and troughs to align. It just happens here that the "right" frequency is 1/year.

comment 5y ago · link · parent

Not quite iOS, but: https://news.ycombinator.com/item?id=22162834

comment 6y ago · link · parent

The AGPTek Rocker is one of our last targets still in production and can be acquired for around $50. I haven't used one myself, but from what I hear it's fairly decent but not perfect.

comment 6y ago · link · parent

This reminds me of my port of Quake 1 to Rockbox (for MP3 players): https://news.ycombinator.com/item?id=22162834

comment 6y ago · link · parent

That's correct. I realize my parent comment was ambiguous. I'm the author of the port; the video is by a different developer who's since taken it down.

comment 6y ago · link · parent

I'll add in another fun anecdote while I'm at it.

There are virtually no good ways to debug code on-device with Rockbox, short of adding in a bunch of function calls to print variable values to the device's screen. This usual method, though slow, works surprisingly well with most bugs -- but this assumes that the code is in a sane enough state to be able to write to the screen properly (stack corruption, for example, would render it unusable).

There were a few bugs which were not debuggable with this "trace all the things" method, and those were the ones which required the most ingenuity. I remember having to root out a few bugs which absolutely trashed the processor state and made complex things (like function calls to print things) fail miserably.

One such class of bug was the unaligned read (this is ARM, remember). Thankfully, ARM has a way to set an "alignment trap" to trigger an interrupt when an invalid unaligned read happens. The only problem was that, of course, I couldn't figure out what code was responsible for the unaligned read.

My solution to this was quite the gem -- I modified the ARM exception handler to use the iPod's internal piezo buzzer to beep out the faulting PC address in a sequence of 32 high/low pitched beeps. The piezo, driven by a single memory-mapped register, could be controlled with minimal code (and most importantly, no function calls).

comment 6y ago · link · parent

Here: https://www.youtube.com/watch?v=r6V-4AZ7pkA

comment 6y ago · link · parent

Thanks!

Resolving that bug took quite a bit of serendipity. The break came when I was on the verge of giving up on the assembly rewrite and reverting back to C. I'd left my "frozen" iPod sitting around for a while. ~15 minutes later, I came back, and everything was back to normal -- this was evidence that I was not seeing a true lockup, but rather an extremely long delay (consistent with an integer wraparound).

comment 6y ago · link · parent

(Author of linked post.)

That video was recorded by another developer, who had some personal (non-legal) concerns with it and plans to reshoot.

comment 6y ago · link · parent

Author here. This is actually a fairly old project of mine by now, but I just recently submitted it to Hackaday, which is probably why it's surfaced here.

The original video demo has been taken down by the author (not me) due to some concerns of his, but he is reportedly planning to reshoot it soon.

In the meantime, though, a Duke3D demo (running on the same software stack) is available here: https://www.youtube.com/watch?v=OV8etSGH86M

EDIT: I've gotten a quick recording up: https://www.youtube.com/watch?v=r6V-4AZ7pkA (apologies for the mirrored video)

comment 6y ago · link · parent

Good idea! I'm not sure that's easily achievable with my current architecture, though.

21.

Show HN: An Online CNC Engraving Toolpath Generator(rastercarve.live ↗)

2 points · by theunamedguy · 6y ago · discuss

22.

Show HN: CNC Engraving Toolpath Generator(github.com ↗)

4 points · by theunamedguy · 6y ago · 2 comments

comment 6y ago · link · parent

+1 for the nit-pick. Hardware programming make me think of FPGA design and Verilog, etc. I'd call this 'embedded programming'.

comment 6y ago · link · parent

Excellent work! Clean C is underrated nowadays.

comment 7y ago · link · parent

I learned C and open-source through hacking on this. Fond memories!

PS: We have a Quake port - https://www.rockbox.org/wiki/PluginQuake :)

comment 7y ago · link · parent

I have a hard time believing this and can't find any details online. Source please?

comment 7y ago · link · parent

A charged particle moving at an angle to a magnetic field like that found at the ends of a solenoid (increasing field strength) would produce the desired motion.

Example: https://s3-us-west-2.amazonaws.com/courses-images/wp-content...

comment 7y ago · link · parent

I don't see why this is getting downvoted. It's a perfectly valid argument that's very much in the spirit of 3b1b.

comment 8y ago · link · parent

It's just a conversion factor to make the units come out nicely. He could have easily done T = 1/f to give the refresh interval in seconds, but with such a short duration, it helps to convert it to nanoseconds (1e9 ns = 1 s).

comment 8y ago · link · parent

Quick question: how does the electricity get from the train (in motion) to the grid? Using the rails as conductors could work, but I'm not sure how efficient that would be.
1234