News for hackers. Stuff that matters.

torusle

Nice Ai prompting, bro..

Might want to share your harness /s

Linux does not dragged down in performance by the thousands of virus and malware scanners.
Re:Arm AGI CPU on Tuesday March 24, 2026 @03:31PM (#47507846)
ARM riding the "everything is AI" train.

So sad.

Re:Hormuz Minesweeper – Are you tired of winning? on Sunday March 22, 2026 @08:36AM (#47476882)
Yea.. having fun with war..

Most American post I have seen here since ages.

Re:Building a TB-303 from Scratch on Wednesday March 11, 2026 @06:35AM (#47333858)
The fun thing was the Roland Sync. You could sync up all the TB-303, TB-909 and all the others with a 5-pole DIN cable. The sync was badly implemented. It lagged, it had latency.

However!

As soon as you cabled all together their imperfections added up and they started to groove like nothing that has been heard before.

Re:Can Ozempic Cure Addiction? on Monday February 09, 2026 @10:12AM (#46946071)
Easy, it is dopamine.
Back then Microsoft was lobbying as hard as they could to turn that decision to move to linux over.

They knew: If Linux makes it in Munich, it will likely spread over and they loose tons of contracts with other German states.

Re:Functional Quadtrees on Thursday December 04, 2025 @09:24AM (#46147976)
"I could only find a couple tutorials/guides and both were imperative"

Aren't Quadtrees covered by almost all basic data-structure books? It is the most simple form of taking the binary tree into the next (2D) dimension.

Re:The Last PCB You'll Ever Buy [video] on Saturday November 01, 2025 @12:42AM (#45779305)
this

For those who don't know: Vias are not only used to get an electrical connection from one side of the PCB to another.

You also need them to keep radiation in check and often to move heat away.

With this technique, good luck getting through EMC testing for anything but trivial circuits.

Honestly,

this is really bad. It might be a breakthrough of what you are doing, but when I listen to the output all of the timing and phrasing is aweful.

Re:Reciprocal Approximation with 1 Subtraction on Tuesday December 31, 2024 @08:49AM (#42558690)
There are couple of tricks you can do if you fiddle with the bits of a floating point value using integer arithmetic and binary logic.

That was a thing back in the 90th..

I wonder how hard the performance hit from moving values between integer and float pipeline is nowadays.

Last time I looked into that was the Cortex-A8 (first I-Phone area). Doing that kind of trick costed around 26 cycles (back and forth) due to pipeline stalls back then.

Re:Show HN: A1 – Faster, Dynamic, More Reliable NFC Transactions on Wednesday September 11, 2024 @03:11PM (#41514420)
> 1. Apple having just announced it is opening up NFC > to developers means that both major mobile > platforms can now act as responding devices;

> 2. Mobile consumer hardware is sufficiently fast for the application > operations (eg. Cryptographic operations)

You are right here. It is possible to emulate a card using mobile phones. We've been able to shim/emulate any card for much longer.

The thing is: To connect to the payment system you need a certificate. And you simply don't get it unless you can prove that you have all kinds of security measures applied.

For android and apple, the actual payment stuff runs inside a isolated little micro-controller which has been certified and is temper proof/protected. This little thing is fortified so far that it will destruct itself when you try to open it up. There are alarm meshes, light sensors and much more inside the chip to detect any intrusion just to protect the certificate.

If you don't have that security, the payment providers will deny you their certificate, plain and simple.

You can build your own thing using card emulation via apps, but you will take all the risks.

How it works in practice is the following: These temper proof micro-controllers can run java-card code. You can write an applet for them, get it installed (if you have the key from apple/google - not easy). Then install it and you have a two-way communication: Your applet inside the secure world communicating with the payment world, and your ordinary mobile app showing things on the screen.

Re:Show HN: A1 – Faster, Dynamic, More Reliable NFC Transactions on Wednesday September 11, 2024 @05:58AM (#41509798)
I've worked in the payment industry and among other things built a payment terminal, so I know a thing or two about it.

1st: The message overhead during communication is not an issue. It is tiny compared to the time it takes for the credit card to do it's crypto thing.

2nd: This won't be adapted ever. There is simply way to much working infrastructure out there build on the APDU protocol. And there are so many companies and stakeholders involved that doing any change will take years. If they start aligning on a change, it would be something that makes a difference, not something that safes time in the order of 5 to 20 milliseconds. per payment.

Re:A good day to trie-hard: saving compute 1% at a time on Tuesday September 10, 2024 @07:19PM (#41506633)
Or as simple as using the hardware accelerated CRC32 that we have in our x86 CPUs.

Last time I checked, CRC32 worked surprisingly well as a hash.

Re:Weird things I learned while writing an x86 emulator on Wednesday July 10, 2024 @05:00PM (#40931425)
Another bonus quirk, from the 486 and Pentium area..

BSWAP EAX converts from little endian to big endian and vice versa. It was a 32 bit instruction to begin with.

However, we have the 0x66 prefix that switches between 16 and 32 bit mode. If you apply that to BSWAP EAX undefined funky things happen.

On some CPU architectures (Intel vs. AMD) the prefix was just ignored. On others it did something that I call an "inner swap". E.g. in your four bytes that are stored in EAX byte 1 and 2 are swapped.

  0x11223344 became 0x11332244.
Re:Own Constant Folder in C/C++ on Saturday June 22, 2024 @10:40AM (#40759441)
Nah, it is not that bad.

Sure you can mess up your performance by picking bad compiler options, but most of the time you are fine with just default optimizations enabled and let it do it's thing. No need to understand the black magic behind it.

This is only really necessary if you want to squeeze the last bit of performance out of a piece of code. And honestly, how often dies this occur in day to day coding unless you write a video or audio codec?

Correct.

And every graphic programmer worth it's salt had a copy of "Computer Graphics - Principles and Practice" on the desk and followed whatever came out of the "Graphics Gems" series.

We knew about BSP, Octrees and all that stuff. It was common knowledge.

Re:Blazingly fast linked lists on Tuesday May 14, 2024 @05:36PM (#40360432)
In embedded, you often need message queues.

A common way to implement these is to have an array of messages, sized for the worst case scenario and use this as the message pool.

You keep the unused messages in a single linked "free-list", and keep the used messages in a double linked queue or fifo structure.

That way you get O(1) allocation, de-allocation, enqueue and dequeue operations for your message queue.

Another example for this paradigm are job queues. You might have several actuators or sensors connected to a single interface and want to talk to them. The high level "business" logic enqueues such jobs and an interrupt driven logic works on these jobs in the background, aka interrupts.

And because you only move some pointers around for each of these operations it is perfectly fine to do so in interrupt handlers.

What you really want to avoid is to move kilobytes of data around. That quickly leads to missing other interrupts in time.

Re:Blazingly fast linked lists on Tuesday May 14, 2024 @12:58PM (#40357310)
> Linked lists are taught as fundamental data structures in programming courses, but they are more commonly encountered in tech interviews than in real-world projects.

I beg to disagree.

In kernels, drivers, and embedded systems they are very common.

Re:The Myth of Loss: Bitboys on Monday May 13, 2024 @02:31PM (#40346624)
Hardware existed.

Around 2006 I had some automotive entertainment system from NEC on my table which had one of the Bitboys GPU chips on it. Wrote some vector graphics API for it.

It wasn't bad honestly. It supported OpenGL/ES 1.0 I only had to contact them twice for driver bugs. They resolved that within a few days.

I want this as a paint pigment please...
Re:The Netwide Assembler (NASM) on Thursday November 09, 2023 @08:41AM (#38204835)
I wrote thousands lines of assembler for NASM. It was such a nice update to the good old turbo assembler back in the 90th.
Re:MS-DOS v1.25 and v2.0 is now open-source on Wednesday September 06, 2023 @05:59PM (#37411976)
It wasn't that bad. You had different memory models back then. If you wanted to keep things easy you just compiled for a memory model in which each pointer was either 16 bit (for code/data smaller than 64kb) or a memory model with far pointers (access to all the memory).

There have been mixed memory models and you could go crazy with near and far to break out of the limits of the easy memory models.

Most of the time it was just a mater of picking a suitable memory model for your code and forget about near/far though. Not so different than today.

Re:MS-DOS v1.25 and v2.0 is now open-source on Wednesday September 06, 2023 @05:49PM (#37411855)
Oh, nice..

I browsed a little through the code, and found that sort.com used self-modified to change the sorting order:

  ; note! jae is patched to a jbe if file is to be sorted in reverse!
  ;
  CODE_PATCH LABEL BYTE
         JAE     INNER_SORT_LOOP

I committed similar crimes in the 90th as well, but that was just me as a teenager programming stupid games in asm for fun and giggles. Not for commercial software.
Re:GCC always assumes aligned pointer accesses on Sunday August 20, 2023 @03:34PM (#37202256)
> If you're dealing with very simple CPUs like the > ARM M0, sure. But even the M3/M4 allows unaligned > access.

On ARM M3/M4 you have the same issue with LDRD and STRD instructions which do not allow unaligned access. Even the normal load/stores don't allow unaligned access in all cases. Try this in the peripheral memory region for starters. And things get even more complicated when the memory protection unit shakes up things.