2022-05-23 08:41:49 So, this EXPECT editing word - obviously when I insert or delete a character it has to move everything that comes after that. Right now it just does that to the current "string size." But there is a "max" parameter available as well - it occurred to me that if I move everything up to max, then I could edit a line in place in a disk buffer - if I just set max to the right value to take it to the end of the 2022-05-23 08:41:51 buffer, then it would shift all the rest around correctly too. 2022-05-23 08:42:02 That would completely avoid having to do that in some other way. 2022-05-23 08:42:44 I wouldn't "see" all of that stuff - only the one line would actually be visible. But the subsequent buffer content would just "ride along." 2022-05-23 08:43:29 Haven't decided to actually do that yet, but it seems tempting. 2022-05-23 09:49:29 Yeah, I think I will try it. It's just that much closer to having a editor. And after all, allegedly all the bytes up to "max" are "touchable," so why n ot? 2022-05-23 10:02:21 KipIngram: i had an idea the other day about detecting stack underflow 2022-05-23 10:03:30 Hit us with it. 2022-05-23 10:03:46 KipIngram: i could use the mmu to detect underflow by mapping the mmu page at the top of the stack as "no access" 2022-05-23 10:03:49 There's nothing clever about how I do that. Just the standard thing. 2022-05-23 10:04:09 Ah, yes. So long as the base of the stack is on a 4096 byte boundary. 2022-05-23 10:04:39 That's easy to arrange for "the main stack," but if you want to adjust SP0 for a "child" then that wouldn't work. 2022-05-23 10:04:56 ah interesting 2022-05-23 10:05:15 At least I think those mmu things are constrained to 4kB pages. 2022-05-23 10:05:18 if you have coroutines that'd not work either 2022-05-23 10:05:31 Right. 2022-05-23 10:05:46 i have not progressed that far with forth :-) 2022-05-23 10:05:50 I just check at the end of each call to "interpret,: 2022-05-23 10:05:59 So, no run-time protection. 2022-05-23 10:06:29 im still a fan of circular stacks 2022-05-23 10:06:54 i thought using the mmu was cool because it would detect at run time like you said, and it would also catch reads, which is harder to detect in the interpreter 2022-05-23 10:07:13 I am catching memory error signals, though. Plus my data stack is at the very top of my image, and grows down, so the underflow area actually isn't accessible. 2022-05-23 10:07:37 But again, that's just the "initial setting" for SP0. 2022-05-23 10:08:07 Nothing in my system right now changes SP0, but I think I may want to change it / restore it for LOAD. 2022-05-23 10:10:11 i realized that because you cant directly address the stack (at least in ansi standard) you could copy it around to make it bigger and all you have to update is SP0 and the register 2022-05-23 10:10:37 because there are no pointers into the stack that you would need to change 2022-05-23 10:10:58 Yep. Or you could have multiple threads, each with their own SP0 and so on. 2022-05-23 10:11:14 I do access my stack in ways the standard wouldn't approve of. 2022-05-23 10:11:25 But no variables are involved. 2022-05-23 10:15:30 i wrote a small c program as a proof of concept for adding a "guard" page at the top of the data stack, which worked in the sense that it caught an invalid read ... BUT it still crashed because i don't really know how to code it in unix 2022-05-23 10:16:21 i could set it up with mmap and mprotect, but i really don't know how to use unix signals 2022-05-23 10:16:21 I can advise you if you get ready to handle that - I just slugged through all the signal catching stuff a few weeks ago. And it's not particularly well-documented out there. 2022-05-23 10:16:41 The problem is that you wind up having to do non-portable stuff. 2022-05-23 10:16:41 yes, bloody signals 2022-05-23 10:16:53 People seem to prefer writing about portable stuff. 2022-05-23 10:17:26 I arranged mind to have the signal send control back to the interpreter. 2022-05-23 10:18:32 i forget are you still on macos ? you might have switched to linux ? 2022-05-23 10:18:42 unix signals are such a pain 2022-05-23 10:19:58 i use netbsd which is quite niche when it comes to unix, and even linux is niche compared to windows 2022-05-23 10:20:03 After passing through the error handling. 2022-05-23 10:20:31 I have no knowledge whatsoever of Windows - I've avoided it like the plague for the last couple of decades. 2022-05-23 10:21:12 I used Windows XP at some corporation a while ago. dreadful little OS 2022-05-23 10:25:34 The frustrating thing, though, is that if you want to work with some sort of "gadget" like an FPGA dev board, etc., it's often the case that the software the vendor offers is Windows only. 2022-05-23 10:25:38 Not always, but a lot. 2022-05-23 10:30:03 my EE is limited to "screwing around with arduino and thus burning out USB ports" 2022-05-23 10:31:51 :-) 2022-05-23 10:32:39 I used to use my work-issue notebook (a Macbook Air) for my personal stuff as well, but then they had the brilliant idea of preventing people from copying company IP by disabling writes on our USB ports. 2022-05-23 10:32:52 That prompted me to buy a computer of my own for the first time in almost a decade. 2022-05-23 10:33:19 Oh, and get this - the measures they put into place do indeed block USB writes. UNLESS you're writing to a USB DVD drive. 2022-05-23 10:33:24 That continues to work just fine. 2022-05-23 10:33:34 So they didn't even really accomplish their stated goal. 2022-05-23 10:33:53 All they managed to do was impose a bunch of inconvenience on us. 2022-05-23 10:34:03 Brilliant. 2022-05-23 10:34:46 it might slow down a clueless inside attacker, a little? 2022-05-23 10:35:56 I suppose. :-) 2022-05-23 10:36:00 a halfway clever one would encode whatever using tabs and spaces in a HTML document and email that elsewhere 2022-05-23 10:36:19 Right. There are tons of ways we could still do it. 2022-05-23 10:36:36 But, some team got to report to their executives that they'd "taken action." 2022-05-23 10:36:44 I think that sort of thing is what drives a lot of stuff. 2022-05-23 10:38:01 I can imagine them wanting to lock down all USB devices and some team, somewhere, says "wait! We have to use DVD drives!" and rather than scrap the whole plan, they just say "okay, fine. Everything except DVD drives" 2022-05-23 10:39:57 or dvd use some other ID because $reasons in usb spec and they missed it 2022-05-23 11:03:59 That sounds plausible.