New version of MSXDOS2.SYS

New version of MSXDOS2.SYS

by NYYRIKKI on 30-10-2017, 02:08
Topic: Software
Languages:

MSXDOS2.SYS is important part of MSX-DOS 2 operating system. Yet for some reason it has not been much revisited during the years. Now MRC regular NYYRIKKI has created a new MSXDOS2.SYS version 2.40 to replace the official version 2.30. This has all the same functionality.
Below some specs.

  • Japanese versions of error messages have been removed. COMMAND2.COM versions 2.4x are also English only, so this is in line with latest development.
  • The code has been revisited and reorganized (but not packed) to make it smaller and faster.
  • Some useless stuff which is only needed at boot time is no longer kept in TPA RAM afterwards.
  • The file size is reduced from 4870 bytes to 2565 bytes.
  • The amount of reserved TPA RAM has been reduced from 2566 bytes to 1922 bytes. How ever this memory consumption reduction can not be seen quite that straight forward since due to CP/M compatibility the MSXDOS2.SYS is always loaded to 256-byte boundary.

In this package there is small tool called TPAMEM.COM which you can use to compare the improvement of RAM usage on your setup.

When ever MSXDOS2.SYS gets interactive with you, it tends to raise blood pressure. "Insert COMMAND2.COM in drive A... Now, how on earth are you supposed to do that? Can't you see it's a hard disk!" or "Abort/Retry/Ignore... of which exactly none of these options takes me any further." Does this sound familiar?

Now in case of error it is possible to input an alternative drive to recover. Note that (like in 2.30) in this kind of error situation AUTOEXEC.BAT and REBOOT.BAT are skipped and they need to be manually executed if needed. Now also if you end up to error situation with no way out you can hit CTRL+B to jump start BASIC in order to fix the problem.

Sometimes you may also want to start BASIC instead of MSX-DOS2. Now, if you keep holding "B"-key down during boot time the computer will directly boot to BASIC and execute AUTOEXEC.BAS if it is present on boot drive. Please note: If you want to initialize DOS properly later you may need to start it with command CALL SYSTEM("A:\AUTOEXEC.BAT A:")

This version also implements a minor bug fix compared to version 2.31: If you load call extensions (such as ie. X-BASIC, SUPER-X or the MoonBlaster BASIC replayer), go to DOS, go back to BASIC and execute CALL-command the computer may crash. This has been fixed.

Relevant link: MSX-DOS2.SYS version 2.40 by NYYRIKKI

Comments (33)

By iamweasel2

Champion (462)

iamweasel2's picture

30-10-2017, 03:28

This is really great ! It is nice to see such improvements to MSX-DOS2. Smile

Are you planning FAT16 native support to DOS2 in future versions as well?

By ToriHino

Expert (115)

ToriHino's picture

30-10-2017, 07:31

Very nice to see these kind of improvements. One feature i would really like is the support for long filenames, although this might be more something for Command.com.

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

30-10-2017, 09:21

Native FAT16 support would require modification of DOS2 ROM... but if you plan to do that then it is better to update directly to Nextor that already has it among other new features... Naturally FAT16 driver (as any driver) could be build in to MSXDOS2.SYS just as well, but I think the current solution where it is as separate program is better since then user can optionally leave it out from AUTOEXEC.BAT if he has no need for it.

Pretty much same explanation goes for long filenames... It would require update both to COMMAND2.COM and to ROM. I guess update to ROM could be patched around like FAT16 driver does, but I see no task for MSXDOS2.SYS in this improvement either.

In general I have no plans to redesign DOS in any major way. I just updated this because I happened to take a look inside and realized that quite a lot of TPA memory could be saved without affecting compatibility negatively.

By gdx

Paragon (1647)

gdx's picture

30-10-2017, 10:26

Can we use this with any Disk-ROM v2.xx or this is for MSX turbo R only?

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

30-10-2017, 10:36

gdx wrote:

Can we use this with any Disk-ROM v2.xx or this is for MSX turbo R only?

It should work with any Disk-ROM v2.xx

By Pippo

Champion (283)

Pippo's picture

30-10-2017, 11:06

Wonderful, Nyyrikki!
You are always "The Great"! Smile

By KdL

Paragon (1037)

KdL's picture

30-10-2017, 14:13

An amazing update! Thank you so much!! Running Naked in a Field of Flowers

By tvalenca

Paladin (674)

tvalenca's picture

30-10-2017, 15:47

Loved that Qbert image!

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

30-10-2017, 15:55

tvalenca wrote:

Loved that Qbert image!

Indeed... Jelle over performed with that one Smile

By karloch

Paragon (1961)

karloch's picture

30-10-2017, 19:22

How nice! Just for me to understand: this is an upgrade to MSX-DOS 2 that do not require any new ROM, while NEXTOR does indeed need his own ROM. Am I correct?

By KdL

Paragon (1037)

KdL's picture

30-10-2017, 20:53

Hi NYYRIKKI, inside your MSXDOS2.SYS I found:

020E:   call   #f37d      
0211:   ret

I suppose you can put a jp #f37d , right?

A question over the opening info texts:

014A:   ld     de,#0aa8   
014D:   ld     c,#09      
014F:   call   #f37d      
0152:   call   #01bc      
0155:   ld     de,#0ae9   
0158:   ld     c,#09      
015A:   call   #f37d      
015D:   call   #024a      
0160:   ld     de,#0ae7   
0163:   ld     c,#09      
0165:   call   #f37d      

I would like a variant without these texts, could you propose a lite version in your MSXDOS2.SYS_V2.40.ZIP ? Nextor also has one! Wink Wink Wink

014A:   jr     #06    ; e.g. temporary patch 'mod-k1'
014A:   jr     #1c    ; e.g. temporary patch 'mod-k2'

By gdx

Paragon (1647)

gdx's picture

30-10-2017, 23:26

When we remove the condition with 0002Dh in the Disk-ROM, the DOS2 works fine on MSX1 if a Memory Mapper is inserted. By cons the parameter of the MODE command is always taken into account when it exceeds 40. Do you know where to change to correct this little flaw on MSX1?
Is it in the ROM or COMMAND2.COM?

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

31-10-2017, 14:45

KdL wrote:

I suppose you can put a jp #f37d , right?

Right... I must say that I didn't try to optimize everything to the max outside of TPA block as I did put the effort to where it really counts. There are still some clock cycles and bytes that could still be saved, but practically the effect to end result is so close to 0 that I considered it irrelevant.

Quote:

I would like a variant without these texts, could you propose a lite version in your MSXDOS2.SYS_V2.40.ZIP ? Nextor also has one! Wink Wink Wink

Yes, if you want a version with no start texts, I can compile you one... Not right now though.

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

31-10-2017, 14:47

gdx wrote:

When we remove the condition with 0002Dh in the Disk-ROM, the DOS2 works fine on MSX1 if a Memory Mapper is inserted. By cons the parameter of the MODE command is always taken into account when it exceeds 40. Do you know where to change to correct this little flaw on MSX1?
Is it in the ROM or COMMAND2.COM?

MODE command is part of COMMAND2.COM... I suggest you to contact TNI.

By KdL

Paragon (1037)

KdL's picture

31-10-2017, 22:20

yes thanks, no hurry Wink

By Manuel

Ascended (13469)

Manuel's picture

31-10-2017, 23:38

Quote:

4870 bytes to 2565

How the heck did you almost halve that binary size!?

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

01-11-2017, 05:14

Manuel wrote:
Quote:

4870 bytes to 2565

How the heck did you almost halve that binary size!?

Microsoft wanted to be able to compile the binary in one go and keep it quite easy to modify it also in the future. This approach caused the binary to have both empty space and doubled data... Instead of this I have pretty messed up binary building process "ready to explode at any given time" that actually compiles the same part of code 3 times, LOL. It is not pretty, but it generates lots of smaller & faster end result. I have also used smaller, but more limited data tables. They are more memory efficient, but it also meant that I needed to put the routines to correct order in memory pretty much one by one. It is quite a puzzle to maintain it without breaking it, but it's the end result that counts. Smile

By gdx

Paragon (1647)

gdx's picture

01-11-2017, 09:18

You have also added the display of the available RAM and the number of drives at start. Cool

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

01-11-2017, 09:35

gdx wrote:

You have also added the display of the available RAM and the number of drives at start. Cool

Yeah, well... I thought it would be more useful than displaying the MSXDOS2.SYS version number that has no use to anyone... I was also thinking about dropping directly to prompt (like KdL wanted it), but then I thought that it could be considered a bit too ascetic and in case of some weird error situation it would be harder to identify if even MSXDOS2.SYS was loaded or not.

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

01-11-2017, 11:19

karloch wrote:

How nice! Just for me to understand: this is an upgrade to MSX-DOS 2 that do not require any new ROM, while NEXTOR does indeed need his own ROM. Am I correct?

Yes

By edoz

Paragon (1968)

edoz's picture

01-11-2017, 21:20

You are my hero NYYRIKKI Big smile Big smile

By Manuel

Ascended (13469)

Manuel's picture

01-11-2017, 22:11

I'm now considering to start a NYYRIKKI fan club... who joins?

By Meits

Scribe (4525)

Meits's picture

01-11-2017, 22:34

Manuel wrote:

I'm now considering to start a NYYRIKKI fan club... who joins?

You can join mine

By ray2day

Champion (414)

ray2day's picture

02-11-2017, 21:14

Quote:

I'm now considering to start a NYYRIKKI fan club... who joins?

Count me in! Cool Cool

By ARTRAG

Enlighted (5887)

ARTRAG's picture

03-11-2017, 17:10

I'm in!

By Louthrax

Paragon (1689)

Louthrax's picture

09-11-2017, 17:13

Just tested that with Novaxis SCSI interface and it works great. There's just a small bug: when you have a 4MB RAM expansion plugged, MSXDOS2.SYS mentions 4080KB of main RAM at welcome message (should be 4096?).

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

10-11-2017, 11:02

Louthrax wrote:

Just tested that with Novaxis SCSI interface and it works great. There's just a small bug: when you have a 4MB RAM expansion plugged, MSXDOS2.SYS mentions 4080KB of main RAM at welcome message (should be 4096?).

Actually it is not a bug... It does not display the physical amount of RAM, but amount of RAM that is available for DOS2 system & applications... If you have 4096KB memory mapper DOS2 can use only 4080KB out of it. This is DOS2 internal mechanism to prevent the "famous" counter overflow error.

By Louthrax

Paragon (1689)

Louthrax's picture

10-11-2017, 11:24

NYYRIKKI wrote:
Louthrax wrote:

Just tested that with Novaxis SCSI interface and it works great. There's just a small bug: when you have a 4MB RAM expansion plugged, MSXDOS2.SYS mentions 4080KB of main RAM at welcome message (should be 4096?).

Actually it is not a bug... It does not display the physical amount of RAM, but amount of RAM that is available for DOS2 system & applications... If you have 4096KB memory mapper DOS2 can use only 4080KB out of it. This is DOS2 internal mechanism to prevent the "famous" counter overflow error.

Aaaaaahhhh... was not aware of that! The "memory" command also displays 4080KB too (4177920 bytes). There are indeed issues with the 4MB extension on several MSX demos and softwares.

By msd

Paragon (1311)

msd's picture

10-11-2017, 13:05

In all th years i used 4MB only ur had problems this. The 'problem' is strongly exceturated.

By NYYRIKKI

Enlighted (4743)

NYYRIKKI's picture

10-11-2017, 13:19

Louthrax wrote:

There are indeed issues with the 4MB extension on several MSX demos and softwares.

I know that at least NOP's UR is suffering from this, but it would be nice to get some sort of list of problematic titles.

By Grauw

Enlighted (6255)

Grauw's picture

10-11-2017, 14:17

NYYRIKKI wrote:

If you have 4096KB memory mapper DOS2 can use only 4080KB out of it. This is DOS2 internal mechanism to prevent the "famous" counter overflow error.

It’s simply that it must be able to represent 0 (as-in "no free segments"), so obviously it can’t represent a size larger than 255 without using a 16-bit value, and they chose to cap it at 4080K so they could keep the math and value storage 8-bit.

The 4 MB thing is a big myth imo, would be good if it wasn’t propagated over and over to scare people off producing & buying 4 MB extensions.

By Louthrax

Paragon (1689)

Louthrax's picture

10-11-2017, 15:39

The thing is commercial games were not using the memory mapper, and the MSX-DOS 2 tools should not suffer from the problem as they have to use the DOS 2 functions. So mainly demos, cracked ROM and MSX-DOS 1 tools should be impacted.

By msd

Paragon (1311)

msd's picture

11-11-2017, 02:55

They are only impacted when they try to count 256 pages with an 8bit counter. If is doesn't do that then there is no issue. So most if it almost althigs work fine also under dos1

My MSX profile