Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rep_lodsb
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
61.
▲
by
rep_lodsb
7mo ago
The scenario was about the first fusion (hydrogen) bomb test causing a runaway "ignition" of the atmosphere. It was never considered likely, but they still did the math to make certain it couldn't happen.
62.
▲
by
rep_lodsb
8mo ago
Why is that surprising? The trap into kernel mode alone would already take more cycles than dedicated hardware needs for the full page table walk.
63.
▲
by
rep_lodsb
8mo ago
In TempleOS, everything runs in ring 0, but that's not the same as doing protection in software (which would require disallowing any native code not produced by some trusted translator). It simply means there's no protection at al
64.
▲
by
rep_lodsb
8mo ago
That's because CS in real/V86 mode is actually a writable data segment. Most protection checks work exactly the same in any mode, but the "is this a code segment?" check is only done when CS is loaded in protected mode
65.
▲
by
rep_lodsb
8mo ago
Thanks for trying to educate the young whippersnappers about hard drives, but a lot of this rambling seems entirely off-topic. >Unless you can manually set CHS in BIOS to match, which a USB adapter won't let you do anything you want
66.
▲
by
rep_lodsb
8mo ago
Supposedly the problem is that these adapters only work with LBA, which wasn't supported by every drive in the very early days of IDE. But maybe some of these cheap adapters do in fact work with CHS, or that specific 40 MB drive with L
67.
▲
by
rep_lodsb
8mo ago
Seems to me from reading the deleted text file[1] like the author[2] used an LLM to get feedback on how to improve their own code. That isn't at all what "vibe-coding" usually means, and I say that as a complete AI hater myse
68.
▲
by
rep_lodsb
8mo ago
This has nothing to do with this project. It's an adapter for connecting (very) old hard drives which only support CHS to a modern computer via USB, so that you can copy the data off them.
69.
▲
by
rep_lodsb
8mo ago
Yes, looking at the source code on GitHub now cleared that up! Didn't see it mentioned in the article though, maybe I missed it. If not, I think that this detail would be a good thing to include, both since it's a common mistake t
70.
▲
by
rep_lodsb
8mo ago
It makes no difference whether they're signed or unsigned. Unless the subtraction is checking for overflow, or using a wider integer type than the numbers being compared, the high bit will not in every case indicate which number is sma
71.
▲
by
rep_lodsb
8mo ago
const diff = if (order == .asc) b_int - a_int else a_int - b_int; const sign_bit: u1 = @truncate(@as(UWInt, @bitCast(diff)) >> @intCast(bits)); var mask_word = @as(usize, 0) -% @as(usize, sign_bit); This code in the
72.
▲
by
rep_lodsb
8mo ago
But is the "proper UNIX way" a good thing? Funny that you would be arguing for that (unless I misunderstood the intention), given your many other posts about how C is a horrible broken unsafe language that should not be used by an
73.
▲
by
rep_lodsb
8mo ago
With the WWW, from here on out and especially in multimedia WWW applications, frames are your friend. Use them always. Get good at framing. That is wisdom from Gary. The problem most website designer have is that they do not recognize that
74.
▲
by
rep_lodsb
8mo ago
The better analogy would be https://en.wikipedia.org/wiki/Project_Stargate "If there's a chance psychic powers are real..."
75.
▲
by
rep_lodsb
8mo ago
I know Turbo Pascal produces really bad code (even in later versions), but it's not on the same level as a non-optimized Forth. Function prologue on x86 doesn't have much overhead either. It's somewhat closer for 8-bit proces
76.
▲
by
rep_lodsb
8mo ago
Forth generated code is basically a long series of "assembler macros", always doing the same maximally-generic thing for each primitive operation. Even a very simple-minded compiler of the 1980s could already beat that. VAR
77.
▲
by
rep_lodsb
8mo ago
Yes, the 80287 and 387 used some I/O port addresses reserved by Intel to transfer the opcode, and a "DMA controller" like interface on the main processor for reading/writing operands, using the COREQ/COACK pins. Ins
78.
▲
by
rep_lodsb
8mo ago
Nitpick (footnote 3): "64-bit kernels can run 32-bit userspace processes, but 64-bit and 32-bit code can’t be mixed in the same process. ↩" That isn't true on any operating system I'm aware of. If both modes are supporte
79.
▲
by
rep_lodsb
8mo ago
The low 8 bits of SI, DI, BP and SP weren't accessible before, but now they are in 64-bit mode. The earliest ancestor of x86 was the CPU of the Datapoint 2200 terminal, implemented originally as a board of TTL logic chips and then by I
80.
▲
by
rep_lodsb
8mo ago
So you can have bit arrays of any length in memory, rather than just 32 bits in a register.
81.
▲
by
rep_lodsb
8mo ago
There are separate opcodes for shift/rotate by 1, by CL, or by an immediate operand. Those are decoded to separate microcode entry points, so they could have at least optimized the "RCL/RCR x,1" case. And the microcode f
82.
▲
by
rep_lodsb
8mo ago
Implementing rotate through carry like that was a really bad decision IMO - it's almost never by more than one bit left or right at a time, and this could be done much more efficiently than with the constant-time code which is only fas
83.
▲
by
rep_lodsb
8mo ago
RAMAC, not RAMDAC: https://en.wikipedia.org/wiki/History_of_IBM_magnetic_disk_d... However it doesn't seem to be divided into sectors at all, more like each track is like a loop of magnetic tape. In that context i
84.
▲
by
rep_lodsb
8mo ago
This is about DOS 1, which in fact didn't have subdirectories.
85.
▲
by
rep_lodsb
9mo ago
The 80186 and NEC Vxx chips - and of course also the 286 - could already do mul/div in one cycle per bit (+ some overhead for the microcode). What they didn't have was the early-out optimization. The three-operand form of IMUL als
86.
▲
by
rep_lodsb
9mo ago
But were the software people actually right , or did they just follow the well-trodden path of VMS / UNIX, instead of making full use of the x86 hardware? Having separate segments for every object is problematic because of pointer siz
87.
▲
by
rep_lodsb
9mo ago
As long as it's a linear address space, adding/subtracting a large enough value to a pointer (array, stack) could still cross into another "segment".
88.
▲
by
rep_lodsb
9mo ago
That just describes using conversion routines for data, after loading and before storing to some standardized on-disk / network format.
89.
▲
by
rep_lodsb
9mo ago
It's still one more thing you need to keep in mind when writing code, at least in languages that don't have a separate data type for different-endian fields.
90.
▲
by
rep_lodsb
9mo ago
!tfel-ot-thgir eb dluow ,redro dleif sa llew sa ,sgnirts lla neht tuB It could be argued that little endian is the more natural way to write numbers anyway, for both humans and computers. The positional numbering system came to the West via
More ›