Commit graph

40 commits

Author SHA1 Message Date
Toby Jaffey
6adbc53ad9 Remove impossible states 2025-12-14 01:34:59 +00:00
Toby Jaffey
179466eae4 Refactor 2025-12-14 00:18:06 +00:00
Toby Jaffey
173d5056a5 Completely remove UVM32_STACK_PROTECTION unless enabled (requires manually changing crt0.S), as this saves 16 bytes on every .bin 2025-12-14 00:09:32 +00:00
Toby Jaffey
2039de73f2 Rename getbuf to getslice 2025-12-13 23:15:06 +00:00
Toby Jaffey
b1b4cbf583 Fix bug where memory was being used instead of extram when reading cstring from extram 2025-12-13 18:46:28 +00:00
Toby Jaffey
903167231f Fix internal memcpy/memset to have standard libc prototypes 2025-12-13 15:52:27 +00:00
Toby Jaffey
f8f7627eb8 Update README.
Add license
2025-12-12 21:50:33 +00:00
Toby Jaffey
789cd74516 Disable stack canary by default 2025-12-12 21:01:40 +00:00
Toby Jaffey
8c97057809 Make extram uint8_t 2025-12-12 20:51:39 +00:00
Toby Jaffey
8158ac647c Renaming and documentating header 2025-12-12 20:42:26 +00:00
Toby Jaffey
bba5fa654c Fix off-by-one error which refused to read final byte of extram 2025-12-12 15:01:56 +00:00
Toby Jaffey
74267d94df Handle syscall cstring argument when pointing to extram 2025-12-12 14:45:25 +00:00
Toby Jaffey
096efb3b2c Remove unused var 2025-12-12 14:26:30 +00:00
Toby Jaffey
9836500503 Handle mapping a buffer to extram 2025-12-12 14:24:34 +00:00
Toby Jaffey
6878c5210f Fix weird definition of NULL 2025-12-11 16:57:23 +00:00
Toby Jaffey
3f21335fc3 Test that repeatedly stopping and starting results in executing exactly the same number of VM instructions 2025-12-11 13:16:46 +00:00
Toby Jaffey
9ca720d35c auto-generate Arduino example, to keep in sync 2025-12-11 11:05:44 +00:00
Toby Jaffey
7a1656ab10 Handle 8, 16 and 32 bit accesses to extram. 2025-12-11 10:33:45 +00:00
Toby Jaffey
b55c2bc88a Add system for memory mapping a block of memory from the host. 2025-12-11 02:36:46 +00:00
Toby Jaffey
b83fc74c8d Align stack pointer to 16 bytes, needed if UVM32_MEMORY_SIZE is not multiple of 16.
On memory rd trap, set appropriate error code
2025-12-10 23:27:24 +00:00
Toby Jaffey
ac1975a820 Test metering, prove that system can resume after a hang error with a range of meter sizes 2025-12-10 22:30:19 +00:00
Toby Jaffey
508d41c8c5 Remove stackoverflow error, have one CORE_INTERNAL error for catastrophic crash 2025-12-10 18:42:34 +00:00
Toby Jaffey
da7f70c456 Initial test framework
Clean up makefiles
Everything buildable under docker (or natively)
2025-12-10 16:36:33 +00:00
Toby Jaffey
e07eeab043 Make yield a regular syscall taking an argument.
Allows "wait for interrupt"/"wait for event" type operation where VM code blocks until the host has something for it.
2025-12-10 10:35:18 +00:00
Toby Jaffey
9baedb42e8 Add a stack canary, setup on boot 2025-12-10 01:00:36 +00:00
Toby Jaffey
ac554865a6 Make ROM const 2025-12-09 22:08:53 +00:00
Toby Jaffey
76fba39a21 Rework syscall ABI.
Syscalls now accept two parameters, allowing for things like "int count = read(buf, len)"
Rather than providing safe signatures for syscalls, the user is now given helper functions to safely parse incoming values, c-strings and slices.
2025-12-09 21:51:35 +00:00
Toby Jaffey
8c11b45670 Move CPU core out of RAM. This limits possibilities for self-modifying code hacks, but is cleaner/safer. 2025-12-09 10:46:29 +00:00
Toby Jaffey
9be9e056cd Use internal memcpy/memset 2025-12-08 23:48:50 +00:00
Toby Jaffey
ee2ba56423 Add cmdline option to host <file.bin> [max_instrs_to_run], to set instruction meter.
Allow a host to continue after a hung error, if it wants to.

So, a program with while(1) {} can be run indefinitely.
2025-12-08 20:36:00 +00:00
Toby Jaffey
c691c3ebdf Fix overly long event name 2025-12-08 13:04:05 +00:00
Toby Jaffey
a3c8b7584d Remove debug 2025-12-08 12:54:30 +00:00
Toby Jaffey
9d6e6790e1 Cleanup syscall numbers 2025-12-08 12:53:33 +00:00
Toby Jaffey
61fe0e8647 Rename ioreq to syscall 2025-12-08 12:26:47 +00:00
Toby Jaffey
f6cd790fcb ABI info 2025-12-08 07:31:21 +00:00
Toby Jaffey
751f068486 Rework host/target interface to use ecall and proper syscalls instead of CSRs 2025-12-08 02:44:38 +00:00
Toby Jaffey
af3b48cb01 Fix comment, uvm32_reset() doesn't exist 2025-12-07 13:13:36 +00:00
Toby Jaffey
f235265e3f Set stack pointer to before core registers in RAM 2025-12-07 00:59:35 +00:00
Toby Jaffey
047c9e3853 Move error strings out of header, to prevent unused warning 2025-12-06 21:35:00 +00:00
Toby Jaffey
c9d30b6d28 uvm32 initial version 2025-12-06 16:44:23 +00:00