looking for disassebled source of command.com v1.11

Страница 1/3
| 2 | 3

By Leo

Paragon (1236)

Аватар пользователя Leo

22-11-2009, 00:09

hi all,

i am looking for the sources asm of command.com file , i have a problem
writing a special diskrom and it could help to understand the problem ...

Smile

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By RetroTechie

Paragon (1563)

Аватар пользователя RetroTechie

22-11-2009, 10:49

What special diskROM are you trying to write, and what is the problem? Question

By Leo

Paragon (1236)

Аватар пользователя Leo

22-11-2009, 13:27

well i am modifying the sources we can find on msx hans o , msx info site.
So it works with a flash rom , very similar to megaflash but the mapper is
different and has some more constraints:
it can only change page 0 and 1 at the same time. so the 512kb are split
into 16 pages of 32kb.
Now when i boot with other device like SD interface on slot1 i can read that flash disk
on slot 2 and execute .com files , i also do a little test program in basic with dski$
instruction i can check every sector is ok .

The problem is that when i try this ROM alone on a diskless msx (hb -9) , i
can see it loads msxdos 1.03 but then hangs before loading command.com.
I see in the rom source that init code is not the same if the interface is the first
to initialize diskrom or if it is second or more . but i trust this code , i have not
modified it , i have just written the phydio routine .

The thing not really clean i have done is that i fake a 720kb disk into flash disk
and only really deal with 128kb assuming that dosrom will never access these
sectors since i have only 60kb or so of file on it .

By RetroTechie

Paragon (1563)

Аватар пользователя RetroTechie

22-11-2009, 15:55

(..) but the mapper is different and has some more constraints:
it can only change page 0 and 1 at the same time. so the 512kb are split
into 16 pages of 32kb.

You mean you must access some sectors through page 0? Sounds like a PITA... Crazy Better add a tiny bit of hardware to make programming easier... Btw: IIRC there's a helper routine + 1 sector buffer somewhere that's guaranteed to be in page 3, that you can use to transfer contents of 1 disk sector? (useful for sectors on page 0/1 and 1/2 borders, but can be used for every sector I/O)

The thing not really clean i have done is that i fake a 720kb disk into flash disk
and only really deal with 128kb assuming that dosrom will never access these
sectors since i have only 60kb or so of file on it .

That should be okay. I would suggest you do return an error (generic disk I/O error eg.) for sectors that aren't physically present. That way any error messages will always show what's going on.

I see in the rom source that init code is not the same if the interface is the first
to initialize diskrom or if it is second or more . but i trust this code , i have not
modified it , i have just written the phydio routine .

The 1st to initialize = main diskROM. This diskROM does the generic disk support (files, diskBASIC, FCB's, walking through FAT entries etc). After that each diskROM that has drives attached, installs handlers/pointers to enable format and phydio routines for that drive(s). A driver is usually combined with the main diskROM, but these 2 are fairly independent parts. See for eg. some old SCSI interfaces which have driver but need main diskROM to work, or DOS2 cartridge which acts as main diskROM but has no driver in it.

Now when i boot with other device like SD interface on slot1 i can read that flash disk
on slot 2 and execute .com files , i also do a little test program in basic with dski$
instruction i can check every sector is ok .

The problem is that when i try this ROM alone on a diskless msx (hb -9) , i
can see it loads msxdos 1.03 but then hangs before loading command.com.
Basically phydio routine seems to work, but machine hangs when ROM is used as main diskROM? Perhaps...

  • You're doing something weird / non-standard when reading data through page 0?
  • You're not reading sectors 1 by 1 (optimized prematurely), and data overlapping page 0/1 border (or other page borders) doesn't go correctly?
  • You're not resetting your mapper to block 0 after each sector read (so that main diskROM does a disk I/O call, gets mapped out during the sector read, and doesn't get mapped back in before that call returns) ?
  • I/O to/from 4000-7FFFh range doesn't work (eg. data copied to ROM area) ? Try installing as 2nd diskROM, and run .COM file >16K big
  • Something funky happens when an interrupt occurs (either when used as main diskROM, or during a sector read) ?

By Leo

Paragon (1236)

Аватар пользователя Leo

22-11-2009, 18:02

i have been looking for that buffer in page 3 , not yet found in any docs ....
i have put an error code when transfer to RAM page 1 are asked ( HL = 4000-7FFF ) , but it never happens.
i have detected my command.com was infected by zapp thing , i did unzapp but still fails the same way.
i have hacked with hexeditor the msxdos.sys it will not load command.com but a smal .com with message like
hello world .com , so i get message and then hangs as if loading of command.com got wrong ...

i will try with a larger.com file ( i have a 26kb one ) tonite ...

I tried putting DI/EI around my routine , does not make any difference.

for page 0 ,2, 3 transfer i do super safe & slow loop that toggle slot page at
each byte copy : maybe that isnt that safe ... i have tried to use that routine
that does "set ram page /LDIR /set rom page" : it hangs so i got back to my system.

When i rename msxdos.sys i and use the cart alone i can boot&go into
basic and type "files" / "load" , all is correct ...

yes , i must access sectors on page 0 , and page1 is rom.
The worst is to come : i have duplicated 16kb diskrom on 256kb flash rom
because when i change the mapper from first 32kb to second , lets say, i must
still have an other copy of disk rom on page 1 !!!!
I could so some trick with little ram code and buffer so it is not impossible but i am lazy
and only need a 128kf disk for the moment .

By cax

Prophet (3740)

Аватар пользователя cax

22-11-2009, 19:42

First of all,
find clean, uninfected copy of msxdos.sys and command.com, boot MSX without disk in the drive and reformat it from Basic...

By RetroTechie

Paragon (1563)

Аватар пользователя RetroTechie

22-11-2009, 20:00

i have been looking for that buffer in page 3 , not yet found in any docs ....
On {mod} download {mod: link to copyrighted stuff}| (driver part). Check the README first, then check VG8245.GEN, look for labels "SECBUF" and "XFER", and how they are used. I think that will clarify some things.

for page 0 ,2, 3 transfer i do super safe & slow loop that toggle slot page at each byte copy : maybe that isnt that safe ...
Well you could use RDSLT/WRSLT for that... aren't those routines available under DOS too? That would take 'current slot in page 1' out of the equation.

i have tried to use that routine that does "set ram page /LDIR /set rom page" : it hangs so i got back to my system.
Better method... above documentation should make clear how to use this routine, + sectorbuffer properly, what environment conditions apply / what to watch out for... IIRC, all disk I/O always goes to/from the 64K RAM that's used under MSX-DOS, regardless whether you have another ROM/RAM slot enabled in page 1 when diskROM is called. That's what those helper routines are for. But I might be mistaken... Tongue

yes , i must access sectors on page 0 , and page1 is rom.
The worst is to come : i have duplicated 16kb diskrom on 256kb flash rom
because when i change the mapper from first 32kb to second , lets say, i must
still have an other copy of disk rom on page 1 !!!!
I could so some trick with little ram code and buffer so it is not impossible but i am lazy
and only need a 128kf disk for the moment .

In that case, I'd change tthe mapper design to switch 16K blocks (possibly mirrored in other pages). Should be *very* easy hardware change. Then you'd still need some tricky code somewhere, but no need to touch 0000-3FFFh range anymore... at all. Or change mapper such that 32K blocks are mirrored in 8000-FFFFh area. Then you can access data in 8000-BFFFh page... much easier/safer. Page 0 is just as nasty to switch as page 3 IMHO.

Btw. feel free to send me a copy of the code you're trying to get working... maybe I can spot a place where things go bad Murdoch

By Leo

Paragon (1236)

Аватар пользователя Leo

22-11-2009, 20:05

i dont think i can use wrlst an rdslt since i want to read from page 0 on my romdisk rom :² but not sure ...
i am not the guy who did that mapper i am just trying to get the best of it , and for the moment
if command.com was loading i would be just happy ...

By RetroTechie

Paragon (1563)

Аватар пользователя RetroTechie

22-11-2009, 20:14

i dont think i can use wrlst an rdslt since i want to read from page 0 on my romdisk rom :² but not sure ...
Afaik RDSLT and WRSLT work for page 0 also - even if they would page themselves out, because these routines use helper routines in page 3 as well (very tricky, and clever code in these inter-slot BIOS routines). But I'm not 100% sure on that either... maybe someone else can say for sure?

By flyguille

Prophet (3031)

Аватар пользователя flyguille

22-11-2009, 20:40

i dont think i can use wrlst an rdslt since i want to read from page 0 on my romdisk rom :² but not sure ...
Afaik RDSLT and WRSLT work for page 0 also - even if they would page themselves out, because these routines use helper routines in page 3 as well (very tricky, and clever code in these inter-slot BIOS routines). But I'm not 100% sure on that either... maybe someone else can say for sure?

yes, they can, but is very slooooww, if you are thinking reading/writing byte by byte.

By flyguille

Prophet (3031)

Аватар пользователя flyguille

22-11-2009, 20:43

DiskBios aka diskrom, can be set on page 1 or page 2, maybe you can to rewrite all the rom for to work on page2 (&H8000-&HBFFF) instead page1. And to use that relocatable code that already has the original rom when you needs to dump data to page2 (you needs to conmute some switchs on the code).

Страница 1/3
| 2 | 3