Stage one places Program Memory and nothing else, because knowing where a payload's data ends and its code begins would mean knowing a format, and knowing formats is what ROM must do as little of as possible. But the real second stage needs a Data Segment: sbfs.asm has variables and a string it compares against. The answer needs nothing new. A loadable image is written into the slot as code followed by data, so the data image is already in Program Memory just past the code - and the payload's first instructions blit it down to where it was assembled for. Proved by slotData.asm, which prints from a string it placed itself. The padding is the part worth recording. The blit needs a length and the assembler will not work out the difference between two labels, so the segment is padded to a round number and that number is what gets copied. The first draft padded to 257 and copied 256, and the byte that did not arrive was padding, so it worked by luck. It is exact now and says why. This is the shape the user asked for and it goes further than the mechanism: the second stage becomes a loader for the machine's ORDINARY image format rather than for anything boot-specific, so bare metal SplitBit stops being a special case. A program that wants no operating system is just an image, developed under CosmOS like any other, and selectable at boot because it is a file.
31 lines
1.6 KiB
Plaintext
31 lines
1.6 KiB
Plaintext
Programs/Boot/slotData.asm redundant-setd 1
|
|
Programs/Boot/stage1.asm redundant-setd 2
|
|
Programs/CosmOS/Apps/Copy.asm redundant-setd 2
|
|
Programs/CosmOS/Apps/Edit.asm redundant-setd 3
|
|
Programs/CosmOS/Apps/Wander.asm redundant-setd 1
|
|
Programs/CosmOS/Assembler/Asm.asm redundant-assignment 2
|
|
Programs/CosmOS/Assembler/Asm.asm redundant-setd 8
|
|
Programs/CosmOS/Assembler/classify.asm redundant-assignment 2
|
|
Programs/CosmOS/Assembler/classify.asm redundant-setd 6
|
|
Programs/CosmOS/Assembler/readTest.asm redundant-setd 1
|
|
Programs/CosmOS/Assembler/token.asm redundant-assignment 4
|
|
Programs/CosmOS/Assembler/token.asm redundant-setd 2
|
|
Programs/CosmOS/Assembler/tokenTest.asm redundant-setd 1
|
|
Programs/CosmOS/Source/cosmos.asm redundant-assignment 1
|
|
Programs/CosmOS/Source/cosmos.asm redundant-setd 9
|
|
Programs/CosmOS/Source/sbfs.asm branch-to-next 1
|
|
Programs/CosmOS/Source/sbfs.asm redundant-assignment 4
|
|
Programs/CosmOS/Source/sbfs.asm redundant-setd 1
|
|
Programs/CosmOS/Source/text.asm redundant-setd 2
|
|
Programs/Loader/loader.asm redundant-assignment 1
|
|
Programs/testPrograms/branchTest.asm redundant-assignment 1
|
|
Programs/testPrograms/branchTest.asm redundant-ccf 1
|
|
Programs/testPrograms/controllerWriteTest.asm branch-to-next 1
|
|
Programs/testPrograms/diagnostics/duplicateLabel.asm branch-to-next 1
|
|
Programs/testPrograms/diskTest.asm redundant-assignment 1
|
|
Programs/testPrograms/dispatchTest.asm branch-to-next 1
|
|
Programs/testPrograms/fenceTest.asm redundant-assignment 1
|
|
Programs/testPrograms/moveQTest.asm redundant-ccf 1
|
|
Programs/testPrograms/rawCallAndOffsets.asm redundant-assignment 1
|
|
Programs/testPrograms/waitTest.asm redundant-assignment 1
|