testio.sh (see other side) arranges via mtip to input 0123456789012345678901… at a slow rate, to testio.lnx, while running testio.lnx
Key:
italics: kprintf output
Plain text: output from write
Underlined text: echoes from input to read
testio.sh <system number>
… reboot output
Tutor> ~downloading testio.lnx
.........Done.
Download done, setting EIP to 100100.
Tutor> GO 100100
Running with device TTY1
ioinit();
Trying simple write... write(ldev,"hi!\n",4);
write of 4 returned 4 (write returns with all 4 chars still in queue)
<doing delay>
hi! (output during delay loop)
Trying longer write write(ldev, "abcdefghi", 9)
abcwrite of 9 returned 9 (abc out, write returns with full queue, 6 chars)
<doing delay>
defghi (last queue-full output during delay loop)
Trying write of 80-char string... got = write(ldev, buf, BUFLEN);
AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXXYYZZ[[\\]]^^__``aabbccddee
write returned 80
<doing delay>
ffgghh012 (finish output during delay loop, 012 input)
Type some input to test typeahead while looping for delay... got = read(ldev, buf, 10);
<doing delay>
3456789 (finish input of 10 chars)
Got 10 chars into buf. Trying write of buf... write(ldev, buf, got);
0123
Trying another read right away... got = read(ldev, buf, 10);
4567890123456789 write(ldev, buf, got);
Got 10 chars on second read
0123
Now turning echo off-- control(ldev, ECHOCONTROL, 0);
Type some input, note lack of echoes... got = read(ldev, buf, 20);
<doing delay>
456789____________________ (input of 012345678901234567890, no echoes)
Trying write of buf... write(ldev, buf, got);
01234567890123
Asked for 20 characters; got 20
Exception 3 at EIP=00100110: Breakpoint
Tutor> ~q
Quit handler:
killing process 8291 Leaving board …
testio.sh, now in $cs444/hw1:
#!/bin/sh
# sapc.script used for hw1 grading
# Usage: testio.sh 5 to use system 5, etc.
# shell file to test hw1 through mtip
# ~S for longer wait, ~s for shorter wait
# use 20 secs for reset, then CR, then 1 sec, then ~d, 10 secs for download
mtip -b $1 -f testio.lnx << MRK
~r~S~S
~s~S~d~S~SGO 100100
~S~s0~s~s1~s~s2~s~s3~s~s4~s~s5~s~s6~s~s7~s~s8~s~s9~s~s0~s~s1~s~s2~s~s3~s~s4~s~s5~s~s6~s~s7~s~
s8~s~s9~s~s0~s~s1~s~s2~s~s3~s~s4~s~s5~s~s6~s~s7~s~s8~s~s9~s~s0~s~s1~s~s2~s~s3~s~s4~s~s5~s~s6~
s~s7~s~s8~s~s9~s~q
MRK