NetBSD 10.x Kernel Math_emulation
mezzantrop.wordpress.com
NetBSD 10.x Kernel Math_emulation
1–10 of 12 posts
Re: NetBSD 10.x Kernel Math_emulation
#2If 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)
Re: NetBSD 10.x Kernel Math_emulation
#3This 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)
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.
Re: NetBSD 10.x Kernel Math_emulation
#4https://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.
Re: NetBSD 10.x Kernel Math_emulation
#5I 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…
I don't care about Rust and it's killer app Firefox, there are tons of alternatives for i686. From Luakit to Vimb.
Re: NetBSD 10.x Kernel Math_emulation
#6I 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…
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....
Re: NetBSD 10.x Kernel Math_emulation
#7Forth 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 1- >R
REPEAT SWAP 0 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+ UR
0 ROT ROT 2DUP U 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 0R DNEGATE R>
8000 OR THEN ;
: F+ ROT 2DUP >R >R FABS SWAP FABS -
DUP IF DUP 0 R> SWAP >R >R
THEN 0 SWAP RALIGN
THEN SWAP 0 R> R@ XOR 0 FSIGN ROT SWAP NORM
ELSE D+ IF 1+ 2/ 8000 OR R> 1+
ELSE R> THEN THEN ;
: F- FNEGATE F+ ;
: FR PL @ TENS DROP UM* R> SHIFTS
RALIGN PL @ ?DUP IF 0 DO # LOOP
". HOLD THEN #S ROT SIGN ;
: TUCK SWAP OVER ;
: F. TUCK TYPE SPACE ;
: DFLOAT 4020 FSIGN NORM ;
: F DFLOAT POINT TENS DFLOAT F/ ;
: FCONSTANT F 2CONSTANT ;
: FLOAT DUP 0R 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> 0R
FLOAT 4004 FLOAT F/ EXP F*
2DUP ONE F 1- >R THEN
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
Re: NetBSD 10.x Kernel Math_emulation
#8Re: NetBSD 10.x Kernel Math_emulation
#9This is the most worthless thing in the world. Why would anybody give a rat's fucking ass about a third? Not even a third rate like a 10th rate. Fucking operating system having math support. Oh wow! Congratulations! Now you can go ahead and support computers from 1985 now
Kudos to the author for doing this _and_ sharing it with the world.
Re: NetBSD 10.x Kernel Math_emulation
#10This is the most worthless thing in the world. Why would anybody give a rat's fucking ass about a third? Not even a third rate like a 10th rate. Fucking operating system having math support. Oh wow! Congratulations! Now you can go ahead and support computers from 1985 now
Also, FP is not math, it's just a kind of math. And even Forth users will use a fixed point before going into float. With 32 bits, they will just scale the point and call it a day.
And seasoned Forth users will just use quotient arithmetic and output fractional parts as two items in the stack.