Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site medstar.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!whuxl!whuxlm!akgua!gatech!medstar!robin From: robin@medstar.UUCP (Robin Cutshaw) Newsgroups: net.unix-wizards,net.micro.pc Subject: Xenix286 Wonders, Bugs, and Patches... Message-ID: <168@medstar.UUCP> Date: Thu, 2-May-85 17:03:22 EDT Article-I.D.: medstar.168 Posted: Thu May 2 17:03:22 1985 Date-Received: Fri, 3-May-85 23:35:04 EDT Distribution: net Organization: Medical Systems Technology and Research, Inc., Atlanta, Ga. Lines: 250 Xref: watmath net.unix-wizards:13032 net.micro.pc:3841 For the most part I have been very impressed with Xenix286 3.0 for the AT. It seems to be fairly fast (except for c-compiles) and has greatly increased the amount of work that I can accomplish. The DOS cross-development utilities work very well (at least so far). I have just about completed a device driver for the IBM PC Network adapter. Anyone interested in beta testing please let me know. I will also be posting an article on writing device drivers for Xenix. I have found many wonderful buglets while porting code to Xenix. Many of these bugs were found while porting news2.10.2 and HACK, both of which now work wonderfully (with several modifications). Patches mentioned below will follow shortly. I would be interested in getting any other bugs that you find. adb: ./W 'abcd' writes 'cdcd' ?M just doesn't work /*/ IBM says this command is not and will not be supported, it will be removed from the documentation size of /dev/mem is short by 1/2K. See related variable in the kernel. .cshrc/.login : set ignoreeof in .cshrc should be in .login /* IBM agrees */ malloc : never returns more than ~32KB (actually 32634) /* IBM says "too bad" */ realloc : doesn't work in large model programs cc : order of args is important (like where you put -M2el) arrays of exactly 64K bomb the loader with "> 64K array" error, if you create an array of 64K-1 it will create a 64K array due to even alignment no crypt() in libc.a /* IBM says it cannot ship overseas with this */ error recovery is terrible (a missing ")" can bomb every following line) uname() returns NULL for nodename instead of the nodename in /etc/systemid, you can patch the kernel with your nodename at _utsname+8 (should not exceed 7 characters). exec() doesn't always work with the large model due to NULL being placed at the end of the arg list instead of (char *)NULL. This is a programmer problem more than a bug. system() doesn't work in the large model if the si register is non-zero. This is due to the exec() error above. They used NULL instead of (char *) NULL is compiling this routine, therefore any non-zero value on the stack prior to the exec call will not give the routine a zero terminator. The si register is on the stack prior to the exec call. BITFIELDS initialize wrong. Bytes are initialized instead of bits leading to massive initialization errors down the line. Don't auto-initialize them. The -MxTyyyy option is documented wrong. It is a hex value which defaults to 0xffff (don't use the 0x). All pointer arithmetic is 16 bits long (including the large model 32 bit pointers). This can get you into trouble if you were crazy enough to subtract pointers in differing segments. (ala HACK). The loader will only give you 4004 usable stack space. You must run stackuse to see if that will be enough (GASP!) and use the -F option (which uses a hex value i.e. -F 2000 for 8K) to increase stack space. This is GROSS!! Your program may bomb in one of several ways if you don't have enough stack allocated. Stackuse doesn't always work! The first data segment and stack segment share the same 64K segment, even in large model programs. Good luck. The O_NDELAY option to open() may not work in some instances. make : make -n doesn't always give you the sequence that make alone will make will run out of environment space if you have several things set in yours, especially if you run the c-shell tar : one must link /dev/mt1 to /dev/fd0 for tar to work (or your standard floppy device) tar doesn't back up empty directories (not sure that it should) tar uk 1150 won't work properly restor : Will not work if your environment is too large, may not work anyway function keys : These are user defined (GASP!!). It would have been much better for application programmers if they had just given them a standard escape sequence and been done with it. One cannot read their values back to see what they are currently set to do, so if you have multiple processes changing them you can get into lots of trouble. The SETKEY command does not allow the standard "^*" escapes so one cannot insert control characters with this command, use Esc Q x "sss". All fkey defs are erased when you log off. I will be posting a patch to read the fkeys and a patch to permanently set them to some "known" string. cursor keys/setkey : Only Home, left, right, up, and down, are recognized by the kernel. There is a table of strings to pass on to ttin for each key and the other cursor keys are set to NULL. I have a patch for this and will post shortly. stackuse : Will barf if more than a few programs to scan. Uses a .cu file for internal use, but this will overwrite the source file if only the .c part is used due to the filename length (BARF!) vi : Cannot edit large files. One must patch the stacksize in the x.out header from 0x8000 to 0x5000. Will post patch shortly. csh : No pushd-popd Doesn't notify you when a background task has finished #!/bin/sh doesn't work No unsetenv so you are stuck with it sh : #!/bin/sh will execute csh strings : The -o option for offsets doesn't work because they compiled the Berkeley version with "%D" instead of "%ld". This compiler doesn't recognize D as a valid format for printf. stty/gtty : If one passes the sgttyb struct to stty that came from gtty, the echoe bit will be cleared. dmesg : No man entry. /usr/adm/msgbuf must be present before the - option works as seen in crontab cron : Even if /etc/default/cron parameter CRONLOG is set to YES the file /usr/lib/cronlog must exist to get the log (it doesn't create it) uucp : A bug in S3 uucp make uustat unusable if /usr/lib/uucp and /usr/spool/uucp are not on the same file system due to us_open trying to link rstat.pid in /usr/spool/uucp to R_stat in /usr/lib/uucp. This was fixed in S5. The basic operations guide gives an incorrect example of a dialin/dialout script for crontab. A corrected one follows (/usr/lib/uucp/uuhourly) : # /bin/disable /dev/tty00 if ($status == 0) then sleep 20 /usr/lib/uucp/uucico -r1 /bin/enable /dev/tty00 endif EGA support : Xenix only supports compatability mode on the EGA. A patch has already been posted to the net to fix this (ret for initCRTC in /xenix). Does not support monochrome monitor on EGA. DOC : Many, many, many, misprints! Lots of spaces between switches and arguments (i.e. -M2eT xxxx where it should be -M2eTxxxx). In the device driver section replace all cent signs with [ and most | signs with ]. Patching the kernel : Permanent - adb -w /xenix - Online - adb -w /xenix /dev/kmem * $x * /m 18 0 e400 * ...your patches... DISKINFO : If you use a drive other than the standard type 2 you will have to patch the kernel. It seems that the diskinfo table which corresponds with the BIOS table of 15 is incorrect. Also, /boot will not work if you have more than 4 heads. I will post a patch to this shortly. /etc/hdinit will work for type 2 but not well for others. Shared data : The function sdget() must include the size param at all times and the mode param one the first call. This is documented wrong in the manual. Color : Color works well with the ansi escape sequences as described in the DOS manual. No multiple arguments are allowed though (i.e. Esc[#;#m must be Esc[#mEsc[#m). from .cshrc : if ($TERM == ansi) set prompt="Esc[36m# Esc[0mEsc[37m" # set blue prompt else set prompt="# " endif note : replace Esc with the escape character Questions, comments, bugs to me... -- ---- Robin Cutshaw Director of Systems Research, MedSTAR, Inc. ..{akgua,gatech,gacsr}!medstar!robin