frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

NetBSD 10.x Kernel Math_emulation

https://mezzantrop.wordpress.com/2025/02/04/netbsd-10-x-kernel-math_emulation/
50•jaypatelani•23h ago

Comments

__s•15h ago
This sort of platform support is cool, but it's a sign when existing hardware is failing & the platform support is shown with emulation

If uou run ancient hardware, use ancient software. Preservation efforts in keeping an image of that ancient software available makes sense (which becomes harder as modern build systems pull from network to build)

boricj•13h ago
Sometimes it's useful to be able to run modern software on ancient hardware.

I once made an image of a hard disk so old it wouldn't work on anything newer than a Pentium. I plugged in a USB PCI card+USB stick and booted a modern-ish at the time Debian Live CD.

It took over 5 minutes to decompress just the kernel and a hour to copy the HDD to the USB stick, but it did work. The time delta between the oldest and newest component on that system was well over 20 years, sometimes this is what you have to do with what you have on hand.

jmclnx•12h ago
I saw this a few days ago, nice, especially since Linux is dropping support for older hardware. Even OpenBSD is slowly limiting i386 (32bit) support:

https://www.openbsd.org/i386.html

NetBSD so far has no plans to drop 32bit x86 support, and it is always nice to be able to run a modern UN*X on older hardware. IIRC, porting NetBSD to a new platform is quite easy when compared to other systems. This is due to how their HAL (hardware abstraction layer) is designed.

Today I saw in the OpenBSD @misc mailing list one of the issues they are having with i386 is rust is too large for them to compile on a i386 system. That means software packages that need rust are being removed from their packages.

This does not affect NetBSD because they allow cross-compiling of everything on their systems.

anthk•7h ago
OpenBSD runs perfectly fine under i386, atom user there.

I don't care about Rust and it's killer app Firefox, there are tons of alternatives for i686. From Luakit to Vimb.

johnklos•6h ago
Compiling rust on a 32 bit system is a several year old issue. Enough of us made a fuss about it that the rust build system was fixed enough that this became possible again.

If rust doesn't compile on an i386 system with 4 gigs of memory, then that's very odd. I don't know much about rust, but I was still able to get it to compile for earmv6hf on a Raspberry Pi 3 with 1 gig of RAM. Perhaps the OpenBSD people need to try some of the things we've already figured out.

https://mail-index.netbsd.org/tech-pkg/2025/05/09/msg031137....

anthk•3h ago
On math FP emulation, by looking up the code it seems pretty close to the code from Robert F. Illyes for Forth 83.

Forth implementation in Eforth it's like this:

    ( FORTH-83 FLOATING POINT.
      ----------------------------------
      COPYRIGHT 1985 BY ROBERT F. ILLYES
            PO BOX 2516, STA. A
            CHAMPAIGN, IL 61820
            PHONE: 217/826-2734  )     HEX
    : ZERO  OVER 0= IF DROP 0 THEN ;
    : FNEGATE 8000 XOR ZERO ;
    : FABS  7FFF AND ;
    : NORM  >R 2DUP OR
            IF BEGIN DUP 0< NOT
               WHILE D2* R> 1- >R
               REPEAT SWAP 0< - ?DUP
               IF R> ELSE 8000 R> 1+ THEN
            ELSE R> DROP THEN ;
    : F2*   1+ ZERO ;
    : F*    ROT + 4000 - >R UM* R> NORM ;
    : FSQ   2DUP F* ;
    : F2/   1- ZERO ;
    : UM/   DUP >R UM/MOD SWAP R>
            OVER 2* 1+ U< SWAP 0< OR - ;
    : F/    ROT SWAP - 4000 + >R
            0 ROT ROT 2DUP U<
            IF   UM/ R> ZERO
            ELSE >R D2/ FABS R> UM/ R> 1+
            THEN ;
    : ALIGN 20 MIN 0 DO D2/ LOOP ;
    : RALIGN 1- ?DUP IF ALIGN THEN
            1 0 D+ D2/ ;
    : FSIGN FABS OVER 0< IF >R DNEGATE R>
            8000 OR THEN ;
    : F+    ROT 2DUP >R >R FABS SWAP FABS -
            DUP IF DUP 0<
                    IF   ROT SWAP  NEGATE
                         R> R> SWAP >R >R
                    THEN 0 SWAP RALIGN
            THEN SWAP 0 R> R@ XOR 0<
            IF   R@ 0< IF 2SWAP THEN D-
                 R> FSIGN ROT SWAP NORM
            ELSE D+ IF 1+ 2/ 8000 OR R> 1+
                    ELSE R> THEN THEN ;
    : F-    FNEGATE F+ ;
    : F<    F- 0< SWAP DROP ;
    ( FLOATING POINT INPUT/OUTPUT ) DECIMAL
    CREATE PL 3 , HERE  ,001 , ,   ,010 , ,
              ,100 , ,            1,000 , ,
            10,000 , ,          100,000 , ,
         1,000,000 , ,       10,000,000 , ,
       100,000,000 , ,    1,000,000,000 , ,
    : TENS  2* 2* LITERAL + 2@ ;     HEX
    : PLACES PL ! ;
    : SHIFTS FABS 4010 - DUP 0< NOT
            ABORT" TOO BIG" NEGATE ;
    : F#    >R PL @ TENS DROP UM* R> SHIFTS
            RALIGN PL @ ?DUP IF 0 DO # LOOP
            ". HOLD THEN #S ROT SIGN ;
    : TUCK  SWAP OVER ;
    : F.    TUCK <# F# #> TYPE SPACE ;
    : DFLOAT 4020 FSIGN NORM ;
    : F     DFLOAT POINT TENS DFLOAT F/ ;
    : FCONSTANT F 2CONSTANT ;
    : FLOAT DUP 0< DFLOAT ;
    : -+    DROP SWAP 0< IF NEGATE THEN ;
    : FIX   TUCK 0 SWAP SHIFTS RALIGN -+ ;
    : INT   TUCK 0 SWAP SHIFTS  ALIGN -+ ;
    1.      FCONSTANT ONE DECIMAL
    34.6680 FCONSTANT X1
    -57828. FCONSTANT X2
    2001.18 FCONSTANT X3
    1.4427  FCONSTANT X4
    : EXP   2DUP INT DUP >R FLOAT F-
            F2* X2 2OVER FSQ X3 F+ F/
            2OVER F2/ F-     X1 F+ F/
            ONE F+ FSQ R> + ;
    : FEXP  X4 F* EXP ;
    : GET   BL WORD DUP 1+ C@ "- = TUCK -
            0 0 ROT CONVERT DROP -+ ;
    : E     F GET >R R@ ABS 13301 4004 */MOD
            >R FLOAT 4004 FLOAT F/ EXP R> +
            R> 0< IF F/ ELSE F* THEN ;
    : E.    TUCK FABS 16384 TUCK -
            4004 13301 */MOD >R
            FLOAT 4004 FLOAT F/ EXP F*
            2DUP ONE F<
            IF 10 FLOAT F* R> 1- >R THEN
            <# R@ ABS 0 #S R> SIGN 2DROP
            "E HOLD F# #>     TYPE SPACE ;
the float abs function it's literally the same, operating over the same bits.

On the lack of floating point on some arch, Forth itself (even ANS Forth) encourages you to follow a fixed point philosophy unless it's absolutely neccesary, because you can always scale up the magnitudes on big 32 bit machines.

And Pi can be prise enough by using scaling with 'double' (for 16 bit machines) numbers:

100.000 355 113 m*/ d. 314159 ok

Plain Vanilla Web

https://plainvanillaweb.com/index.html
658•andrewrn•8h ago•347 comments

Car companies are in a billion-dollar software war

https://insideevs.com/features/759153/car-companies-software-companies/
194•rntn•7h ago•328 comments

Why Bell Labs Worked

https://1517.substack.com/p/why-bell-labs-worked
81•areoform•4h ago•49 comments

Scraperr – A Self Hosted Webscraper

https://github.com/jaypyles/Scraperr
98•jpyles•7h ago•35 comments

High-school shop students attract skilled-trades job offers

https://www.wsj.com/lifestyle/careers/skilled-trades-high-school-recruitment-fd9f8257
128•lxm•9h ago•200 comments

LSP client in Clojure in 200 lines of code

https://vlaaad.github.io/lsp-client-in-200-lines-of-code
98•vlaaad•7h ago•7 comments

Burrito Now, Pay Later

https://enterprisevalue.substack.com/p/burrito-now-pay-later
90•gwintrob•5h ago•135 comments

Title of work deciphered in sealed Herculaneum scroll via digital unwrapping

https://www.finebooksmagazine.com/fine-books-news/title-work-deciphered-sealed-herculaneum-scroll-digital-unwrapping
176•namanyayg•11h ago•76 comments

I hacked my clock to control my focus

https://www.paepper.com/blog/posts/how-i-hacked-my-clock-to-control-my-focus.md/
13•rcarmo•2h ago•1 comments

Writing an LLM from scratch, part 13 – attention heads are dumb

https://www.gilesthomas.com/2025/05/llm-from-scratch-13-taking-stock-part-1-attention-heads-are-dumb
198•gpjt•3d ago•29 comments

Monitoring my Minecraft server with OpenTelemetry and Prometheus

https://www.dash0.com/blog/monitoring-minecraft-with-opentelemetry
42•mmanciop•3d ago•3 comments

Avoiding AI is hard – but our freedom to opt out must be protected

https://theconversation.com/avoiding-ai-is-hard-but-our-freedom-to-opt-out-must-be-protected-255873
27•gnabgib•1h ago•14 comments

An online exhibition of pretty software bugs

https://glitchgallery.org/
62•tobr•8h ago•1 comments

One-Click RCE in Asus's Preinstalled Driver Software

https://mrbruh.com/asusdriverhub/
417•MrBruh•20h ago•198 comments

The most valuable commodity in the world is friction

https://kyla.substack.com/p/the-most-valuable-commodity-in-the
164•walterbell•2d ago•75 comments

I built a native Windows Todo app in pure C (278 KB, no frameworks)

https://github.com/Efeckc17/simple-todo-c
267•toxi360•9h ago•145 comments

ToyDB rewritten: a distributed SQL database in Rust, for education

https://github.com/erikgrinaker/toydb
27•erikgrinaker•5h ago•2 comments

Ink and Algorithms: Techniques, tools and the craft of pen plotting

https://penplotter.art/
51•selvan•3d ago•4 comments

Leaving Google

https://www.airs.com/blog/archives/670
438•todsacerdoti•22h ago•273 comments

Absolute Zero Reasoner

https://andrewzh112.github.io/absolute-zero-reasoner/
8•jonbaer•3d ago•1 comments

Synder (YC S21) Is Hiring

https://www.ycombinator.com/companies/synder/jobs/2Wnbc1f-business-development-representative
1•michaelastreiko•8h ago

The Epochalypse Project

https://epochalypse-project.org/
164•maxeda•15h ago•73 comments

SDFs and the Fast sweeping algorithm in Jax

https://rohangautam.github.io/blog/fast_sweeping/fastsweeping/
18•beansbeansbeans•3d ago•3 comments

Why not object capability languages?

https://blog.plan99.net/why-not-capability-languages-a8e6cbdf9682
55•mike_hearn•6h ago•20 comments

Gonzalo Guerrero

https://en.wikipedia.org/wiki/Gonzalo_Guerrero
80•akkartik•10h ago•23 comments

Klarna changes its AI tune and again recruits humans for customer service

https://www.customerexperiencedive.com/news/klarna-reinvests-human-talent-customer-service-AI-chatbot/747586/
192•elsewhen•7h ago•82 comments

Lazarus Release 4.0

https://forum.lazarus.freepascal.org/index.php?topic=71050.0
178•proxysna•4d ago•101 comments

JEP 515: Ahead-of-Time Method Profiling

https://openjdk.org/jeps/515
91•cempaka•10h ago•8 comments

Booting the RP2350 from UART

https://pfister.dev/blog/2025/rp2350-uart-bl.html
56•hugolundin•11h ago•6 comments

A simple 16x16 dot animation from simple math rules

https://tixy.land
403•andrewrn•1d ago•83 comments