Add save state option in 2018/mills, update bugs

The save state option is based on the author's remarks that one can
change the W macro to MAP_SHARED. This is defined in the Makefile so a
variable called 'SAVE' was added which if not 1 will result in
MAP_PRIVATE. This way one can run

    make clobber SAVE=1 all

and it'll save state, assuming that (if you add a file) you run 'sync'
before exiting. If you don't run sync(1) it's likely the file won't
exist or it'll be corrupt (like a.out from mullender.c). README.md file
updated for this update. Note that the setting the W macro to ${MAP} is
only done for the make targets that had it set to MAP_PRIVATE. This is
because I guess that if it's already set to MAP_SHARED in the Makefile
there is a good reason for this. This is noted in the Makefile.

The bug I discovered happens whether or not state is saved (this had to
be verified before I did the above change that I added when I was
working on this entry some days back but never committed it for this
reason). If you run ./prog and then exit (ctrl-e) if you then run ./prog
again it'll show a strange message as if the image was corrupt. You have
to hit enter at this point (that's important) and then hit ctrl-e again.
When you run it a third time it'll be okay. I did not look at this in
detail but it probably should be fixed.

The Makefile also tries to make the note about preserving images to be
the state of the file (downloaded) at the time the entry won and how any
updates are unofficial stand out more.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-17 08:37:58 -08:00
1 parent 3a470289db
commit a76d3fde42
4 files changed
+84 -11

No files matched your search

+21 -2
View File
@@ -3185,10 +3185,25 @@ but this is expected and the file `ioccc.html` will be generated properly.
## 2018 mills
### STATUS: INABIAF - please **DO NOT** fix
### STATUS: known bug - please help us fix
### Source code: [2018/mills/prog.c](2018/mills/prog.c)
### Information: [2018/mills/README.md](2018/mills/README.md)
After exiting the program (with ctrl-e) if you try running it again you will
likely see:
```
>bootT5pw
]h_ 8D3[]
```
where `[]` is the cursor. When this happens if you hit enter (this is necessary
or else it'll happen again) and then exit again (ctrl-e) and run `prog` again
it'll be okay.
### STATUS: INABIAF - please **DO NOT** fix
The author stated that if you make a typo it can happen that the boot loader can
crash and halt. If this is the case type ctrl-e to quit the emulator and try
again.
@@ -3198,7 +3213,11 @@ do this you should type `make clobber all` and try again.
Cody caused a funny problem where it showed `ERROR` after each command. The
solution was to hit ctrl-e and start again. He does not know if this is what was
referred to by the author though he doesn't think he made a typo either.
referred to by the author but there was likely no typo involved.
Cody notes that if you are using the saved mode you must type `sync` prior to
exiting the program or else the next time you run it the file will not exist (or
in the case of compiled code it won't be executable).
## 2018 vokes