2023-05-22 09:31:55 I changed my mind about how to lay out a "loadable image." I'm going to use a format that has all of the information about how big allocated RAM regions should be and the info about what parts of the image go to what regions is stored right at the beginning, and will be followed by all the data. 2023-05-22 09:32:42 I'll still build the system into per-region block ranges, but when I'm all done I'll squash out the leftover gaps so that the image is one contiguous (perhaps multi-block) range. 2023-05-22 09:36:42 Then to load and run one from another running Forth I'll just BLOCK in the necessary blocks and call the "loader" on the starting location of the first block. And exactly that same info can have a Linux loader tacked on in front of it to give me something I can run from bash. 2023-05-22 11:09:47 So am I reading this right? 2023-05-22 11:09:51 http://main.lv/notes/syscalls.md 2023-05-22 11:10:15 The unmap call, syscall # 11. It's required to give that the size of the block? 2023-05-22 11:11:01 I guess I just assumed from the way c's malloc and free work that it would know the size of blocks being freed. 2023-05-22 11:11:12 But maybe c holds onto that under the hood. 2023-05-22 11:13:18 Yeah - looks like that's the case. Says so here too: 2023-05-22 11:13:21 https://linux.die.net/man/2/munmap 2023-05-22 11:13:45 That's kind of a pain. 2023-05-22 11:16:04 So, what kind of ramifications are involved with mmapping a bunch of space in a program and not unmapping it before you quit to the OS? I guess I hope that when the os tears down the process it recovers it all, but that may be a dangerous assumption. 2023-05-22 11:18:23 OS recovers it, otherwise trivial userland DDoS 2023-05-22 11:18:35 or just DoS 2023-05-22 11:20:12 Ok. I definitely wanted to assume that. :-) 2023-05-22 11:20:58 (also easy to test, write a program that eats up as much memory as possible then kill -9 it) 2023-05-22 11:42:36 So I added an mmap word that will get RAM from the os and a "run" word that takes an address, calls the code there, and receives control back. It saves all registers except TOS, which has the address to call going in and the idea is that on return it has a result code. 2023-05-22 11:42:55 So I can mmap a buffer, poke 0xc3 into it (ret) and call it - that works just fine. 2023-05-22 12:09:04 So the goal now is a word that takes a block #. It will read that block, use a data item in it to read a few blocks that follow it. Given that my block buffers are contiguous, that will get an entire binary image into RAM. Then I'll use more info at the start of that to allocate the necessary RAM regions, copy data from the image into those, apply the appropriate "relocation" strategy, and finally call it. 2023-05-22 12:09:30 That'll get the target system launched. 2023-05-22 12:10:32 Probably will also want a word that will take that same info and create the bash executable that will launch it. 2023-05-22 12:20:59 somebody want to get busy on a Forth for this little guy?: 2023-05-22 12:21:02 https://www.adafruit.com/product/4077 2023-05-22 12:29:01 Oh, she's cute, isn't she? 2023-05-22 12:31:12 A Forth for that ought to be pretty straightforward. 2023-05-22 12:31:27 Plenty of RAM and flash. 2023-05-22 12:38:43 Would you need the $60 SWD debugger for anything? I was thinking I had a Picoprobe that I used for SWD debugging in the past 2023-05-22 12:39:14 Picoprobe and GDB 2023-05-22 12:39:59 Don't know - I'm reading about the SDK now. 2023-05-22 12:40:15 Not sure yet what it takes to program the thing. 2023-05-22 12:40:26 I'd imagine it needs some kind of gadget. 2023-05-22 12:40:43 But wow - $10 for a controller for all kinds of different things - that's pretty cool. 2023-05-22 12:42:03 With Bluetooth accessibility... 2023-05-22 12:42:06 I think the Nordic SDK is proprietary - no source 2023-05-22 12:42:17 Don't know yet. 2023-05-22 12:42:28 But at least they state Linux support. 2023-05-22 12:43:25 I downloaded the tar.gz and there is a license to redistribute, but no source is provided in the tar.gz 2023-05-22 12:43:33 except header files 2023-05-22 12:43:59 Not ideal, but I guess it's not the end of the world. 2023-05-22 12:44:07 Not everyone is wholly lenlightened. 2023-05-22 12:44:13 enlightened 2023-05-22 12:44:28 I'm confused where is the full data sheet for MDBT42Q 2023-05-22 12:45:39 on a related note, anybody here play around with the HC-05 or HC-06 modules? 2023-05-22 12:46:01 Is this it? 2023-05-22 12:46:06 https://www.raytac.com/download/index.php?index_id=27 2023-05-22 12:46:32 That's the link Digikey has on their page for it. 2023-05-22 12:46:40 https://www.digikey.com/en/products/detail/raytac/MDBT42Q-512KV2/13677592 2023-05-22 13:13:42 So, would you want your Forth for that gadget to work over a serial port or over Bluetooth? Or maybe either? 2023-05-22 13:14:27 If Bluetooth, would you still expect KEY and EMIT to deal in single characters? I guess it could, but it seems like an awful lot of overhead. 2023-05-22 13:16:56 I guess, though, that's how Bluetooth keyboards work, eh? 2023-05-22 13:17:09 So why not, I guess. 2023-05-22 13:18:31 serial port, at least, but I should think a port over BT as well would be great 2023-05-22 13:18:44 then you could launch it out into space 2023-05-22 13:19:04 i mean, after buying some kind of BT signal booster 2023-05-22 13:19:55 I wonder what baud rate you could manage a 10e6 km 2023-05-22 13:20:25 more seriously, having being able to log in to the interpreter over BT would be cool 2023-05-22 13:24:09 looks like zeptoforth has a module for SSD1306 displays 2023-05-22 13:24:10 https://www.amazon.com/gp/product/B072Q2X2LL/ 2023-05-22 13:24:51 got one on order 2023-05-22 13:26:03 Yeah, I've always figured that's how I'd want it to work. 2023-05-22 13:26:16 Though as you say, usb-serial too. 2023-05-22 13:27:01 I'm just not immediately aware of a "terminal program" that expects to make a BT connection for the OUTPUT as well as the input. 2023-05-22 13:27:11 Usually the keyboard is BT and the output is "direct" somehow. 2023-05-22 13:35:17 lispmacs[work]: there's no reason i can see why you should need any special JTAG or SWD adapater for that 2023-05-22 13:37:09 even a ft232 (or maybe ft4232) based usb-uart/serial adapter will work if you use openocd 2023-05-22 13:51:53 https://www.baeldung.com/linux/bluetooth-via-terminal 2023-05-22 13:57:21 Oh, ooops. I just realized that the FLUSH I wrote doesn't turn off the dirty bits. 2023-05-22 13:57:45 Guess that would be a worthwhile thing to do... 2023-05-22 14:37:25 there's no point of flushing if its still dirty in there 2023-05-22 14:38:50 BLEACH SCRUB FLUSH 2023-05-22 14:40:27 Yeah. It was an oversight. I've fixed it now. 2023-05-22 18:15:10 Hah hah - I just got an unsolicited job opportunity in my email - software engineer opening at BPM Microsystems. 2023-05-22 18:15:26 Yeah - that's what I want to do. Go back to the place I walked away from over 20 years ago. 2023-05-22 18:15:44 Almost 21 now. 2023-05-22 21:29:38 Something funky has started happening with my terminator terminal emulator. 2023-05-22 21:30:06 Twice in the last 2-3 weeks I've needed to reboot my computer. I'd do that and when I started terminator it crashed the whole machine. 2023-05-22 21:30:38 The only way I can get it to start successfully is to delete its configuration file, which means I have to set up all of my panel splits and everything from scratch. 2023-05-22 21:31:03 It has some sort of ability to connect to dbus - I don't know what that does, but I turned it off this time in case it's related. 2023-05-22 21:33:05 I'd probably more suspect GPU or video memory or something like that 2023-05-22 21:48:51 i'd run terminator in gdb until it crashes again 2023-05-22 21:49:41 at least if it's something to do with bad memory access from userland, you'll be able to catch it in the act 2023-05-22 21:51:00 The thing is, it's not just segfaulting. It's hanging the whole system - I have to hold the power button down until it overrides power off, and then start it up again. 2023-05-22 21:51:19 It's not "terminator crashing" - it's "terminator killing the system." 2023-05-22 21:53:24 kgdb over ethernet might not be a bad choice then 2023-05-22 21:53:40 On the interesting side, the raspberry pi mosh hasn't frozen since I started things back up. 2023-05-22 21:56:06 or dmesg > ~/log.txt 2023-05-22 21:56:30 for a quicker+shallower option 2023-05-22 21:59:36 That's not a bad idea at all. I'll try to remember that if I need to restart again. 2023-05-22 21:59:45 I despise rebooting, though. 2023-05-22 22:00:58 I also jettisoned tmux usage on the raspberry pi in favor of screen. This window I run my irc in uses screen and sits right t the left of the pi window; they're the ame height. The status bar color schemes clashed, and the two bars didn't quite line up perfectly. 2023-05-22 22:01:06 Now with screen on both sides - much nicer. 2023-05-22 22:01:52 I've been forced to tmux on some of my work systems. The version of Linux I have in use there has deprecated screen. 2023-05-22 22:02:01 I even tried to build it myself, but it didn't want to work right. 2023-05-22 22:02:40 There were some no longer there include files needed for building it. Putting an empty file of that name in the include directory did let it compile, but it wouldn't run completely right. 2023-05-22 22:03:52 I'm tempted from time to time to start using kitty as my primary emulator. 2023-05-22 22:04:23 I've never seen anything as fast - a guy I used to chat with here on IRC and I did some timing tests on it one night. 2023-05-22 22:04:34 Just catted a huge file to the screen and timed it. 2023-05-22 22:04:42 Kitty kicked terminator's butt. 2023-05-22 22:05:22 I do use kitty for a couple of hotkey "pop up tools" I've written. 2023-05-22 22:06:21 kitty and fzf - they both work by opening kitty on some corpus of text and fzf is in the loop; as I type characters it filters the corpus lines based on its fuzzy matching criterion. 2023-05-22 22:06:45 I've got text exports of that Dresden Files collection set up on one of those - I can find practically anything in there in seconds. 2023-05-22 22:24:59 just curious, what's wrong with tmux? 2023-05-22 23:26:27 Nothing really. It's fine as far as I can tell. 2023-05-22 23:26:40 I just never needed it - screen gave me everything that I ever required. 2023-05-22 23:27:03 I didn't mind switching to it either when it was necessary; trying to compile screen was almost more a curiosity than anything else. 2023-05-22 23:27:36 Today the main thing I didn't like was the aesthetics of those two windows sitting next to each other. Then I realized that screen probably wasn't deprecated on the pi, and sure enough - it wasn't. 2023-05-22 23:27:57 I just copied by notebook .screenrc over the pi, and now they have exactly the same, nice consistent look. 2023-05-22 23:28:15 I could have tinkered around to change the colors, of course. 2023-05-22 23:28:18 This was just faster.