Jump to content
IGNORED

Implement Binary loader? or use existing routines in DOS?


Recommended Posts

Certain DOS (MyDOS, SpartaDOS, etc.) implement binary load in the FMS, which means they'll be off limits to my N: device.

 

Which means, I need to implement CIO commands 39 and 40. (WHY THE FUCK ARE THERE _TWO_ OF THEM?!)

 

I think I have two options:

 

(1) write my own little loader and shove into CIO handler.

(2) figure out which DOS I am under, and call its handler on the open IOCB.

 

Am I smoking crack? Which one is better? Is there a third option I haven't considered?

 

-Thom

 

 

Link to comment
Share on other sites

Hi!

6 minutes ago, tschak909 said:

Certain DOS (MyDOS, SpartaDOS, etc.) implement binary load in the FMS, which means they'll be off limits to my N: device.

 

Which means, I need to implement CIO commands 39 and 40. (WHY THE FUCK ARE THERE _TWO_ OF THEM?!)

 

I think I have two options:

 

(1) write my own little loader and shove into CIO handler.

(2) figure out which DOS I am under, and call its handler on the open IOCB.

 

Am I smoking crack? Which one is better? Is there a third option I haven't considered?

Best alternative is not implementing them, as probably nobody uses them anyway - because those are not standard I would say that no application actually uses them.

 

Have Fun!

Link to comment
Share on other sites

sigh, and once again, you miss the point.

 

I am implementing them.

 

The reason is, if I try to load a binary file over N: in the DUP (or CPs) of these DOSes, IT WILL FAIL in these operating systems.

 

...with an Error 146 (not implemented.)

 

I am trying to prevent this, and actually have it work for the user.

Edited by tschak909
Link to comment
Share on other sites

Hi!

Quote

sigh, and once again, you miss the point.

 

I am implementing them.

 

The reason is, if I try to load a binary file over N: in the DUP (or CPs) of these DOSes, IT WILL FAIL in these operating systems.

 

...with an Error 146 (not implemented.)

 

I am trying to prevent this, and actually have it work for the user.

 

Calm down :) 

 

I understood you.

 

The problem is, you are trying to do something that is not really possible: be compatible with MyDOS and SpartaDOS at the same time. You already saw that the CIO command for "load binary file" is different between MyDOS and SpartaDos 3.x, so you can't support both.

 

And if you keep trying, you will discover that MyDOS also cheats: the DUP first opens the file, reads the first two bytes checking for $FF/$FF, and then calls the XIO #39 command without closing the file. The handler knows this and start loading the binary segments right away.

 

The reality is that the multiple Atari DOS were programmed assuming that there is only one "extended" CIO handler, so all operations assume that you use the "D :" handler.

 

Have Fun!

 

Edited by dmsc
Link to comment
Share on other sites

11 minutes ago, tschak909 said:

Ok, so I'll try to implement my own, and see if I can implement both MyDOS and SpartaDOS binary loading. urgh.

 

I seriously want to thwap the DOS authors for some of the stupid things i've uncovered.

 

-Thom

This is why some of us push for only using SDX moving forward.  These machines did not start out with 1990 technology and code.  They started in 1979 with DOS 1.0.  Be happy we evolved from that to SDX 4.49, but don't try to support DOS 1.0 and SDX 4.49 in the same package, and be upset when there are incompatibilities.  We've all learned to write better code these past 30 or 40 years.

  • Like 1
Link to comment
Share on other sites

You might as well write your own loader, since you don't know if you'll be running under a version of DOS that even has one. It's pretty straight forward and with DOS to handle the i/o it ought to be on the short side. Maybe a couple hundred bytes or less.

  • Like 1
Link to comment
Share on other sites

14 hours ago, tschak909 said:

Certain DOS (MyDOS, SpartaDOS, etc.) implement binary load in the FMS, which means they'll be off limits to my N: device.

Dos 1.0 and Dos 2.0 did not have a XIO for binary load. The first Dos that provided one was Dos 3.0 by Atari at position XIO 41 (neither 39 nor 40 is correct). Unfortunately, Atari failed to include the same Xio in Dos 2.5 which came later.

Link to comment
Share on other sites

7 hours ago, tschak909 said:

Ok, so I'll try to implement my own, and see if I can implement both MyDOS and SpartaDOS binary loading.

 

Why don't you try @HiassofT's approach on relocation of the code?

https://atariage.com/forums/topic/306336-dos-20-dup-overwrites-my-cio-handler

 

Load a small stub which in a first step detects the running DOS and makes a SIO-call to Fujinet transmitting the running DOS.

The second step then receives the 100% matching N:-handler from Fujinet for this particular DOS.

 

If you cannot detect the DOS, have a fallback handler without the binary load component implemented.

Edited by DjayBee
fighting with formatting
Link to comment
Share on other sites

4 hours ago, DjayBee said:

 

Why don't you try @HiassofT's approach on relocation of the code?

https://atariage.com/forums/topic/306336-dos-20-dup-overwrites-my-cio-handler

 

Load a small stub which in a first step detects the running DOS and makes a SIO-call to Fujinet transmitting the running DOS.

The second step then receives the 100% matching N:-handler from Fujinet for this particular DOS.

 

If you cannot detect the DOS, have a fallback handler without the binary load component implemented.

That will probably be the approach I take. I'm not trying to make a one size fits all, I'm trying to map out all the DOS differences, so I can try to figure out how many potential versions of the handler I need to make, and then I can figure out what to send over.

 

-Thom

Link to comment
Share on other sites

Afaik,

 

MyDOS originally used XIO 39 for binary load, while SpartaDOS used XIO 40. Then MyDOS added XIO 40 for binary load to be somewhat Sparta compatible. (MyDOS now has two XIOs for binary load, XIO 39 and XIO 40.) In the end, both MyDOS and SpartaDOS support XIO 40 for binary load...   see Atari Wiki

 

Link to comment
Share on other sites

Hi!

26 minutes ago, CharlieChaplin said:

Afaik,

 

MyDOS originally used XIO 39 for binary load, while SpartaDOS used XIO 40. Then MyDOS added XIO 40 for binary load to be somewhat Sparta compatible. (MyDOS now has two XIOs for binary load, XIO 39 and XIO 40.) In the end, both MyDOS and SpartaDOS support XIO 40 for binary load...   see Atari Wiki

 

But that is not the problem. What Thom is trying to do is that a binary load from MyDOS DUP works from the new "N:" device. And the DUP uses XIO 39 to load the file.

 

Have Fun!

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...