mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-26 20:18:06 +11:00
Compare commits
No commits in common. "ee79df225e53400d902da15545e0c593f095adef" and "6c51ea1ebb28417390b437c3e2006ccfdeb19188" have entirely different histories.
ee79df225e
...
6c51ea1ebb
@ -42,7 +42,7 @@ close the binary with a hook word. We're finished with cross-compiling.
|
||||
|
||||
We're at the offset that will be `CURRENT` on boot, so we update `LATEST`.
|
||||
|
||||
Then, we spit the source code that will be interpreted by stage 1 on boot so
|
||||
Then, we spit the course code that will be interpreted by stage 1 on boot so
|
||||
that it bootstraps itself to a full interpreter. Not all units are there
|
||||
because they don't fit in 8K, but they're sufficient for our needs. We also
|
||||
need the linker so that we can relink ourselves to stage 2.
|
||||
@ -77,14 +77,3 @@ You're looking at the offset of the last wordref of the *previous* LOAD
|
||||
operation. That offset is going in `XCURRENT`. Then, you're looking at the end
|
||||
of that word. That offset goes in `HERE`. Once you've done that, relaunch your
|
||||
LOAD.
|
||||
|
||||
### Verifying
|
||||
|
||||
You can use `/tools/memdump` to dump the memory between your begin/end offsets
|
||||
so that you can compare against your reference stage 1. Before you do, you have
|
||||
to take yourself out of xcomp mode. First, run `XCOFF` to go back to your
|
||||
regular dict. Then, run `FORGET CODE` to undo the xcomp overrides you've added
|
||||
before. That will rewind `HERE`. You don't want that. Put `HERE` back to after
|
||||
your ending offset so that you don't overwrite your binary.
|
||||
|
||||
Then, you can run `/tools/memdump`.
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/* Read specified number of bytes at specified memory address through a Forth
|
||||
/* Read specified number of bytes at specified memory address through a BASIC
|
||||
* remote shell and dump it to stdout.
|
||||
*/
|
||||
|
||||
@ -29,7 +29,9 @@ int main(int argc, char **argv)
|
||||
|
||||
int fd = open(argv[1], O_RDWR|O_NOCTTY);
|
||||
char s[0x30];
|
||||
sprintf(s, ": _ 0x%04x 0x%04x DO I @ .x LOOP ; _", memptr+bytecount, memptr);
|
||||
sprintf(s, "m=0x%04x", memptr);
|
||||
sendcmdp(fd, s);
|
||||
sprintf(s, "while m<0x%04x peek m:puth a:m=m+1", memptr+bytecount);
|
||||
sendcmd(fd, s);
|
||||
|
||||
for (int i=0; i<bytecount; i++) {
|
||||
@ -39,6 +41,5 @@ int main(int argc, char **argv)
|
||||
putchar(c);
|
||||
}
|
||||
read(fd, s, 2); // read prompt
|
||||
sendcmdp(fd, "FORGET _");
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user