SvarDOS / edrdos

Enhanced DR-DOS kernel and command interpreter ported to JWasm and OpenWatcom C
http://svardos.org/
Other
40 stars 4 forks source link

port DRDOS.SYS sources to JWasm #62

Closed boeckmann closed 4 months ago

boeckmann commented 4 months ago

The source is ported. There are some include files with a w as the last character, like pspw.equ. These are the JWasm versions of the files without the trailing w. Now that the RASM dependency is gone, these files can be copied over to the files without w, and the files with trailing w can be removed, after all references to them were changed.

ecm-pushbx commented 4 months ago

I've seen a few spots where you inserted a nop with a note to drop it later. May I take it you're identicalising the JWasm replacements to generate almost exactly the same binaries as were created by RASM?

boeckmann commented 4 months ago

It is because JWasm generates more efficient (size wise) instructions than RASM at some places. I inserted the NOPs to make binary comparison easier. The problem is, if the code differs in size, so will the label addresses. And this will result in a huge binary difference, making comparison really hard.

On the other side, using the more efficient encodings is desireable, so I flagged all the NOPs with a comment, so that they can eventually be removed.

Basically I followed this procedure:

Doing much of it manually comes with the chance of human error. Time will tell if something slipped through...

ecm-pushbx commented 4 months ago

Yes, this is what I call identicalising.

boeckmann commented 4 months ago

I will probably write down what where the pitfalls are when converting the source from RASM to JWasm. There were a few traps. Like the / operator doing a signed division on JWasm and JWasm doing 32-bit arithmetic instead of the 16-bit arithmetic RASM does, different semantics of the length operator etc... These things are sometimes only noticeable in the resulting code generated.

ecm-pushbx commented 4 months ago

I wrote about the DRBIO port, also mentioned on the forum. DRDOS will largely be more of the same.