On Linux, when uxnemu enters an infinite loop, the only way to stop
it is to send SIGKILL to it. This makes debugging infinite loops very
annoying. This patch adds a step limit per execution, which should be
well out of the realm of a plausible use, and helps stop infinite
loops.
Previously, writing to the stat port would produce a line of text
similar to the listing used when reading a directory. This did not
match the documentation around the stat port.
After the change, writing an address to the stat port will fill that
address with bytes equal to the length parameter. These will either be
a hexadecimal file size, or else the same character repeated N times
according to the following logic:
- path is a directory
? file size of path does not fit in N hexadecimal characters
! path is not readable
Note that unlike when reading a directory, the string will not include
the requested path, a newline, or a null terminator.
Previously Varvara did not have a way to create new directories.
This change adds that capability without adding or modifying any
device ports.
The changes are:
(1) When a filename ends in the directory separator, writing
any value to File/write will create a directory. Unlike
with regular files, the value is ignored.
(2) When writing any path (regular files or directories) if
there are missing parent directories Varvara will attempt
to create them first. This behavior is similar to mkdir -p.
The directory separator is / on most platforms, and \ on Windows.
On POSIX platforms the directories will be created with permission
0755 (modified by the user's umask value).
This change has been tested and works in both uxnemu and uxncli.