about summary refs log tree commit diff stats
path: root/linux/201register-names.subx
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-03-03 22:09:50 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-03-03 22:21:03 -0800
commit71e4f3812982dba2efb471283d310224e8db363e (patch)
treeea111a1acb8b8845dbda39c0e1b4bac1d198143b /linux/201register-names.subx
parentc6b928be29ac8cdb4e4d6e1eaa20420ff03e5a4c (diff)
downloadmu-71e4f3812982dba2efb471283d310224e8db363e.tar.gz
7842 - new directory organization
Baremetal is now the default build target and therefore has its sources
at the top-level. Baremetal programs build using the phase-2 Mu toolchain
that requires a Linux kernel. This phase-2 codebase which used to be at
the top-level is now under the linux/ directory. Finally, the phase-2 toolchain,
while self-hosting, has a way to bootstrap from a C implementation, which
is now stored in linux/bootstrap. The bootstrap C implementation uses some
literate programming tools that are now in linux/bootstrap/tools.

So the whole thing has gotten inverted. Each directory should build one
artifact and include the main sources (along with standard library). Tools
used for building it are relegated to sub-directories, even though those
tools are often useful in their own right, and have had lots of interesting
programs written using them.

A couple of things have gotten dropped in this process:
  - I had old ways to run on just a Linux kernel, or with a Soso kernel.
    No more.
  - I had some old tooling for running a single test at the cursor. I haven't
    used that lately. Maybe I'll bring it back one day.

The reorg isn't done yet. Still to do:
  - redo documentation everywhere. All the README files, all other markdown,
    particularly vocabulary.md.
  - clean up how-to-run comments at the start of programs everywhere
  - rethink what to do with the html/ directory. Do we even want to keep
    supporting it?

In spite of these shortcomings, all the scripts at the top-level, linux/
and linux/bootstrap are working. The names of the scripts also feel reasonable.
This is a good milestone to take stock at.
Diffstat (limited to 'linux/201register-names.subx')
-rw-r--r--linux/201register-names.subx164
1 files changed, 164 insertions, 0 deletions
diff --git a/linux/201register-names.subx b/linux/201register-names.subx
new file mode 100644
index 00000000..3c18a803
--- /dev/null
+++ b/linux/201register-names.subx
@@ -0,0 +1,164 @@
+== data
+Registers:  # (addr stream {(handle array byte), int})
+  # a table is a stream
+  0x120/imm32/write
+  0/imm32/read
+  0x120/imm32/length
+  # data
+  # it is perfectly ok to use fake alloc-ids -- as long as you never try to reclaim them
+  0x11/imm32/alloc-id $Register-eax/imm32 0/imm32
+  0x11/imm32/alloc-id $Register-ecx/imm32 1/imm32
+  0x11/imm32/alloc-id $Register-edx/imm32 2/imm32
+  0x11/imm32/alloc-id $Register-ebx/imm32 3/imm32
+  0x11/imm32/alloc-id $Register-esp/imm32 4/imm32
+  0x11/imm32/alloc-id $Register-ebp/imm32 5/imm32
+  0x11/imm32/alloc-id $Register-esi/imm32 6/imm32
+  0x11/imm32/alloc-id $Register-edi/imm32 7/imm32
+  # for 8-byte registers
+  # we don't actually check if these are used when they should be; be careful
+  0x11/imm32/alloc-id $Register-al/imm32 0/imm32
+  0x11/imm32/alloc-id $Register-cl/imm32 1/imm32
+  0x11/imm32/alloc-id $Register-dl/imm32 2/imm32
+  0x11/imm32/alloc-id $Register-bl/imm32 3/imm32
+  0x11/imm32/alloc-id $Register-ah/imm32 4/imm32
+  0x11/imm32/alloc-id $Register-ch/imm32 5/imm32
+  0x11/imm32/alloc-id $Register-dh/imm32 6/imm32
+  0x11/imm32/alloc-id $Register-bh/imm32 7/imm32
+  # for floating-point registers
+  # we don't actually check if these are used when they should be; be careful
+  0x11/imm32/alloc-id $Register-xmm0/imm32 0/imm32
+  0x11/imm32/alloc-id $Register-xmm1/imm32 1/imm32
+  0x11/imm32/alloc-id $Register-xmm2/imm32 2/imm32
+  0x11/imm32/alloc-id $Register-xmm3/imm32 3/imm32
+  0x11/imm32/alloc-id $Register-xmm4/imm32 4/imm32
+  0x11/imm32/alloc-id $Register-xmm5/imm32 5/imm32
+  0x11/imm32/alloc-id $Register-xmm6/imm32 6/imm32
+  0x11/imm32/alloc-id $Register-xmm7/imm32 7/imm32
+
+$Register-eax:
+  0x11/imm32/alloc-id
+  3/imm32/size
+  0x65/e 0x61/a 0x78/x
+
+$Register-ecx:
+  0x11/imm32/alloc-id
+  3/imm32/size
+  0x65/e 0x63/c 0x78/x
+
+$Register-edx:
+  0x11/imm32/alloc-id
+  3/imm32/size
+  0x65/e 0x64/d 0x78/x
+
+$Register-ebx:
+  0x11/imm32/alloc-id
+  3/imm32/size
+  0x65/e 0x62/b 0x78/x
+
+$Register-esp:
+  0x11/imm32/alloc-id
+  3/imm32/size
+  0x65/e 0x73/s 0x70/p
+
+$Register-ebp:
+  0x11/imm32/alloc-id
+  3/imm32/size
+  0x65/e 0x62/b 0x70/p
+
+$Register-esi:
+  0x11/imm32/alloc-id
+  3/imm32/size
+  0x65/e 0x73/s 0x69/i
+
+$Register-edi:
+  0x11/imm32/alloc-id
+  3/imm32/size
+  0x65/e 0x64/d 0x69/i
+
+$Register-al:
+  0x11/imm32/alloc-id
+  2/imm32/size
+  0x61/a 0x6c/l
+
+$Register-cl:
+  0x11/imm32/alloc-id
+  2/imm32/size
+  0x63/c 0x6c/l
+
+$Register-dl:
+  0x11/imm32/alloc-id
+  2/imm32/size
+  0x64/d 0x6c/l
+
+$Register-bl:
+  0x11/imm32/alloc-id
+  2/imm32/size
+  0x62/b 0x6c/l
+
+$Register-ah:
+  0x11/imm32/alloc-id
+  2/imm32/size
+  0x61/a 0x68/h
+
+$Register-ch:
+  0x11/imm32/alloc-id
+  2/imm32/size
+  0x63/c 0x68/h
+
+$Register-dh:
+  0x11/imm32/alloc-id
+  2/imm32/size
+  0x64/d 0x68/h
+
+$Register-bh:
+  0x11/imm32/alloc-id
+  2/imm32/size
+  0x62/b 0x68/h
+
+$Register-xmm0:
+  0x11/imm32/alloc-id:fake:payload
+  # "xmm0"
+  0x4/imm32/size
+  0x78/x 0x6d/m 0x6d/m 0x30/0
+
+$Register-xmm1:
+  0x11/imm32/alloc-id:fake:payload
+  # "xmm1"
+  0x4/imm32/size
+  0x78/x 0x6d/m 0x6d/m 0x31/1
+
+$Register-xmm2:
+  0x11/imm32/alloc-id:fake:payload
+  # "xmm2"
+  0x4/imm32/size
+  0x78/x 0x6d/m 0x6d/m 0x32/2
+
+$Register-xmm3:
+  0x11/imm32/alloc-id:fake:payload
+  # "xmm3"
+  0x4/imm32/size
+  0x78/x 0x6d/m 0x6d/m 0x33/3
+
+$Register-xmm4:
+  0x11/imm32/alloc-id:fake:payload
+  # "xmm4"
+  0x4/imm32/size
+  0x78/x 0x6d/m 0x6d/m 0x34/4
+
+$Register-xmm5:
+  0x11/imm32/alloc-id:fake:payload
+  # "xmm5"
+  0x4/imm32/size
+  0x78/x 0x6d/m 0x6d/m 0x35/5
+
+$Register-xmm6:
+  0x11/imm32/alloc-id:fake:payload
+  # "xmm6"
+  0x4/imm32/size
+  0x78/x 0x6d/m 0x6d/m 0x36/6
+
+$Register-xmm7:
+  0x11/imm32/alloc-id:fake:payload
+  # "xmm7"
+  0x4/imm32/size
+  0x78/x 0x6d/m 0x6d/m 0x37/7