Minimal changes to get m6502 to compile (won't work)
[Apout.git] / LIMITATIONS
1 Bugs in Binaries
2 ----------------
3
4 One of the V5 C compiler passes requires -DZERO_MEMORY: it must not
5 initialise a variable properly. V5 and V6 ar(1) do not close a file
6 descriptor after writing has finished. If Apout is compiled with
7 stream buffering, when this file is copied it is truncated. Either
8 turn off Apout stream buffering (a performance penalty), or patch
9 ar.s to behave itself. The patch is:
10
11 *** ar.s.orig   Thu Jan 14 09:40:46 1999
12 --- ar.s        Thu Jan 14 09:41:12 1999
13 ***************
14 *** 444,449 ****
15 --- 444,451 ----
16         bes     crterr
17         mov     r0,afo
18         sys     write; magic; 2
19 +       mov     tfo,r0          / need to close before reading
20 +       sys     close
21   1:
22         mov     tfi,r0
23         sys     read; buf; 512.
24
25
26 Floating-point Limitations
27 --------------------------
28
29 PDP-11 doubles are treated as floats. FEA/FEC don't exist.
30 FP errors are not dealt with. Mistrust FP results for now.
31
32 Limitations for 7th Edition Emulation in Apout 2.3
33 --------------------------------------------------
34
35 Note that V5 and V6 binaries are considered V7 binaries. Overlay
36 binaries (type 0405) are not recognised.
37
38 The errno values on the native system are not translated back to
39 the V7 errno values. There is normally a 1-to-1 mapping, but V7
40 only had 32 errno values; native errno values above this are going
41 to confuse the emulated application.
42
43 The following system calls are not implemented, and return an 
44 EPERM error to the application: phys(2), prof(2), ptrace(2),
45 acct(2), mount(2), umount(2), times(2). The following system
46 calls are ignored: lock(2), stime(2).
47
48 The following systems calls are only partially implemented:
49
50     signal(2):          Only SIG_DFL and SIG_IGN are implemented.
51     stty(2), gtty(2):   These should work, but V7 stty(1) doesn't work.
52     ioctl(2):           Only enough to emulate stty(2) amd gtty(2).
53
54 The emulated applications use the native filesystem. Native filenames bigger
55 than 14 characters are truncated to 14 characters before being passed to
56 the application. In a similar way, inode numbers bigger than 65,536 are
57 truncated modulo 65,536 before being passed to the application.
58
59 Limitations for 5th & 6th Edition Emulation in Apout 2.3
60 --------------------------------------------------------
61
62 There seems to be a bug in V5/V6 ctime() which stops dates after
63 November 1999 being displayed correctly. Apout works around this
64 problem by modifying dates returned from system calls to be in
65 the year 1998 if they are 1999 or later.
66
67 Limitations for 2.9BSD Emulation in Apout 2.3
68 ---------------------------------------------
69
70 At present, 2.9BSD binaries are treated as V7 binaries, so the limitations
71 above apply. This also means that overlays are not understood, and also the
72 2.9-specific system calls have not yet been implemented.
73
74 Limitations for 2.11BSD Emulation in Apout 2.3
75 ----------------------------------------------
76
77 Flags passed as arguments to the 2.11 syscalls are promoted to 32-bit
78 ints and passed to the native syscall. The errno values on the native
79 system are not translated back to the 2.11 errno values. To find out
80 what syscalls have been implemented, grep for the word DONE in bsdtrap.c.
81
82 The following 2.11 syscalls are not handled:
83
84         S_GETSOCKOPT, S_SETSOCKOPT, S_SELECT,
85         S_RECVMSG, S_SENDMSG, S_SENDTO, 
86         S_SIGBLOCK, S_SIGPAUSE, S_SIGRETURN,
87         S_SIGSETMASK, S_SIGSTACK, S_SIGVEC
88
89 Limitations for 1st Edition Emulation in Apout 2.3
90 --------------------------------------------------
91
92 This is still in the experimental stages, with some problems with time
93 values. The KE11A emulation is also incomplete. However, the following
94 0405-magic binaries from Dennis Ritchie's s2.tar archive are known to work:
95
96         cat, cp, date, echo, ls, mkdir, sh, wc
97
98 Most of the others seem to work as well, but I haven't tested them completely.
99 The list of 0405-magic files on the s2 archive is:
100
101         bin/:           bin/mv
102         bin/ar          bin/od
103         bin/bas         bin/pr
104         bin/cat         bin/rew
105         bin/chball      bin/rmdir
106         bin/check       bin/roff
107         bin/chown       bin/sh
108         bin/cmp         bin/skip
109         bin/cp          bin/sort
110         bin/date        bin/stat
111         bin/db          bin/stty
112         bin/dc          bin/su
113         bin/df          bin/sum
114         bin/du          bin/tap
115         bin/echo        bin/tm
116         bin/ed          bin/tty
117         bin/exit        bin/wc
118         bin/form        bin/who
119         bin/goto        bin/write
120         bin/if          etc/getty
121         bin/login       etc/glob
122         bin/ls          etc/init
123         bin/mail        etc/msh
124         bin/mesg        /tc/suftab
125         bin/mkdir
126
127 The following 1st Edition system calls are not yet emulated: GTTY, STTY, TELL.
128
129 Limitations for 2nd Edition Emulation in Apout 2.3
130 --------------------------------------------------
131
132 The few 2nd Edition binaries with 0407-magic on the s2 archive can now
133 be run with Apout. Essentially, they receive the same environment as
134 the 1st Edition binaries, with a few small syscall differences. Note
135 that, at present, I don't have a copy of the V2 manuals, so I can
136 guarantee that 2nd Edition emulation still needs work.
137
138 However, the emulation is good enough to allow the C compiler on the s2
139 archive to compile the last1120c C compiler on Dennis Ritchie's homepage.
140
141 The list of 0407-magic files in the s2 archive is below. I have starred
142 those binaries that I know work with Apout.
143
144  *  bin/as                  usr/fort/fc1
145  *  bin/cc                  usr/fort/fc2
146     bin/ds                  usr/fort/fc3
147     bin/fc                  usr/fort/fc4
148     bin/find                usr/jack/a.out
149  *  bin/ld                  usr/jack/x.o
150     bin/maki             *  usr/lib/c0
151     bin/nm               *  usr/lib/c1
152  *  bin/size                usr/lib/crt0.o
153     bin/strip               usr/lib/fr0.o
154     bin/un                  usr/sys/a.out
155  *  etc/as2