====== Mid late May rambling ====== **2025-05-18** No work done this week (again). **2025-05-25** No work done this week either. Have an overview of all the work done on lDOS / lMS-DOS. ===== lDOS progress ===== **2025-05-18** * 256 sectors per cluster: lDOS boot sectors, lDOS iniload, lDOS kernel. Missing from SYS and FORMAT (and FDISK?). (FastSeek / FastOpen also missing?) * LBA support: lDOS kernel bio r/w. Missing from bio format interface(?), FORMAT, FDISK. * LFN awareness: lDOS kernel bio and dos will not misdetect LFNs as volume labels. * HMA and UMA use: lDOS kernel will make use of the HMA and UMA (multiple UMA providers supported). DOSCODE can be relocated to HMA, UMA, or LMA. DOSDATA can be relocated to UMA or LMA. * Kernel bio and dos integration: Unlike MS-DOS v5 the bio and dos modules are linked together, and some use is made of this integration. There is a single DOSCODE group that includes most code of both bio and dos, and DOSDATA likewise. Each group is addressed using a single segment. For the DOSCODE in HMA, segment 0FFFEh is used as the Code Segment. * DOSENTRY shrinkage: The part of DOSENTRY that is hardcoded to live at linear address 00600h is smaller than 1.5 KiB usually (if not including the PC AT hdd read ROM-BIOS fix). If the HMA and UMA are fully utilised (eg in dosemu2) then below 3 KiB of the LMA are in use. * A20 is enabled on all dos and bio entrypoints if the kernel uses the HMA (ie, DOSCODE is relocated into the HMA). * Compatibility options allow bouncing HMA or UMA+HMA sector accesses through the DOSENTRY LMA buffer. Some heuristic is used to detect the need for this automatically, by default. * COMPAT=ALTAH for using byte at 70h:61Bh as CON lookahead buffer. Default is a different, less compatible address. * COMPAT=DOSDATAFIRST to act more like less sophisticated kernels, placing the DOSDATA segment first (into the LMA) before processing any DEVICE= or INSTALL= directives. * COMPAT=DOSDATAEARLY to place DOSDATA into the UMA as soon as sufficient UMA space is provided to the DOS. This means that the final DOSDATA relocation is done before processing subsequent DEVICE= and INSTALL= directives. * COMPAT=HIDEDOSENTRY to hide the DOSENTRY MCB at 00600h, using the next MCB as the first MCB. Improves compatiblity with software expecting the device headers and interrupt entrypoints live before the first MCB. * COMPAT=HIDEDOSDATAFIRST, in conjunction with DOSDATAFIRST to hide the DOSDATA MCB. Improves compatibility with software expecting DOSDATA lives before the first MCB. * DOSENTRY is now addressed with segment 60h, except for: * Many entrypoints are addressed with segment 26h. * Device headers of the bio are addressed with segment 70h, for compatibility. * All builds of the kernel are now single-file kernels, eliminating a host of problems with dual-file kernels. (SYS tool and FORMAT /S support are unmodified but should not be used to set up a bootable drive any longer. Instead, use INSTSECT and copy ldos.com and command.com manually.) * Hard disk partitions are logged in in this order: * Up to one primary partition per unit, as many units as specified in DL by int 13.08.dl=80 * Up to one extended partition per unit, with none or one logical partition per EPBR. * Extended partitions of type 5 and 0Fh are supported. * FAT FS partitions of type 1, 4, 6, or 0Eh are supported. * FAT12 or FAT16 partitions are supported (no change from lMS-DOS basis). * lDOS iniload query patch site allows modifying lDOS initial loader operation. Not yet used by the kernel. * lCFG block allows configuring inicomp progress display and kernel's debugger detection. * lDOS kernel command line can be passed by prior loader: * PREPEND= and APPEND= for adding to the configuration file. * CONFIG=, ALTCONFIG=, OLDCONFIG= for changing the configuration file name used. * New configuration file directives: * DEVICEHIGH, INSTALLHIGH * INSTALLLAST, INSTALLLASTHIGH * SHELLHIGH * COMPAT * Default configuration files are searched in the order "ldos.ini" then "config.sys" * Add debugger detection to avoid installing int 1 and int 3 handlers. * Set SD name for system MCB holding sub-MCB memory blocks. * [[https://hg.pushbx.org/ecm/msdos4/rev/98b64c680862|Only reject]] "MSDOS3.0", "IBM 3.0", or "OS2 3.0" BPBs. * [[https://hg.pushbx.org/ecm/msdos4/rev/0b3b2ac51a84|Do not display an error]] after INSTALL= directive process returns with a different return type than TSR return. * [[https://hg.pushbx.org/ecm/msdos4/rev/697323693021|Pass CX from redirector Extended Open/Create]] to DOS caller. * [[https://hg.pushbx.org/ecm/msdos4/rev/1704aa5abb48|Pass attributes to redirector Extended Open/Create]]. * UPBs store the unit absolute offsets of partitions in their hidden sectors, without storing a cylinder offset (allowing logical partitions not on cylinder boundaries). * Only the LBA numbers are used to access partitions, even in CHS access mode. That means the CHS values on disk need not match those used to access the unit. * [[https://hg.pushbx.org/ecm/msdos4/rev/d6d1d79b3d3f|Work around the Xi8088 ROM-BIOS bug]] upon detecting LBA support. * [[https://hg.pushbx.org/ecm/msdos4/rev/e58e166f626e|Add FreeDOS style function 21.33FF]] to return a version string. * Kernel, sharer, and format all build with GNU make, NASM, WarpLink, x2b2, bash, dosemu2 (plus compression tool). * Kernel may be compressed using lDOS inicomp kernel stage. **2025-05-25** (Some points repeated from the above.) * Query generic IOCTL support implemented in [[https://hg.pushbx.org/ecm/msdos4/rev/1ad7590e589e|block device]], [[https://hg.pushbx.org/ecm/msdos4/rev/dcd6f1591637|PRN/LPTx device]], and [[https://hg.pushbx.org/ecm/msdos4/rev/fb8bd6826fdd|DOS kernel]] (MS-DOS v5 compatible). * Generic IOCTL [[https://hg.pushbx.org/ecm/msdos4/rev/a675bb2cb91d|sets AX to zero on success]] (according to the Interrupt List). * (Repeat:) [[https://hg.pushbx.org/ecm/msdos4/rev/0f185a018665|Add debugger detection to the early kernel startup]], allowing to leave alone the int 1 and int 3 vectors if running with a debugger. * [[https://hg.pushbx.org/ecm/msdos4/rev/c288ebf7eadb|Add flags to debugger detection]]: 1 detect / do not detect, 2 assume present / assume absent, 4 check only if valid vector (segment != 0 and offset != -1), 8 check only if IISP entrypoint header present. * [[https://hg.pushbx.org/ecm/msdos4/rev/814a8eb71ce4|Pass the available memory size to device driver init]] in the break address field (MS-DOS v5 compatible). * (Repeat:) Set "SD" name for System Data container MCBs (MS-DOS v5 compatible) * Shell: [[https://hg.pushbx.org/ecm/msdos4/rev/cf97c97c1d9b|Allow to operate without Extended Attribute (XA) functions]] in COPY and TYPE. * Shell: [[https://hg.pushbx.org/ecm/msdos4/rev/609bbd2ecff2|Allow trailing backslash]] in COPY destination * Create trace listing files for msbio/msdos (combined), shell, sharer, format * (Repeat:) Work around Xi8088 bug during LBA detection. * (Repeat:) Combine msbio and msdos into a single kernel file, later also linked together. * (Repeat:) Load kernel payload to 00600h and use the space from 00610h to 006FFh by DOSENTRY. * (Repeat:) Allow compressing kernel using lDOS inicomp stage. * In mknode.asm [[https://hg.pushbx.org/ecm/msdos4/rev/e8e229997fb9|fix to increment high word of sector number]] on directory init (also fixed in MS-DOS v5). * Shell: In DIR [[https://hg.pushbx.org/ecm/msdos4/rev/af3f41eecc58|allow free space cluster size >= 64 KiB]] and handle total overflowing 32 bits. * (Repeat:) Support 128 and 256 sectors per cluster. * (Repeat:) Add FreeDOS style function 21.33FF * Allow relocating DPBs and UPBs to HMA, UMA, or LMA. * Allow allocating SFTs, CDS array, FCB SFTs, buffers in HMA, UMA, or LMA. * Fix, [[https://hg.pushbx.org/ecm/msdos4/rev/2644a793592c|FAKE_COUNT should be 1 byte]], not 255 bytes. * In CHECKSINGLESIDED [[https://hg.pushbx.org/ecm/msdos4/rev/054c5d32de04|only modify Sectors per Cluster if BPB]] is a 2.0, 3.0, or 3.1 BPB. (Actually checks for SpC field == 2 and OEM ends in "2." + wildcard byte or in "3.0" or "3.1".) * Allow [[https://hg.pushbx.org/ecm/msdos4/rev/595e3fc43f6f|odd diskettes]] and [[https://hg.pushbx.org/ecm/msdos4/rev/759e0cc9fd9a|hard disk partitions]], eg with 1 FAT * Adapt MS-DOS v2 buffer handling for us, doing away with the hash buckets and EMS support. * [[https://hg.pushbx.org/ecm/msdos4/rev/3d5f0b62b8d7|Support int 2F.1261 from PTS-DOS]] to get first UMCB segment. * Support UMA (from old lDOS sources), 21.5802/.5803, allocate UMBs and add them to the UMCB chain. * [[https://hg.pushbx.org/ecm/msdos4/rev/18b2af3c7ed0|Support 21.3306 version call]] (MS-DOS v5 compatible). * [[https://hg.pushbx.org/ecm/msdos4/rev/d7194668d556|Pass an empty environment to shell]], fixing FreeCOM load. * Support HMA access functions (MS-DOS v5 and [[https://hg.pushbx.org/ecm/msdos4/rev/42d03221f4ea|MS-DOS v7 compatible]] for [[https://hg.pushbx.org/ecm/msdos4/rev/7676d68b4598|the most part]]). * Support [[https://hg.pushbx.org/ecm/msdos4/rev/1a8906752b66|FreeDOS extension call 21.4B80]] and [[https://hg.pushbx.org/ecm/msdos4/rev/49f66d9e6f0f|INSTALLHIGH=, SHELLHIGH=]] * Support [[https://hg.pushbx.org/ecm/msdos4/rev/8249f4c5a5c7|basic 21.4B05 call]] (only disables A20). * Fix handle.nas [[https://hg.pushbx.org/ecm/msdos4/rev/752d644ee9e7|Align_Buffer to work with HMA address]] without wrapping to the LMA. * [[https://hg.pushbx.org/ecm/msdos4/rev/b46b2d46ec25|Check for too large configuration file]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/d3d5a435add7|Fix INSTALL= command line contents]] if the directive ends in an LF only. * Do not patch DOSCODE section for 96TPI support, instead read a flag at run time. * (Repeat:) Prefer the configuration file name ldos.ini * [[https://hg.pushbx.org/ecm/msdos4/rev/3ca8e29afb97|Implement disk change callout]] * Add Interrupt Restoration Table at 70h:100h * Sharer: [[https://hg.pushbx.org/ecm/msdos4/rev/846b6440beb7|Check int 20h opcode for valid PSPs]]. * Sharer: [[https://hg.pushbx.org/ecm/msdos4/rev/3556dbcf515f|Search UMCB chain for PSPs]]. * Update version number to 5.26 * Sharer: [[https://hg.pushbx.org/ecm/msdos4/rev/2064f79ca13e|Add MCB loop detection]]. * [[https://hg.pushbx.org/ecm/msdos4/rev/b71e83f74e67|Add a startup message]] to the kernel. * Sharer: [[https://hg.pushbx.org/ecm/msdos4/rev/9eace73ca4b1|Use an IISP header]] for the int 2Fh entrypoint. * On int 19h [[https://hg.pushbx.org/ecm/msdos4/rev/47f2f4266564|clear HMA's VDISK header]] (MS-DOS v5 compatible). * [[https://hg.pushbx.org/ecm/msdos4/rev/7156911b1928|Address most HMA allocations]] using segment FFFEh (and subsequently [[https://hg.pushbx.org/ecm/msdos4/rev/994ef7584893|fix a bug introduced with the segment change]] during buffer allocation). * Use Leave2F/Leave13 rather than ''retf 2'' to preserve IF, TF, DF. * In exec.nas [[https://hg.pushbx.org/ecm/msdos4/rev/55c54c4001a0|do not try JB after DEC]]. * In sysconf.nas TryQMemory [[https://hg.pushbx.org/ecm/msdos4/rev/19228433ec62|sets CY now]]. * Use S MCBs throughout except for DEVICE= allocation of device driver. * Allocate init boot segment using DOS, and free it later. * [[https://hg.pushbx.org/ecm/msdos4/rev/654a78bcd932|Free sysinit memory only on successful shell exec]]. * (Repeat:) Move default ALTAH variable, add COMPAT= setting for compatible one. * (Repeat:) Add HMA, HMA+UMA, or always bouncing sector accesses through DOSENTRY/LMA buffer. * [[https://hg.pushbx.org/ecm/msdos4/rev/8d668506832a|Set default drive to match what was passed]] as load unit and hidden sectors to kernel load. * In msioctl.nas [[https://hg.pushbx.org/ecm/msdos4/rev/8e2725fe32b9|fix SET_MEDIA_FOR_FORMAT if DPT segment is nonzero]] * [[https://hg.pushbx.org/ecm/msdos4/rev/eba7d38ff1c6|Add TAGCRASHDOS entry]] that displays a message if a tag mismatch occurs. * Allow to either protect the first UMCB or enlarge the LMA into the UMA if an UMB directly after the LMA is allocated. **2025-05-18** What doesn't work yet: * FAT32 * LFN support in shell or kernel * FAT+ * Formatting may not work, especially if the file system is not CHS-addressable. * FDISK and FORMAT are not updated to work with LBA or >64 sectors per cluster yet. {{tag>msdos4 ldos ldosboot}} ~~DISCUSSION~~