Jump to content
IGNORED

Most efficient way to wrap an XEX for self-booting?


Farb

Recommended Posts

Unsure of the best case situation but you're probably looking at 160 bytes minimum, probably more.

 

Fairly sure there's 3 and 4 sector menu binloaders around, I did one based on an existing one and it was 5 although it had some bloat due to extra features like refresh file list and it had blocks that got relocated to minimize the chance of clashing with files it was to load.

 

You could easily enough have a look at the XEX loaders used by APE, Aspeqt and SIO2SD.

 

To get at them (not 100% on this but should be close) :

 

APE - mount a directory as PC-Mirror on D1: then from the Atari read the first several sectors of that drive.

Aspeqt - select "boot executable" then do the same. Aspeqt is different from the others in that it loads entire segments as a single record.

SIO2SD - mount an XEX on D1: then read the first few sectors from that drive.

 

Games Disk 16a.ATR

 

That image has my 5 sector menu on it. Stuff gets relocated but you should be able to work it out. Stripping it down to the bare essentials would slim it down a lot.

Link to comment
Share on other sites

The loader would fit in one sector. Then put the executable in the next sectors. That's what I did in X-BOOT and X-LOAD: http://ftp.pigwa.net/stuff/collections/atari_forever/PC/X-Asm%202.51/doc/ (source code of loaders is included). I also stripped $FF/$FF (to simplify the loader) and rewrote the run address in the executable (so that the loader doesn't need any EOF detection).

 

Alternatively load the executable directly with special SIO commands as Aspeqt does. This solution is more elegant.

Link to comment
Share on other sites

KBoot header (first 3 sectors) Replace LL HH with the low byte and high byte of the executable file size. Append the executable. Pad as desired.

 


00 03 00 07 14 07 4c 14  07 LL HH 00 00 a9 46 8d
c6 02 d0 fe a0 00 a9 6b  91 58 20 d9 07 b0 ee 20
c4 07 ad 7a 08 0d 76 08  d0 e3 a5 80 8d e0 02 a5
81 8d e1 02 a9 00 8d e2  02 8d e3 02 20 eb 07 b0
cc a0 00 91 80 a5 80 c5  82 d0 06 a5 81 c5 83 f0
08 e6 80 d0 02 e6 81 d0  e3 ad 76 08 d0 af ad e2
02 8d 70 07 0d e3 02 f0  0e ad e3 02 8d 71 07 20
ff ff ad 7a 08 d0 13 a9  00 8d e2 02 8d e3 02 20
ae 07 ad 7a 08 d0 03 4c  3c 07 a9 00 85 80 85 81
85 82 85 83 ad e0 02 85  0a 85 0c ad e1 02 85 0b
85 0d a9 01 85 09 a9 00  8d 44 02 6c e0 02 20 eb
07 85 80 20 eb 07 85 81  a5 80 c9 ff d0 10 a5 81
c9 ff d0 0a 20 eb 07 85  80 20 eb 07 85 81 20 eb
07 85 82 20 eb 07 85 83  60 20 eb 07 c9 ff d0 09
20 eb 07 c9 ff d0 02 18  60 38 60 ad 09 07 0d 0a
07 0d 0b 07 f0 79 ac 79  08 10 50 ee 77 08 d0 03
ee 78 08 a9 31 8d 00 03  a9 01 8d 01 03 a9 52 8d
02 03 a9 40 8d 03 03 a9  80 8d 04 03 a9 08 8d 05
03 a9 1f 8d 06 03 a9 80  8d 08 03 a9 00 8d 09 03
ad 77 08 8d 0a 03 ad 78  08 8d 0b 03 20 59 e4 ad
03 03 c9 02 b0 22 a0 00  8c 79 08 b9 80 08 aa ad
09 07 d0 0b ad 0a 07 d0  03 ce 0b 07 ce 0a 07 ce
09 07 ee 79 08 8a 18 60  a0 01 8c 76 08 38 60 a0
01 8c 7a 08 38 60 00 03  00 80 00 00 00 00 00 00

Link to comment
Share on other sites

Thanks for all your suggestions!

 

I tried both fox's and kenfused's suggestions. I've decided to go with the KBoot header since it was easy to implement and reminds me of when I used to download ATR images from the Internet many years ago and wonder why there was a 'k' in the upper-corner of the screen during the boot ;)

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...