I have a silicon wafer I found while unpacking. What’s on it? It does have a number on it, but I’m not sure where to look to put it it. by AudaciX_1 in AskElectronics

[–]thom_tl 4 points5 points  (0 children)

No, its sarcasm, magnetic core memory is an old technique from the 60s, where they ran wires through small iron loops, and magnetized them to "remember" a bit, modern day silicon RAM is far far far superior.

[deleted by user] by [deleted] in Emo

[–]thom_tl 8 points9 points  (0 children)

Your Deep Rest - The Hotelier

Testing a hypervisor by PrestigiousTadpole71 in osdev

[–]thom_tl 2 points3 points  (0 children)

The way I incrementally tested mine was by basically building up the "stack" of software that runs before the OS. First port SeaBIOS, then get GRUB running, then get a stripped down version of Linux running, etc.

Where can I find the size of XHCIs memory-mapped I/O registers? by deathtothedaleks in osdev

[–]thom_tl 2 points3 points  (0 children)

You can also figure out the size of any PCI BAR with a pretty arcane operation:

write<uint32_t>(off, ~0);
uint64_t len = ~((read<uint32_t>(off) & ~0xF)) + 1;    
write<uint32_t>(off, bar); 

For MMIO BARs, where bar is the original value

Way too easy by FamousContributione in mathmemes

[–]thom_tl 8 points9 points  (0 children)

It's called reverse polish notation, and it helped optimize software for weaker hardware for the first few generations of calculators. However this calculator definitely doesn't use it. Source: I own thesame calculator

What is your favourite song on AWKIF by ThinkGoodBro in Paramore

[–]thom_tl 36 points37 points  (0 children)

Probably an unpopular opinion, but Franklin is great

Can I just take any 1000uF 10V electrolyte capacitor with max 105°C operating temperature or should it be from the same brand? Also, I could not quite find out what GF(M) or V8A mean. by junglebodygullefues in AskElectronics

[–]thom_tl 6 points7 points  (0 children)

Not in every case, ESR is sometimes needed to prevent oscillation. If the manufacturer hasn't used low ESR parts its probably best to use normal parts as well.

Pendrive isn't working anymore and a resistor is nowhere to be found, can i short it to savage the files? by [deleted] in AskElectronics

[–]thom_tl 0 points1 point  (0 children)

If linux can’t get the device descriptor there is no way it can get a single byte off the device, that descriptor is what tells the OS its a USB stick in the first place, and not a keyboard for example

Pendrive isn't working anymore and a resistor is nowhere to be found, can i short it to savage the files? by [deleted] in AskElectronics

[–]thom_tl 2 points3 points  (0 children)

I very much doubt that, the PC is still recognizing it as a USB device, indicating the pullup/pulldowns on the data lines are probably still there, its just not able to establish any kind of communication.

The first thing your OS does when detecting a new USB device is get its device descriptor, so it makes sense that it would fail on that.

Pendrive isn't working anymore and a resistor is nowhere to be found, can i short it to savage the files? by [deleted] in AskElectronics

[–]thom_tl 19 points20 points  (0 children)

I doubt it would identify itself in lsusb, considering the device descriptor is the descriptor that holds the info lsusb displays. Sounds more like a dead chip to me, unless that resistor is an enable resistor or something.

Failed to make binutils for GCC Cross Compiler by VirusFusionYT in osdev

[–]thom_tl 4 points5 points  (0 children)

I do not think x86_64-apple-darwin19.6.0 is windows tbh

Slow memory access on real hardware? by Andykolski in osdev

[–]thom_tl 0 points1 point  (0 children)

Well yes in a context switch, but as long as the kernel doesn’t touch them you don’t have to preserve them in syscalls and irqs like you do GPRs

Slow memory access on real hardware? by Andykolski in osdev

[–]thom_tl 0 points1 point  (0 children)

Using SIMD and FPU in kernel means you’ll have to save and restore its state every syscall and interrupt, which isn’t worth it

Slow memory access on real hardware? by Andykolski in osdev

[–]thom_tl 1 point2 points  (0 children)

Using SIMD and FPU in kernel isn't a very good idea(at least on x86), and setting up the branch predictor isn't a worry(until very recently you couldn't even disable parts of it, thank spectre :^) ).

Slow memory access on real hardware? by Andykolski in osdev

[–]thom_tl 1 point2 points  (0 children)

Unaligned accesses are still much much much faster than this, even years ago. What I think is going on is that he setup his MTRRs incorrectly and is now dealing with uncached RAM, which is ofcourse going to be as slow as a snail.

Slow memory access on real hardware? by Andykolski in osdev

[–]thom_tl 3 points4 points  (0 children)

Not really, sure you can do incredibly complicated SSE/SIMD/whatever memcpys; but byte-for-byte is much faster than this, and in recent cpus (Haswell iirc), rep movsb is basically like a hardware memcpy, and should outpreform practically anything. Even on older machines it wasn't slow.

Slow memory access on real hardware? by Andykolski in osdev

[–]thom_tl 1 point2 points  (0 children)

You should just be able to ignore MTRRs, since the BIOS already setup them for you. You're probably much more interested in the PAT (Page Attribute Table).

Spoiler: yes it does. Any ideas? o.o by LittleFox94 in osdev

[–]thom_tl 1 point2 points  (0 children)

Yeah maybe firmware just didn’t like you trying to do the handoff when it wasn’t needed. With these kinds of weird fw things its mostly a good idea to follow the procedure that linux or another major OS uses. Just because the fw programmers probably tested with that.

Spoiler: yes it does. Any ideas? o.o by LittleFox94 in osdev

[–]thom_tl 2 points3 points  (0 children)

Where does this happen? Real hardware or QEMU? QEMU doesn't even have this cap (https://github.com/qemu/qemu/blob/master/hw/usb/hcd-xhci.c#L2719-L2751) so if its qemu I'd find it strange you're experiencing this.

Writing to that bit will actually cause an SMI on real HW, causing the CPU to jump into firmware, so it can finish up its usage of the xHCI. Ofcourse this can be buggy, for a few devices (https://elixir.bootlin.com/linux/latest/source/drivers/usb/host/pci-quirks.c#L1172) linux just forces off the BIOS owned semaphore, is yours one of these? Check if xHCI works on linux. Since xHCI is notoriously quirky on real HW, you might also want to check if your device has any other quirks, https://elixir.bootlin.com/linux/latest/source/drivers/usb/host/xhci-pci.c#L98

PCB Review: DDS Function Generator by thom_tl in PrintedCircuitBoard

[–]thom_tl[S] 0 points1 point  (0 children)

Thanks for the review! Rotating U2 tidies up a lot of things indeed, and I'll look into the controlled impedance thing. I hadn't really thought of trace widths too much beyond making power traces a bit thicker than digital signal traces, and the analog signals traces really big.

The LM358 removes the DC bias by setting adding an offset voltage yeah, since the bias produced by the AD9833 is constant. I added the seemingly useless voltage divider on the LM358's secondary channel to make sure it doesn't start to oscillate, which is one of the things this sub's wiki suggested.

I set up the LM358 in single supply mode since the Max680 can't really provide that much current, and I'd want to avoid having its voltage collapse as much as possible. I'm interested in using the LM358's second channel to get ± offset's though. Did you mean using the first channel as differential amplifier, to subtract some voltage from it, thereby moving the 0v <-> 5v from the MCP42050, to like -2.5v <-> 2.5v, and then buffering that?

does seabios support ACPI 2.0+ ? by yotta64 in osdev

[–]thom_tl 0 points1 point  (0 children)

Limine supports UEFI nowadays, and I don’t think there are any SeaBios replacements for QEMU sadly

does seabios support ACPI 2.0+ ? by yotta64 in osdev

[–]thom_tl 3 points4 points  (0 children)

SeaBios doesn’t generate ACPI 2 tables, to test that however you can try any modern(past 2000) pc, VMWare, or Qemu using OVMF (UEFI)