about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-10-01 22:48:50 -0700
committerKartik Agaram <vc@akkartik.com>2018-10-01 22:48:50 -0700
commit29ab43973a2e9822d84b564e314b4af5c58c4684 (patch)
tree8af49d966c5a1aa05da1e9d2c631085198e91c0d /subx
parent839dc88dc0439ae3f32c8c0f7650f32b09f311cc (diff)
downloadmu-29ab43973a2e9822d84b564e314b4af5c58c4684.tar.gz
4648
Diffstat (limited to 'subx')
-rw-r--r--subx/020syscalls.cc1
-rwxr-xr-xsubx/test_apps8
2 files changed, 9 insertions, 0 deletions
diff --git a/subx/020syscalls.cc b/subx/020syscalls.cc
index 5fdc40f6..c94785bd 100644
--- a/subx/020syscalls.cc
+++ b/subx/020syscalls.cc
@@ -82,6 +82,7 @@ void process_int80() {
     // Ignore most arguments for now: address hint, protection flags, sharing flags, fd, offset.
     // We only support anonymous maps.
     Reg[EAX].u = new_segment(/*length*/read_mem_u32(Reg[EBX].u+0x4));
+    trace(91, "run") << "result: " << Reg[EAX].u << end();
     break;
   default:
     raise << HEXWORD << EIP << ": unimplemented syscall " << Reg[EAX].u << '\n' << end();
diff --git a/subx/test_apps b/subx/test_apps
index 9be51ab1..988e81ae 100755
--- a/subx/test_apps
+++ b/subx/test_apps
@@ -121,6 +121,14 @@ test `uname` = 'Linux'  &&  {
   grep -vq 'F' ex11.out  # no test failures
 }
 
+echo ex12
+CFLAGS=-g ./subx translate examples/ex12.subx  -o examples/ex12
+test `uname -m` = 'i686'  &&  git diff --quiet examples/ex12
+CFLAGS=-g ./subx run examples/ex12  # final byte of mmap'd address is well-nigh guaranteed to be 0
+test `uname` = 'Linux'  &&  {
+  examples/ex12  # final byte of mmap'd address is well-nigh guaranteed to be 0
+}
+
 echo factorial
 CFLAGS=-g ./subx translate *.subx apps/factorial.subx  -o apps/factorial
 test `uname -m` = 'i686'  &&  git diff --quiet apps/factorial
n203'>203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290