HNHacker News
TopNewBestAskShowJobs

dezgeg

2,900 karma · joined August 7, 2013

[ my public key: https://keybase.io/dezgeg; my proof: https://keybase.io/dezgeg/sigs/T97m4HN4fIeKVsJzfbIsXEgnHunf6ut9z2hZbtMU3BM ]
submissionscomments
dezgeg··on How I Made a Heap Overflow in Curl
"Most" is a very heavy claim. Any concrete evidence of this?

Also in embedded Linux I guess we are technically "building from source", when using a build system like Buildroot or Yocto. But Rust is already supported there and in fact already in use in our project (due to python3-cryptography).

dezgeg··on Enabling IPv6 support for IPv4-only apps on Linux
Did you try just dup2()'ing a new socket file descriptor over the old socket file descriptor? Probably it bring other kinds of problems, but would be interesting to hear what they are.
dezgeg··on How could the early Unix OS comprise so few lines of code?
I'd guess that back then system call overhead was lower than with modern CPUs with deep pipelines, speculation and their vulnerability workarounds.
dezgeg··on RISC-V SBI and the full boot process
Nothing forces it to be in ROM. See for example https://github.com/carlosedp/riscv-bringup/blob/master/unlea... where DRAM init seems to be in the FSBL part which is loaded from the SD card.
dezgeg··on Unreal Engine 5.3
With compile_commands.json it's been possible for quite a while now.
dezgeg··on MS-DOS v1.25 and v2.0 is now open-source (2014)
I wonder how many of such drivers that would in reality only work when those two are called in succession
dezgeg··on EXPI by p01
It's expi.htm.br inside http://www.p01.org/expi/expi.zip
dezgeg··on Linux 6.5
Please use the official mailing list archive (lore.kernel.org). The others are much worse (and non-official).
dezgeg··on Linux on a Commodore 64
I think that was partially his point - on 6502, typical-looking C code will be horrifically inefficient, at least when compared to other architectures more suitable for C.

For 6502, to get the optimum assembly you'd have to structure your data in structure-of-arrays instead of arrays-of-structures and use indices instead of pointers as much as possible (at least when amount of Ball objects would be < 256).

dezgeg··on I only lost 10 minutes of data, thanks to ZFS
Whenever the filesystem is being snapshotted atomically, no. That would be effectively same state as from a power-cut at that exact moment.

It is correct though, that trying to do it with something like 'cp' on a live database will most likely be corrupt.

dezgeg··on Valgrind recieves a development microgrant from FUTO
How well does ASAN cope when the libraries your application uses aren't compiled with ASAN? Does it cause false negatives or false positives?
dezgeg··on Debian vs. Yocto for Embedded Systems
I've found yocto package availability quite good, although you may need to add some non-default meta layers. Do you have some examples of what packages and especially architectures Yocto is missing compared to debian?

Also I would be interested to hear how debian has advantages in cross-building; I thought they native-compile all of their packages. Is that really the case that in debian that you can modify some existing deb source package (eg. change configure flags or apply some patch) and cross compile that into a .deb, like you can in Yocto?

dezgeg··on Simply Parse in C
If you don't want to error/warn on invalid UTF-8 but instead handle it with the "garbage in, garbage out" principle, then yes you're right, treating them pure byte streams works.
dezgeg··on Simply Parse in C
Performance comparison of this code might not, however, as fgetc() based parsing is not efficient. (Each call takes a lock in the FILE object).
dezgeg··on Kraken Technologies: How we organise our large Python monolith
Hard disagree, splitting to multiple repos has a heavy cost; biggest of them the pain if you ever need to commit something to both repos at same time. Splitting the codebase to multiple repos shouldn't be done lightly.
dezgeg··on Nvidia just released FreeBSD Display Driver 535.86.05 (2023.7.18)
How would that make a difference?
dezgeg··on Ask HN: How to deal with 0.1X programmer colleagues?
Maybe you can do similar amount of feature/planned work as them then for the rest do off-the-record speeding up the compile times, or something else that could speed up the rest of the team.
dezgeg··on Strlcpy and strlcat added to glibc 2.38
It's not any slower in the typical case where destination buffer is large enough to fit the source thing. And if that's not the case then we are most likely in a error case (either caller notices the truncation and decides to abort, or ignores the truncation and things may soon go boom), and not many people care about optimizing error paths.

Furthermore, when coders dont't have strlcpy() the alternatives are often even worse than strlcpy(): 1) They use strcpy() and have buffer overflows. 2) They use strncpy() which is slower than strlcpy() in the common (non truncating) case, and in the truncating case leave the string unterminated (thus segfault potential) 3) They use snprintf(dst, len, "%s", src); which is strictly slower than strlcpy()

dezgeg··on Strlcpy and strlcat added to glibc 2.38
Not really, more that the implementation of sscanf() is stupid and calls strlen() even though implementing sscanf() that doesn't require that is perfectly possible.
dezgeg··on Strlcpy and strlcat added to glibc 2.38
I hope not, as entire reason he went there was to punish the bankers for their role in the 2008 financial crisis ;)

(https://www.reddit.com/r/linux/comments/zzhd9/comment/c69cam...)

dezgeg··on On Microchip AT86RF215 Radios for SDR
Interesting; they are pretty common here, although ofter paired with a passive antenna for 3g/4g, like this: https://mt-tech.fi/wp-content/uploads/2020/05/image.png.webp
dezgeg··on What's wrong with enterprise Linux
Could you point to some examples of such breakage?
dezgeg··on On Microchip AT86RF215 Radios for SDR
That's how modern 4G/5G base station equipment works; with the antenna panel and electronics in one unit.
dezgeg··on Ask HN: Stock Android phone free of bloatware?
Can relate, I've been very happy with my Moto G 5G Plus. No bloatware, and with its included rubber shell it even survived an one story fall without any damage.
dezgeg··on Putting out the hardware dumpster fire
> I'm not sure if you can use the hardware designed to act as a host to act as a device, but it wouldn't surprise me.

I don't how it is for PCIe, but for example USB is very asymmetric and host controllers generally cannot as devices. There do exist dual-mode IP cores (e.g. for mobile SoCs)

> In any case I would find it hard to believe that the hardware that can act as a device would cost significantly more.

Indeed the area/cost difference between host-only and dual mode controller may be small. But in a general purpose chip there will be dozens of other competiting features in all the other subsystems besides PCIe. Each of those small features would increase the chip cost, so they won't be added without a cost-benefit calculation. So it can still be that while PCIe device support would be cheap to add, it could still be considered too low bang-for-buck to be worth including. Or that there may be such chips supporting PCIe device mode, but they then also would include things like video encoding/decoding, HDMI, ethernet, etc. and thus be an expensive chip.

> The hardware required to do this can't be that expensive.

With a custom ASIC (the linked one seems to have Phison E12) that includes only the minimal needed hardware, yes.

dezgeg··on Putting out the hardware dumpster fire
These kind of high speed interfaces aren't just something that one just bitbangs on some microcontroller.

I think even the first step, ie. finding a RISC-V chip that has capability of acting as a PCIe device at all will be a challenge. "Inexpensive" for sure not.

dezgeg··on Putting out the hardware dumpster fire
No, they are not just a converter that exposes raw NAND to your PC. Rather they abstract away all the details of how painful raw NAND is to deal with into simple "read/write sectors" interface that all your normal filesystems like ext4, NTFS, etc. deal with.

Raw NAND comes with various pain-in-the-ass limitations such as: only erasable in huge (~megabytes) blocks at a time, only writable in slightly-uncomfortably-big chunks (like 32KB or so), and erasing a given region can be done a limited amount of times before it breaks. Oh, and all those details (like exact sizes of erases and writes) will change time to time as manufacturing processes of NAND dies get more advanced.

dezgeg··on Putting out the hardware dumpster fire
For starters, I doubt that acting as a NVMe device is something you can do with a off the self "inexpensive RISC-V" with any kind of acceptable performance. A NVME engine would almost certainly be something that the flash controller would have implemented in fixed function hardware.

Also NAND flash practically requires some sort of error correction system - another thing that fixed function logic in a custom ASIC is very well suited for. Using CPU time on the host CPU for that would probably suck.

dezgeg··on Having non-x86 machines makes your life harder
Well, it's worth noting that Linux backward compatibility is not absolute guarantee, but rather "if feature is removed in a forest and nobody is around to hear it, then it's not a backward compatibility break".

Eg. for instance the removal of a.out support: https://lwn.net/Articles/888741/ - the a.out support was almost removed, until a single user happened to notice and object. But then someone came up with a workaround and that single (known) remaining a.out user changed his code, and the a.out support was deleted.

dezgeg··on Having non-x86 machines makes your life harder
At least for 32-bit x86 I've run into such problems. The Intel Quark platform has such an old CPU core in it that normal Ubuntu binaries wouldn't work on it (even at the the platform was relevant), as it lacks conditional move instructions unlike any other non-museum piece x86.

Also Glibc drops support for old kernel versions time to time, so even statically linked stuff isn't safe when compiling modern stuff against really old kernels.

← PreviousPage 7 of 14Next →