Commit Graph

78 Commits

Author SHA1 Message Date
Michaël Van Canneyt
4c26e4f989 * Enable monitor support 2024-02-24 18:11:23 +01:00
Michael VAN CANNEYT
f6beba0b0b * string -> shortstring 2023-07-14 17:26:11 +02:00
Michael VAN CANNEYT
2ce2bab2a6 * Char -> AnsiChar 2023-07-14 17:26:09 +02:00
Nikolay Nikolov
b97f3a08ed * since exporting webassembly globals doesn't yet work accross units, added a
workaround by using property getters and setters
2023-06-11 15:00:56 +03:00
Nikolay Nikolov
b247302871 + initial attempt (not fully working, yet) at implementing WebAssembly suspending externals 2023-06-11 14:07:35 +03:00
Nikolay Nikolov
e3139fea21 + setup a thread manager (functions are still not yet implemented), when the WASI RTL is compiled with multithreading support 2022-07-14 05:14:20 +03:00
Michaël Van Canneyt
4765d885df * Export wasiAlloc, wasiFree 2022-05-27 19:16:52 +02:00
Nikolay Nikolov
a8b789d183 * patch from Pierre for working around the exitcode <= 125 limitation in wasmtime 2022-05-24 10:15:44 +03:00
Michaël Van Canneyt
1b22a68fc6 * Export wasiAlloc and wasiFree 2022-05-18 14:48:11 +02:00
Nikolay Nikolov
68cd1c3973 + define USE_NOTHREADMANAGER in the WASI system unit 2022-01-26 16:39:29 +02:00
Nikolay Nikolov
b2a0df0d10 * ConvertToFdRelativePath removed from the interface part of the WASI system
unit (to avoid cluttering the WASI system unit interface with platform
  dependent routines) and added to a new unit, called wasiutil
2021-10-19 09:06:56 +03:00
Nikolay Nikolov
21d843128d + added a wrapper function around __wasi_path_readlink that calls it iteratively
with doubling buffer sizes, starting with 64 bytes, until it reaches 16384
  bytes, and reads the link into a rawbytestring. Use that function in all
  places in the WASI rtl that need to read a symlink.
2021-10-15 14:33:43 +03:00
Nikolay Nikolov
aafb471bc8 * don't set InOutRes in ConvertToFdRelativePath, but return it instead. This
fixes issues in places where this function is used in a way that should not
  set IOResult.
2021-10-12 03:28:03 +03:00
Nikolay Nikolov
fe903f2ae4 * fixed range check error in HasDriveLetter when path is 1 character long 2021-10-12 03:28:03 +03:00
Nikolay Nikolov
00d5bb5bbc * fixed off-by-one error when initializing current_drive in the WASI system unit 2021-10-12 03:28:03 +03:00
Nikolay Nikolov
27df4e98d2 * use rawbytestring instead of ansistring for the WASI file name handling 2021-10-11 09:25:01 +03:00
Nikolay Nikolov
a0e7882692 * use AllowDirectorySeparators, instead of checking for '/' and '\' 2021-10-11 09:04:32 +03:00
Nikolay Nikolov
d7755a56f6 * replaced '/' with DirectorySeparator in the WASI directory parsing code 2021-10-11 08:51:39 +03:00
Nikolay Nikolov
13c344a3a0 * replaced ['/','\'] with AllowDirectorySeparators in the WASI directory
parsing code
2021-10-11 08:45:42 +03:00
Nikolay Nikolov
25ac138092 * keep the drive string separate in the preopen and the current dir records on
the WASI platform
2021-10-11 08:38:33 +03:00
Nikolay Nikolov
64db584eef * moved the preopened dir and current dir handling types and variables to the
implementation part of the system unit, so their implementation is not exposed
  and can be changed in the future (e.g. for thread safety when WebAssembly
  gets multithreading support, etc.)
2021-10-10 20:25:29 +03:00
Nikolay Nikolov
a62c7555d7 - removed the DebugWriteXXX functions from the WASI system unit, since console
output is now quite stable and can be used for debugging
2021-10-10 20:25:29 +03:00
Nikolay Nikolov
0d6b5338d0 + implemented ChDir() for WASI 2021-10-10 20:25:29 +03:00
Nikolay Nikolov
85ebd2c94c * fixed handling of relative paths that are not directly relative to a preopened
dir in ConvertToFdRelativePath. This is a preparation for ChDir support.
2021-10-10 20:25:29 +03:00
Nikolay Nikolov
bae50d80d2 * preopen fd names and current dir changed to use ansistring, as well as the
parameters and result of ConvertToFdRelativePath. This will allow easier
  implementation of ChDir.
2021-10-10 09:11:19 +03:00
Nikolay Nikolov
d45915b6ba * preopened dirs structure in the system unit modified to be a pointer to an
array of records
2021-10-06 07:44:04 +03:00
nickysn
afb9c2ae94 + implemented environment variables support in the DOS unit for the WASI target
git-svn-id: trunk@49551 -
2021-06-23 23:15:15 +00:00
nickysn
c275c3c7f2 + implemented Randomize
git-svn-id: trunk@49550 -
2021-06-23 22:11:11 +00:00
nickysn
ba1dcfc6a4 + also resolve absolute paths in ConvertToFdRelativePath
git-svn-id: trunk@49535 -
2021-06-23 15:44:17 +00:00
nickysn
bc08af99b0 + initial implementation of resolving relative paths
git-svn-id: trunk@49524 -
2021-06-22 23:14:33 +00:00
nickysn
ba3383f7e3 + keep also the fds for the current dirs
git-svn-id: trunk@49523 -
2021-06-22 22:44:20 +00:00
nickysn
d3ce008cd3 + initial implementation of GetDir() for WASI
git-svn-id: trunk@49522 -
2021-06-22 22:35:32 +00:00
nickysn
0a384b0905 * enumerate preopened dirs on startup and store them in a list, accessible via global vars in the system unit
git-svn-id: trunk@49521 -
2021-06-22 20:51:19 +00:00
nickysn
e7a1ef962e + partially implemented the initial enumeration of preopened dirs
git-svn-id: branches/wasm@48356 -
2021-01-23 21:14:33 +00:00
nickysn
7799cd0f80 + implemented ParamStr and ParamCount for WASI
git-svn-id: branches/wasm@48355 -
2021-01-23 17:59:23 +00:00
nickysn
0f50c85b44 * prefixed all wasi api functions with __wasi_, similar to the C header
git-svn-id: branches/wasm@48353 -
2021-01-23 16:29:31 +00:00
nickysn
d5b8f6ac7a + added all the WASI API types and constants
git-svn-id: branches/wasm@48352 -
2021-01-23 16:21:53 +00:00
nickysn
04828b22f6 * WASI API consts, types and procs moved to separate include files
git-svn-id: branches/wasm@48351 -
2021-01-23 15:19:21 +00:00
nickysn
5dd7e116ce + added header comment with copyright and license info to the WASI system unit
git-svn-id: branches/wasm@48350 -
2021-01-23 14:56:23 +00:00
nickysn
6f20e32ddd + added argc and argv (not yet initialized), so that unit objpas compiles
git-svn-id: branches/wasm@48347 -
2021-01-23 07:34:09 +00:00
nickysn
a28eb39f4b + implemented WASI file close
git-svn-id: branches/wasm@48344 -
2021-01-23 07:04:32 +00:00
nickysn
fb29456a0a * fixed parameter of DebugWriteHexLongWord
git-svn-id: branches/wasm@48339 -
2021-01-23 05:00:21 +00:00
nickysn
cdb74f034c + call InitSystemThreads in the system unit startup for WASI
git-svn-id: branches/wasm@48313 -
2021-01-22 03:01:55 +00:00
nickysn
c8760b12d4 + initial attempt for implementing do_open. Not working yet
git-svn-id: branches/wasm@48311 -
2021-01-22 02:43:54 +00:00
nickysn
85ea2b9b11 + added the WASI errno constants
git-svn-id: branches/wasm@48309 -
2021-01-22 01:35:12 +00:00
nickysn
9b173ac119 + implemented do_isdevice for WASI
git-svn-id: branches/wasm@48308 -
2021-01-22 01:26:35 +00:00
nickysn
d6038c5709 + implemented do_read for WASI
git-svn-id: branches/wasm@48307 -
2021-01-22 01:04:19 +00:00
nickysn
7f60637c92 - removed the system unit startup code debug output
git-svn-id: branches/wasm@48303 -
2021-01-22 00:31:16 +00:00
nickysn
204b0a777d + implemented system_exit for WASI
git-svn-id: branches/wasm@48302 -
2021-01-22 00:28:13 +00:00
nickysn
d8f2d85474 * switch to wasi_snapshot_preview1
git-svn-id: branches/wasm@48301 -
2021-01-22 00:19:10 +00:00