From: Bart O. <bar...@us...> - 2007-05-16 04:29:32
|
Part 2... On 1/1/07, Eric Auer <er...@co...> wrote: > inthndlr.c: Toms version modifies DL on return from int 21.3301 > (set ctrl c flag), while the CVS does not - CVS is better. TA -- discussed earlier > The CVS version uses the new dpb16to32 function for shorter code. CN > TOMS version has some interesting extra error handling, maybe > this can be added to the CVS version: Around line 430, Tom does > "if ErrorMode && AH>=0c && AH neither 30 nor 59 then { ErrorMode=0; > fnode[0].f_count = 0; fnode[1].f_count = 0; }" - in other words, > for the non-reentrant DOS functions, make sure to mark all near > fnodes as unused on entrance to int 21. > Later, around line 1550, if not both fnode counts are 0, force > them to be 0, but display a warning if ErrorMode was 0. Explanation: > An int24, for example in FindFirst, is handled by an app by NOT > returning to the kernel (possible). That way, resources are never > freed and ErrorMode is never reset... > Note that Tom only forces fnode freeing, not ErrorMode reset. TA. This is also in the UNSTABLE kernel, to be exact I ported it from there. > FatGetDrvData modifies AX in Toms version and AL in CVS, which of > the two is better? See fcbfns.c > The FcbParseFname call of int 21.29 modifies AL directly in CVS, > while Toms version also updates rc. WHICH OF THE TWO IS BETTER? CN (both) > Tom re-orders some register writes, which looks as if he tried > to set lr.ES / lr.DI as late as possible. Why? Optimizes better? TA. Probably to allow the compiler to do common tail optimization. It saves a few bytes. > The CVS version returns CX = 0 on int 21.30, while Tom returns > the REVISION numbers. A comment in CVS tells that CX must be 0 > for 32RTM compatibility - found by Michael. > The int 21.36 implementation follows the different DosGetFree > parameter / return value structure in both versions. > The function int 21.??0a, set extended error, looks more optimized > in the CVS version. Both seem to have the same effect. COMMENTS? > In the CVS version, int 21.5f checks if cdsp->cdsDpb has a zero > offset, according to comments this checks if a drive is physical. > Sounds good...? This affects the handling of the AL==7 case. > The CVS version provides a more extended stub for the DBCS API > int 21.63xx ;-). CN > The int2F_12_handler of the CVS version supports several new > functions: 26 (open), 27 (close), 29 (read). HOWEVER, the new > code for function 28 (seek) is disabled. WHY? > There is also a SET DOS VERSION DX interface at function 2f. CN > - intr.asm: Toms version has the following additional code: > global INTR / INTR: INTR (between the no_read_error: ret and > the segment INIT_TEXT around line 125). What is that used for? > Where is INTR defined? TNA right at the beginning: %macro INTR 0 called by Tom in two places. > - ioctl.c looks BETTER IN TOMS version: r_command of the request > header is set based on al, using a table with the entries > 0,0,C_IOCTLIN,C_IOCTLOUT,C_IOCTLIN,C_IOCTLOUT,C_ISTAT,C_OSTAT, > C_REMMEDIA,0,0,0,C_GENIOCTL,C_GENIOCTL,C_GETLDEV,C_SETLDEV, > C_IOCTLQRY,C_IOCTLQRY at slots 0..11 (hex). The CVS code, on > the other hand, spreads this information over two switch / case > areas which first set a nMode variable and later set r_command. TA: This is a little optimization that is also present in the UNSTABLE ioctl.c (which takes things a bit further). The table saves doing everything seperately in switch cases. Actually ioctl can be made a lot simpler with that table. Done in UNSTABLE, but I could do better myself (saving ~200 bytes in the process), not applied yet. > - main.c has an updated copyright string year in the CVS version. > Other differences seem to be whitespace-only around line 570 and > correcting a typo: TOM has the corrected "boot from" string around > line 735, while the CVS version writes "booot from". One more diff > is around line 690: Is EmulatedDriveStatus "nothing/void" (Toms > version) or is it "STATIC int" (CVS version)...? TA (for booot), the rest is CN. > - memmgr.c: The CVS version allows double free of memory blocks, > which is necessary to be compatible with a flaw in QBasic 4... CN > - nls.c: TOMS version quotes quite some ASM code and sets many > registers before calling intr(0x2f,&r): BH=0x14 BL=subfct CX=bufsize > SI=(short)&nlsinfo BP=bp BX=cp DX=cntry ES:DI = pointer bp. > The CVS version, on the other hand, uses call_nls(subfct, > &nlsInfo, bp, cp, cntry, bufsize, buf, id). WHICH OF THEM IS BETTER? TO (none :) I applied something else that puts "id" in the high part of a long, and no intr. It's a tricky variable because SS!=DS in that code. > - proto.h: The parameters / return types differ for DosGetFree, > FcbParseFname and FatGetDrvData. The CVS also has dpb16to32... CN > - serial.asm: The CVS version has ComInStat, which allows polling > the serial port status. Implemented based on a feature request > from our SourceForge trackers. The tests for DSR / al,20h of the > GetComStat output are commented out in the CVS version, better? CN > - sys.c: Tom uses fat32readwrite... as prototype, CVS uses > int fat32readwrite - WHICH return type is better? CN. Newer OW doesn't like it. > TOM uses > the OEMID string "FRDOS5.1" which matches MS style better > than "FreeDOS ": The string should be 5 uppercase letters, > 1 digit, dot, another digit. TA Bart |