-- Leo's gemini proxy

-- Connecting to bbs.geminispace.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; charset=utf-8

nForth - trouble in paradise


Just as I was beginning to enjoy low-level assembly coding after a long break, and looking forward to whumpin' on some home-made forth, the bastards got me!


My mom tried to tell me to be normal, and do things the way other people do them, but no! I had to be this weirdo who just gets more and more restless doing things the 'normal' way.


And so, 32-bit code is apparently over, just when I was really embracing the i386, with its limited registers. But I love being able to have a 3-byte, two-instruction NEXT which uses 32-bit execution tokens. And I really miss pusha and popa instructions in 64-bit code. Compactness.


Linux will run static self-contained 386 code, the way I like to write it, but apparently choke (without a meaningful error message, mind you!) on code compiled normally with gcc and libraries, because modern distros come without 386 library support -- even basic things like libc. Because my 1.5GB distro was so concerned about space to add a basic library that's like a couple of megs? And why is libc so big anyway? Why is linux 1.5GB? Maybe my mother was wrong after all, and everyone is in fact insane, just like I always suspected.


=>gemini://bbs.geminispace.org/s/Linux/5011 Lack of Error Message on executing 32-bit binaries with no 32-bit support


Also, the 32-bit version of Address Space Layout Randomization (which is not that helpful in preventing attacks anyway) is BROKEN, screwing up my nforth by loading code at a fixed address but creating a disjoined segment when I try to adjust memory break.


=>gemini://bbs.geminispace.org/s/Linux/5066 address randomization tribulations


32-bit support is less important than including at least 10 different visual themes, with multi-megabyte backgrounds created by people who failed art appreciation in high school. More mauve and green zigzags, please! And don't forget a sunrise over stylized Jupiter, please!


So to get my 4Kb forth running, I have to treat the core as a separate segment, which means I can't use 16-bit back-offsets for heads. I suppose it's a kluge, and I can make it a proper 32-bit address, and since heads are aligned to 4-byte boundaries, I can steal the low 2 bits for things like IMMEDIATE bit.


The other option is to make the code truly relocatable, but that is sort of against the grain of this particular, minimalistic project.


๐Ÿš€ stack

2023-09-03 ยท 9 months ago ยท ๐Ÿ‘ akkartik


3 Comments โ†“


๐Ÿ˜บ gemalaya ยท 2023-09-03 at 22:37:

Your mom was trying to make you abandon assembly code and turn to Javascript but you resisted ? You're strong.


๐Ÿš€ stack [OP] ยท 2023-09-04 at 00:02:

That is correct.


๐Ÿš€ stack [OP] ยท 2023-09-04 at 00:48:

Well, I changed over to 32-bit link pointers, and it works now with address randomization.

-- Response ended

-- Page fetched on Sat Jun 1 09:30:07 2024