2023-05-26 08:55:55 So, I decided that yes, I will be able to make Forth run even before the table offsets->addresses adjustment. I'll just need a register pointing to the base of my code and a NEXT that treats the table entries as offsets into that region. So I can start up that way, and then when the time comes I'll have a word that adjusts the tables and overwrites NEXT with the final version. 2023-05-26 09:01:42 In order to make the header creation stuff I wrote yesterday fully flexible, I'm defining a variable "adjust" that will get added to CFA and PFA table cells at the time they're compiled. By setting that to the right value, I'll be able to compile for immediate execution, compile for later loading, etc. 2023-05-26 09:05:42 When I run a system from Linux, the initially loaded code region is write-protected. When I run it from block buffers, I really should TREAT the data in the block buffers as immutable as well - just poor practice to go modifying stuff in block buffers that you don't really want to get changed. That basically just means that when I'm running such code, I can't write to any variables or do anything else that 2023-05-26 09:05:44 modifies the dictionary. 2023-05-26 09:06:50 So this "at launch" Forth execution will be limited in certain ways. It'll probably be slower than final speed, and the image should be immutable. But it'll still "run." 2023-05-26 09:16:53 https://en.wikipedia.org/wiki/W%5EX 2023-05-26 09:26:06 Yeah - one of the first things I do is copy everything into an "I can do anything" memory region. After all, we expect to be able to compile new definitions (i.e., write code) and then run them. Trying to maintain that w^x rigorously would introduce all kinds of complications. 2023-05-26 09:26:50 I do like to be able to support COLD, so I need some way of restoring the original state completely. I do that by going back to that image first loaded and copy it again. 2023-05-26 09:35:11 Also, usually data fields for variables are in the same memory region with definitions. 2023-05-26 09:58:48 not all systems allow for "do anything" memory regions. (e.g., OpenBSD has w^x disabled only on binaries launched from specially mounted partitions, and is moving towards an execute-only on the contents of .text sections) 2023-05-26 10:02:39 Yuck. 2023-05-26 10:03:02 I'm fine with the availability of such options, but I don't like being told I can't do something if I want to. 2023-05-26 10:03:11 firefox also moved to W^X 2023-05-26 10:03:27 Well, it makes a lot of sense in a lot of situations. 2023-05-26 10:03:48 Like, a browser. 2023-05-26 10:04:23 The whole point of a browser is to manipulate a certain type of data - I think it's wise to make sure you're discriminating between code and data in that context, since the data is often from un-trustworthy sources. 2023-05-26 10:04:54 So it's a good feature. I just don't think it should be made "non-optional." 2023-05-26 10:05:33 And sure - if I had to do it I could maintain separate regions for machine code and definitions. 2023-05-26 10:05:52 But then I'd have to scratch my head over how to compile new primitives. 2023-05-26 10:06:13 A system that's intended for the creation of new executable code needs to have more flexibility. 2023-05-26 10:06:29 Having to flip permissions around all over the place is a pain. 2023-05-26 10:07:27 I am actually leaning toward loading my system up with a gap between the end of the initial machine code and the start of the definitions - use that as the place to put new machine code. 2023-05-26 10:07:45 they'd still be in the same "region," but that would just be to not wind up with primitives and variables etc. intermingled. 2023-05-26 10:08:08 Not a very big gap - most of the time I'm unlikely to write a lot of new machine code. 2023-05-26 10:08:51 Maybe just whatever's left over of that last 4kB page, or one free 4kB page, or something like that. 2023-05-26 10:09:56 Right now I'm thinking about how to lay out the information that will tell me what and how much to copy when I'm setting up the RAM regions, so that Forth code written to do that allocation and copying will run cleanly. 2023-05-26 10:16:05 Some of the data involved in that can't be known until I'm actually running (the "copy from" addresses). Other parts can be (region sizes, etc.) So I'm trying to define a set of variables that will sit right next to each other so I can kind of "table process" them that I can walk through to allocate and fill my four RAM regions. 2023-05-26 10:16:54 Those variables will also get set to the malloc addresses and sizes so I can use them later to free those regions if I run COLD. 2023-05-26 10:17:56 One thing I can envision is, say I wanted to restart with a larger dictionary region. I'd like to be able to change that variable and run COLD, and have it use the new size for the re-start. 2023-05-26 10:18:25 I'll use the processor stack to pass information between these execution contexts (live region vs. initial load region). 2023-05-26 10:19:43 I'm already doing that kind of dance in the system I've got now, but it's rather randomly written. I'd like to make it more streamlined. 2023-05-26 14:59:56 I am really torn over whether to step forward to Fedora 37 or not. 2023-05-26 15:00:09 They're no longer issuing updates for 36, which is where I am now. 2023-05-26 15:00:17 what's the hold up? 2023-05-26 15:00:26 38 is actually available, but if I move forward at all it'll probably just be one step. 2023-05-26 15:00:36 I'm just always nervous about it. Probably silly. 2023-05-26 15:00:53 the days where upgrades used to blow up your machine are long gone 2023-05-26 15:00:58 Especially when I occasionally have things happen like my terminator suddenly starting to hang my computer. 2023-05-26 15:01:10 Random question but can you do vim inside of tmux in your terminal? 2023-05-26 15:01:14 I just dread the prospect of upgrading and having not work. 2023-05-26 15:01:21 Sure. 2023-05-26 15:01:30 Enter gets changes to ^M in XFCE. Never had problems with this over ssh 2023-05-26 15:01:30 why wouldnt you be able to do so? 2023-05-26 15:01:32 I use screen most of the time, though. 2023-05-26 15:02:01 Actually, I don't know if I've tried tmux on my personal computer. 2023-05-26 15:02:05 You can't q! or anything requiring enter since they all get turned to ^M 2023-05-26 15:02:09 I use it reguarly for work, though. 2023-05-26 15:02:32 Is this related somehow to the fedora upgrade? 2023-05-26 15:03:01 No, sorry. Needed random Linux users to poll and thought here would be good. Sorry for OT 2023-05-26 15:03:17 Ok, I just ran tmux and tried vim - it seemed to work fine. 2023-05-26 15:03:58 No problem - I was just asking to decide whether it should get added to the worry list. :-) 2023-05-26 15:04:04 Hehe 2023-05-26 15:04:11 The thing is, I don't really know why I feel like I always need to be at the bleeding edge. 2023-05-26 15:04:22 I'm happy with how the thing works right now, so... why not just stay? 2023-05-26 15:04:30 If it ain't broke... 2023-05-26 15:04:59 I've gotten away with no GUI for programming stuff until now but windows laptop keys got bored three days ago so running GUI on $60 laptop I bought to play with 2023-05-26 15:05:13 bored=borked 2023-05-26 15:05:35 And XFCE seems light weight enough for that 2023-05-26 15:06:11 But no tmux is a deal breaker 2023-05-26 15:07:26 Maybe I'll ask in #linux but I shudder at the thought of joining 2023-05-26 15:09:15 hmm 2023-05-26 15:09:48 i'm surprised to hear that vim doesnt work within tmux 2023-05-26 15:10:14 i invoked :q! inside it and its working exactly as expected 2023-05-26 15:17:07 vim works fine in tmux outside of XFCE and it also works in a terminal window in XFCE. it just doesn't work in tmux in a terminal window in XFCE 2023-05-26 15:17:46 maybe TERM isn't set rightly 2023-05-26 15:19:35 MrMobius: fwiw, i've been using vim in tmux in xterm everyday for years 2023-05-26 15:20:53 right. I think it must be an XFCE thing since xterm and putty have the same problem 2023-05-26 15:21:25 what terminal emulator are you using? 2023-05-26 15:21:45 the built in one to XFCE 2023-05-26 15:21:54 xfce-terminal 2023-05-26 15:22:02 ok i've never used that 2023-05-26 15:22:10 what is the TERM environment variable set as? 2023-05-26 15:22:49 I'll have to wait until I get home but it's xterm-256colors or something like that outside of TMUX and "screen" inside tmux 2023-05-26 15:23:19 from Linux with no GUI it's "linux" outside tmux and also "screen" in tmux 2023-05-26 15:23:40 xterm-256color is what i use in xterm as well, and tmux-256color in tmux 2023-05-26 15:24:14 good to know 2023-05-26 15:35:41 it would be interesting to see the output of showkeys -a get when you press Enter 2023-05-26 15:35:49 -get 2023-05-26 15:37:04 my Enter is mapped to ^M, and i have no issues with vim/tmux in xterm, nor in xfce4-terminal (i'm using fluxbox as my wm though) 2023-05-26 15:37:35 would also be interesting to see if you press Ctrl-J, if that behaves as you expect Enter should, on your terminal in xfce 2023-05-26 15:44:13 ya interesting. I'll try when I get home 2023-05-26 15:45:10 the other interesting thing about this $60 laptop before I put a GUI on it was not knowing how much battery is left 2023-05-26 15:45:36 nothing in /sys/... ? 2023-05-26 15:45:59 sure, you can query it but you have to remember to keep checking 2023-05-26 15:46:41 so I added it to the status bar of tmux but then if you ssh in from TMUX and start TMUX in the remote machine, you have to Ctrl+b twice every time 2023-05-26 15:47:17 interesting 2023-05-26 15:47:44 i have a shell script called check-battery, and i add a call to that to my shell prompt when necessary 2023-05-26 15:47:58 haven't figured out a way yet on the remote machine to detect whether TMUX was started by that particular laptop in which case the client could send the battery level to the server and have it displayed in that tmux 2023-05-26 15:48:27 to avoid TMUX in TMUX 2023-05-26 15:48:45 you could have SSH send the TMUX env var over? 2023-05-26 15:48:51 the script is basically: echo $(( $(cat /sys/class/power_supply/BAT0/charge_now) / ( $(cat /sys/class/power_supply/BAT0/charge_full) / 100 ) )) and then export PS1="$(check-battery)% $PS1" which gets -> 100% user@host:~$ 2023-05-26 15:49:02 that's neat 2023-05-26 15:49:59 thrig: maybe though wouldn't you have to reload TMUX for it to update? 2023-05-26 15:50:56 I guess the status bar update that runs every 10 seconds could read it 2023-05-26 17:12:25 Yeah I use vim constantly in my work environment from within tmux. I guess it's not tmux+vim that's the issue, but rather is xfce? 2023-05-26 17:12:36 Oh, I see you said that - sorry. 2023-05-26 17:19:58 sending TMUX over would be to prevent something else from loading a tmux because whoops already a tmux, if you want to prevent nesting 2023-05-26 17:22:25 Well, I think the best way to deal with running Forth code before establishing my final image location is just to do it right - just acquire the base address of my initial image and update the table entries. 2023-05-26 17:22:29 Then there's just no issue. 2023-05-26 17:22:52 And after I make my copy I just adjust them again, with - . 2023-05-26 17:23:02 It's just a little short loop. 2023-05-26 18:23:52 So, this looks like what it will take to be able to launch the vm: 2023-05-26 18:23:54 https://pastebin.com/BT6aP05p 2023-05-26 18:25:58 The three lines indented further over are listing things put on the system stack - after the live system is going those things will be popped into variables. 2023-05-26 18:26:31 Additional info will get pushed by the start-up Forth code. 2023-05-26 18:35:53 MrMobius: What are your $60 laptop's specs? 2023-05-26 18:38:18 veltas: https://www.evolveiii.com/products/education/ 2023-05-26 18:38:38 Celeron, 4gb ram, 64gb emmc 2023-05-26 18:50:28 that seems pretty decent for $60 2023-05-26 18:53:23 ya people liked them when they came out 2023-05-26 18:53:40 r pi is like twice that just for the board 2023-05-26 18:53:45 $45 now at microcenter (https://www.microcenter.com/product/649971/evolve-iii-maestro-116-laptop-computer-dark-grey) 2023-05-26 18:54:04 did you use or hear anything about the q-book? 2023-05-26 18:55:13 unjust: right but those don't have the LTE card in them that lets you connect to internet with a sim card which is important since you can take them out which is the only way to get a slot for an SSD 2023-05-26 18:56:08 the 64gb emmc is soldered to board and will eventually wear out 2023-05-26 18:56:31 unjust: haven't heard about q-book 2023-05-26 18:56:41 no m.2 connector on the board, or unpopulated pads that you could solder your own onto? 2023-05-26 18:57:18 i saw the q-book on that link you pasted to veltas "Maestro Q-Book" looks like the ARM netbook version of your Maestro E-Book 2023-05-26 18:57:25 hmm, maybe you could solder one in on the $40 version. not sure 2023-05-26 18:58:06 My laptop's quite cheap too, it's just a ThinkPad T40 2023-05-26 18:58:22 But it's more interesting when someone produces a cheap laptop new 2023-05-26 18:58:31 i'm thinking it's possible that there was a single mainboard design, and for cost saving used the same boards but with connectors unpopulated for the cheaper models in the range (ie. no cell modem) 2023-05-26 18:59:11 probably. there are YouTube videos with tear downs 2023-05-26 19:07:07 MrMobius: Windows? On that $60 laptop? 2023-05-26 19:07:36 in case you the ssd route isn't possible, you could use a bunch of the emmc lines to attach an sd card instead (without VCCQ (+1.8V) as SD only needs VCC (3.3V), and without DAT4 - 7) 2023-05-26 19:26:21 Hehe 2023-05-26 19:27:15 KipIngram: ya. I put Ubuntu server on it right away a year ago then installed XFCE a couple days ago 2023-05-26 23:01:58 unjust: showkeys -a shows ^M in console, in tmux in console, and in xfce-terminal but it shows ^J in tmux in xfce-terminal 2023-05-26 23:09:32 MrMobius: That's always been my standard operating procedure too. Yank Windows as fast as I can. I view it as relieving the computer from oppression. 2023-05-26 23:09:53 This last go round I bought it with Linux on it, which I think spared me the usual fight for good battery life. 2023-05-26 23:11:45 I had gotten to the point where I put all my computers together from components, but then I started wanting to have a notebook instead of a desktop, and there just doesn't seem to be a very effective way to do that. 2023-05-26 23:11:53 At leats not to the degree you can with desktops. 2023-05-26 23:13:10 I don't really understand why - seems like the only real thing there that would have to be "standardized would be the hole in the top of the enclosure for the keyboard. 2023-05-26 23:13:45 They seemed to manage fine getting USB ports in the right place and so on on desktop builds - I'm sure they could do that on notebooks as well. 2023-05-26 23:39:32 https://www.youtube.com/watch?v=ZMQbHMgK2rw 2023-05-26 23:59:24 Now THAT looks fun.