User Tools

Site Tools


blog:pushbx:2024:0512_early_mid_may_work

Early mid May work

2024-05-12

wwwecm scripts

Added msdos4 build. Added kernwrap as a dependency for edrdos and msdos4 builds.

MSDebug

Added the function checkend to the assembler, reject most cases of trailing garbage after the last accepted operand. Some cases remain, eg in, out, shifts and rotates. But many cases like mul, mov, xchg, push, and pop no longer accept trailing garbage.

Not fixed: mul al. 2 assembles like mul byte ptr [0002]

MS-DOS v4

MSLOAD deficiency

The MSLOAD stage is now replaced by lDOS iniload/drload and drkernpl. Apart from all the advantages of the single-file load already rehashed when I added it to Enhanced DR-DOS, there is one more problem unique to the MS-DOS v6 compatible load protocol as it was implemented by the MS-DOS v4 MSBIO.

This problem is that the start cluster of the MSDOS file and the data start are read from the directory entry and the data start passed by the prior (boot sector) loader. But the drive that is accessed is either the first diskette drive or the first hard disk drive. Only the high bit of the load unit passed in DL is used to determine which.

If the selected drive doesn't match the one that the kernel was actually loaded from then a crash is most likely.

This is not shared by lDOS drload because drload entirely depends on the prior loader to load the entire kernel file. In the case of lDOS iniload, there is code to read the remainder of the kernel file if it wasn't loaded yet but this code strictly uses the start cluster, data start, and (E)BPB passed from the prior loader so there is no possibility of confusing it for the wrong drive.

The prior Enhanced DR-DOS dual-file load likely had less problems than MS-DOS in this regard because it used the unit number and hidden sectors to "log in" the file system of which to load the DOS. Unlike other dual-file loads, it also scanned the root directory for its DRDOS file so it could not possibly receive a wrong start cluster.

Apart from all this, obviously the MSLOAD initial loader didn't support FAT32, LBA, or 128 or 256 Sectors per Cluster yet. lDOS iniload does support all of these, and drload doesn't need any file system access once it is entered.

This week's changes

inicomp

Add the define MODULE to tell the _INILOAD_CFG file what module is being built.

kernwrap

This is the shared script used by the lDOS forks of Enhanced DR-DOS and MS-DOS v4 now to wrap and compress the kernel. It supports lDOS iniload or drload as the outermost stage. iniload can use an image exe or second payload exe. The inicomp stage can be used as a depacker stage, combined with any one of 11 different compression methods. The checkpl stage can be used to do checksumming optionally.

By default, 4 output files are generated, two each with drload or iniload and two each with inicomp or without. However, in the temporary subdirectories additional compressed files with different methods may be found, so that a faster method like LZSA2 or a smaller method like LZMA-lzip may be chosen by the user.

The kernwrap script is lifted from lDebug's mak script with some additions for the version.asm and drkernpl.asm building as well as handling the drload alternatives (with .sys filename extensions).

The qemu image building is hardened to use the correct files more reliably. This was a problem because files like command.com and autoexec.bat were found in the current working directories sometimes.

A -D_TEST_PROGRAM switch is passed to iniload.asm when building the inicomp test program to avoid interference from the second payload exe settings.

Not yet done:

  • Allow to wrap FreeDOS kernel using kernwrap, requiring fdkernpl.asm instead of drkernpl.asm
  • Allow building no or different exe stages than version.asm
  • Add more support for lCFG blocks, FreeDOS kernel CONFIG blocks, or kernel command lines
  • Possibly adapt kernwrap for use by lDebug or RxDOS

Enhanced DR-DOS

lDebug

The only change since the Book8088 BIOS bugfix and the chstool Extension for lDebug fix in scanptab was an update to initialise AL to zero if the BOOT WRITE command uses LBA access function 43h to write the sectors.

lDOS MBR

I also submitted a report to Free FDISK about their normal MBR, pointing out some improvements. This may yet lead to either a better program on their side or even adoption of the lDOS old MBR instead.

lDOS boot

Stack Overflow: Boot loader debugging

Yesterday I debugged a boot loader submitted to stackoverflow.com. It turned out to have several flaws. To test it, I copied the source into an email that I sent to my self. Then in mutt I used the | (pipe) command on that mail and piped its output to a cat > FILE command to nondestructively save the contents to a file. Directly copying the text from the browser and inserting it into ConnectBot usually fails, destroying all linebreaks or worse.

You could leave a comment if you were logged in.
blog/pushbx/2024/0512_early_mid_may_work.txt · Last modified: 2024-05-12 20:31:02 +0200 May Sun by ecm