MSX-DOS1 - Giving Priority to DOS2 on another interface

بواسطة ronivon

Expert (73)

صورة ronivon

29-12-2017, 22:31

Hi.

I am tweaking with MSX-DOS1 drivers, for my MSXPi project.
There is a bug I am trying to fix - I implemented a escape key in the driver, to bypass the boot and allow MSX to boot from another interface, but it does not work as I expected.
The MSX-DOS1 is always taking priority and booting from my interface even when I have MFR-SD connected to another slot.
Reading the Nextor docs some time ago, I knew that Nextor, being at a newer level, should boot and have the other interface as slave/secondary. But this is not happening.

The MSX-DOS got this at the start:

        call	INIHRD			; initialize diskhardware
	di
	ld	a,(DEVICE)
	and	a			; abort disksystem init ?  
	ret	m			; yep, quit
	jp	nz,A580C		; disksystem init already started by an other diskrom, skip init

And in my driver, I am trying things like this:

INIHRD:
; If P is pressed during boot, MSXPi disk driver is bypassed
        call    CHECK_P
        JR      C,INIHRD_DISABLE
        ...
INIHRD_DISABLE:
        ld      a,1   -> tried "0", "255", "128"
        ld      (DEVICE),A
        ret

I am tweaking with the (DEVICE) value, and the better I could do was totally ignore my interface and boot into Nextor.
But that is not what I want, since this disable totally my interface, even CALL commands.

Someone got a suggestion?
Thanks
roni

Login أوregister لوضع تعليقاتك

بواسطة NYYRIKKI

Enlighted (5918)

صورة NYYRIKKI

30-12-2017, 02:41

My suggestion: Don't touch DEVICE-variable your self... You will break it.

If Nextor can't take over your MSX-DOS1 driver, you are probably doing something funny... ie. populating hooks that makes it think that you are trying to run some MSX-DOS1 boot loader. With normal MSX-DOS1 ROMs this just works. (Also make sure that you don't have disk with DOS1 bootsector in any of your drives)

If you want to exit without init just do something like:

INIHRD_DISABLE:
	POP HL
	RET

بواسطة ronivon

Expert (73)

صورة ronivon

30-12-2017, 13:56

Your suggestion inproved it overall - "P" will skip MSXPi boot, and allow Nextor to boot, at same time keeping my CALL commands available. This is indeed a good improvement.

I sill wanted to have this plus the option to have MSXPi as a slave device, thus allowing also access to drives C: and B: on MSXPi.

Note: Currently, when MSXPi boots, we endup with MSX with 4 drives: A:,B: on MSXPi, C:,D: on Nextor. Downside is that booting on MSX-DOS1, we loose access to sub-dirs and DOS2 programs on Nextor SD card, thus the reason to have Nextor as primary and MSXPi as secondary,

NYYRIKKI wrote:

My suggestion: Don't touch DEVICE-variable your self... You will break it.

If Nextor can't take over your MSX-DOS1 driver, you are probably doing something funny... ie. populating hooks that makes it think that you are trying to run some MSX-DOS1 boot loader. With normal MSX-DOS1 ROMs this just works. (Also make sure that you don't have disk with DOS1 bootsector in any of your drives)

If you want to exit without init just do something like:

INIHRD_DISABLE:
	POP HL
	RET

بواسطة NYYRIKKI

Enlighted (5918)

صورة NYYRIKKI

30-12-2017, 14:57

ronivon wrote:

Note: Currently, when MSXPi boots, we endup with MSX with 4 drives: A:,B: on MSXPi, C:,D: on Nextor. Downside is that booting on MSX-DOS1, we loose access to sub-dirs and DOS2 programs on Nextor SD card, thus the reason to have Nextor as primary and MSXPi as secondary,

Your problem is not the "primary, secondary"-order... This is something you can't change without changing the cartridges physically with each other since it is defined by MSX slot boot order in ROM.

Your problem is that it now boots to MSX-DOS1 and you should figure out why... I have strong feeling that the reason is that your "MSXPi" reads MSX-DOS1 boot sector from some virtual drive device that you have created... Simple test: Boot from your MSXPi and try ?DSKI$(0,0) command in BASIC. If you don't get "Disk offline"-error then there is probably your mistake.

If you have not implemented possibility to "eject disk" then try to insert disk that has copy of bootsector from disk that has been formatted on computer running MSX-DOS2.

بواسطة ronivon

Expert (73)

صورة ronivon

30-12-2017, 17:32

Holy!!!

Indeed it works, thanks NYYRIKKI !!!

Just replaced the MSX-DOS1 disk image by MSX-DOS 2.31 image and it booted into MSX-DOS2 from MSXPi. This was a hidden feature I did not know about - never ever tried, actually.
Nice.

Of course it will only work as long as there is another IDE interface connected, with MSX-DOS2 and a mapper.
I am happy with this behaviour, should be in next builds for my roms.

بواسطة Grauw

Ascended (10565)

صورة Grauw

30-12-2017, 18:37

You can put the DOS1 files on the 2.31 disk image, as long as the disk image itself is formatted with DOS2 (or altered with the FIXDISK tool). DOS2 does not actually look at the files on the disk, but it looks at a byte in the boot sector to see if it was formatted with DOS2, otherwise it will disable itself for compatibility and fall back to DOS1. But DOS1 does not do any such check, so it will happily boot from a DOS2-formatted disk as long as the MSXDOS.SYS and COMMAND.COM files are on it.

So you should be able to have the best of both worlds.

بواسطة NYYRIKKI

Enlighted (5918)

صورة NYYRIKKI

30-12-2017, 19:47

ronivon wrote:

Just replaced the MSX-DOS1 disk image by MSX-DOS 2.31 image and it booted into MSX-DOS2 from MSXPi.

Yes, well this is because now you had the boot files (MSXDOS2.SYS & COMMAND2.COM) on the disk it self... This DOS2 setup kind of works just like PC computers work if you think MS-DOS or PC-DOS... If there is system files on disk ( A: ) it will start from there. If the disk is offline or there is DOS2 floppy but no system files then it boots from SD-interface... (You will end up to C:\> prompt) If You use MSX-DOS1 disk, it will disable DOS2 and boot normally to MSX-DOS1.