diff options
author | Kartik Agaram <vc@akkartik.com> | 2019-09-11 19:04:49 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2019-09-11 19:53:23 -0700 |
commit | ecfbbfb5b58aaba9f9265cb13b9fb4a914bdcf37 (patch) | |
tree | 486cd5f4ee75323b5c733912c7a58501d65b0325 /examples/ex12.subx | |
parent | 4d53de8afa0d44e29d3caeb01ccdd02bc2e4cd70 (diff) | |
download | mu-ecfbbfb5b58aaba9f9265cb13b9fb4a914bdcf37.tar.gz |
5647 - experimental support for swapping OS
Diffstat (limited to 'examples/ex12.subx')
-rw-r--r-- | examples/ex12.subx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/examples/ex12.subx b/examples/ex12.subx index 571d42d8..dafa0071 100644 --- a/examples/ex12.subx +++ b/examples/ex12.subx @@ -6,26 +6,24 @@ # $ ./subx run examples/ex12 # You shouldn't get a segmentation fault. -== code 0x09000000 +== code # instruction effective address register displacement immediate # . op subop mod rm32 base index scale r32 # . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes Entry: - # syscall(mmap, 0x1000) + # mmap(Mmap-new-segment->len) bb/copy-to-ebx Mmap-new-segment/imm32 - b8/copy-to-eax 0x5a/imm32/mmap - cd/syscall 0x80/imm8 + e8/call syscall_mmap/disp32 # write to *eax to check that we have access to the newly-allocated segment c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0x34/imm32 # copy to *eax - # syscall(exit, eax) + # exit(eax) 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . . # copy eax to ebx - b8/copy-to-eax 1/imm32/exit - cd/syscall 0x80/imm8 + e8/call syscall_exit/disp32 -== data 0x0a000000 +== data # various constants used here were found in the Linux sources (search for file mman-common.h) Mmap-new-segment: # type mmap_arg_struct |