Give the system another page of each memory
CosmOS had 1,161 bytes of Program Memory left before the address applications load at, and Tab completion is not going to fit in that with anything to spare. So the wall moves up one page: the system keeps below 0x4FFF and 0x2FFF, and an application is based at 0x5000 and 0x3000. A PAGE IS A CHEAP THING TO GIVE IT AND AN EXPENSIVE THING TO RUN OUT OF. An application still has 44K of Program Memory before the vector table and the largest one here uses 7.5K, so what was taken from applications is space nothing has ever asked for - while what the system gained is the difference between building the next thing and counting bytes while building it. Not doubling, which was the version that would have cost application space worth minding. One page, and the same again when it is needed. Nothing in the machine knows where the wall is, so this is 34 #Base lines, one threshold in the fault handler, and the table in the CosmOS README that Tests/docs.sh reads its limits out of. The native assembler's scratch map had to move with it, and docs.sh said so before anything ran: its data reached 0x40D6 and its buffers began at 0x4000, so they were sitting on its variables. That file already carries a paragraph about the floor coming up and the map staying where it was. It has happened twice now, and been caught by a check the first time wrote. Twenty three recordings are the same runs a page higher. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
f97d15de08
commit
3449405b18
@@ -38,7 +38,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Argument
|
||||
@@ -2180,7 +2180,7 @@ report:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Argument:
|
||||
#Reserve 0d23
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Wanted
|
||||
@@ -60,7 +60,7 @@ noFile:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Wanted:
|
||||
#Reserve 0d23
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
;
|
||||
; None of this is initialised data. It is scratch, wanted only while the assembler is
|
||||
; running, and while it is running everything above its own data is free: the system keeps
|
||||
; below 0x1FFF, the staging area is only in use during a load, and the Stack comes down
|
||||
; below 0x2FFF, the staging area is only in use during a load, and the Stack comes down
|
||||
; from the top. So the addresses are written down here and the file carries none of it.
|
||||
;
|
||||
; That sentence said 0x1000 for a while after the system's half of Data Memory was
|
||||
@@ -20,10 +20,10 @@
|
||||
; bad enough; a stale number sitting next to the correction is worse, because whichever
|
||||
; one a reader takes is a coin toss.
|
||||
;
|
||||
; 0x4000 6144 the label index, 1536 entries of four
|
||||
; 0x5800 16384 the label names, packed end to end
|
||||
; 0x9800 256 one block of the output file, on its way to the disk
|
||||
; 0x9900 18176 free
|
||||
; 0x5000 6144 the label index, 1536 entries of four
|
||||
; 0x6800 16384 the label names, packed end to end
|
||||
; 0xA800 256 one block of the output file, on its way to the disk
|
||||
; 0xA900 17152 free
|
||||
; 0xE000 1792 the vector names, 64 entries of twenty eight
|
||||
; 0xE700 2048 the reader's stack, six levels of 301
|
||||
; 0xEF00 368 which files have been included, sixteen names of 23
|
||||
@@ -35,9 +35,15 @@
|
||||
; and the map stayed where it was, leaving sixteen kilobytes between the two that nothing
|
||||
; touched.
|
||||
;
|
||||
; Starting at 0x4000 takes that back. The assembler's data is a little over four kilobytes
|
||||
; from 0x2000, so there is still nearly four kilobytes of slack in front of this - and room
|
||||
; for its data to double before the two would meet. `make test` measures that gap now
|
||||
; Starting above the assembler's own data takes that back. It began at 0x4000 with the data
|
||||
; from 0x2000, and moved to 0x5000 when the system was given another page and every
|
||||
; application's data moved to 0x3000 with it - THE FLOOR CAME UP A SECOND TIME, exactly as
|
||||
; the paragraph above says it did the first, and this time the check below said so before
|
||||
; anything ran: the assembler's data reached 0x40D6 and the index began at 0x4000, so the
|
||||
; buffers were sitting on the variables.
|
||||
;
|
||||
; There is still nearly four kilobytes of slack in front of this, and room for the data to
|
||||
; double before the two would meet. `make test` measures that gap now
|
||||
; rather than trusting this paragraph, and measures the floor above as well, because both
|
||||
; of those numbers describe the machine AROUND this file and neither is enforced by a line
|
||||
; of code anywhere.
|
||||
@@ -77,11 +83,11 @@
|
||||
; second is bigger than the first, which is worth knowing: the hardest thing this assembles
|
||||
; is not the operating system, it is itself.
|
||||
ScratchLabIndex:
|
||||
0x40 0x00
|
||||
0x50 0x00
|
||||
ScratchLabArena:
|
||||
0x58 0x00
|
||||
0x68 0x00
|
||||
ScratchWindow:
|
||||
0x98 0x00
|
||||
0xA8 0x00
|
||||
ScratchVecNames:
|
||||
0xE0 0x00
|
||||
ScratchSrcStack:
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#Program
|
||||
|
||||
#Base 0x4000
|
||||
#Base 0x5000
|
||||
|
||||
start:
|
||||
SETD.0 Wanted
|
||||
@@ -128,7 +128,7 @@ noFile:
|
||||
|
||||
#Data
|
||||
|
||||
#Base 0x2000
|
||||
#Base 0x3000
|
||||
|
||||
Wanted:
|
||||
#Reserve 0d23
|
||||
|
||||
Reference in New Issue
Block a user