Change ProDOS file type to SYS

11 posts / 0 new
Last post
Offline
Last seen: 2 months 2 hours ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
Change ProDOS file type to SYS

So I've written a small 65C02 assembler program that I want to change from BIN to SYS.  It is assembled (with my cross assembler) at $2000, and I can run it from the BASIC.SYSTEM command line or BITSY BYE.

 

Anyway, what is the easiest way to change a file type in ProDOS?

 

CVT
CVT's picture
Offline
Last seen: 9 hours 47 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1171
Not sure how to do it from

Not sure how to do it from ProDOS, but it's very easy from CiderPress. Simply select the file and then use "Edit Attributes" from the Action menu (or the context menu).

Offline
Last seen: 2 months 2 hours ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
Well, I was able to run

Well, I was able to run Ciderpress under Wine so that worked to change my file to $ff.  Unfortunately after doing that it now crashes when it ecits most of the time.  Weird it works when it is BIN.  I've never developed a SYSTEM file before, so there is probably something that needs to be done when it exits that I'm not doing.  My code just does an RTS at the end which is fine for a BIN.

 

CVT
CVT's picture
Offline
Last seen: 9 hours 47 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1171
What happens if you leave the

What happens if you leave the fle attribute as BIN, but rename it to <something>.SYSTEM?

ProDOS only cares about the attribute, not the name itself.

Offline
Last seen: 2 months 2 hours ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
The program will run if left

The program will run if left as a BIN file with name  xxxx.SYSTEM, however I don't think ProDOS will automatically run it at boot time which is what I want to happen...

 

 

InexorableTash's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: Jan 27 2023 - 13:44
Posts: 11
Command line tool or GUI?

If you want a command line tool from within ProDOS's BASIC.SYSTEM, I have an external command:

https://github.com/a2stuff/chtype

if you want a GUI on the device, I recently added a desk accessory to A2D that can change types. Grab a 1.4 alpha from:

https://github.com/a2stuff/a2d

Offline
Last seen: 2 months 2 hours ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
InexorableTash wrote:If you
InexorableTash wrote:

If you want a command line tool from within ProDOS's BASIC.SYSTEM, I have an external command:

https://github.com/a2stuff/chtype

if you want a GUI on the device, I recently added a desk accessory to A2D that can change types. Grab a 1.4 alpha from:

https://github.com/a2stuff/a2d

 

 

Thanks.  I will check those out.  I was able to get it done using Ciderpress under Wine, but I really hate having to run things that way so the command line utility that runs on the BASIC.SYSTEM command line would probably be preferable.  I don't use A2D much.

 

Anyway, I found that there is a whole specific way that SYSTEM files have to set themselves up and exit.  I've not gotten that working yet, but I think I am on the right track.  I am also looking at some disassembly of the .SYSTEM files created for some of the other 32MB ProDOS images.  I think I can get it figured out.  It is just a bit more involved than I originally thought it would be.

 

CVT
CVT's picture
Offline
Last seen: 9 hours 47 min ago
Joined: Aug 9 2022 - 00:48
Posts: 1171
softwarejanitor wrote:The
softwarejanitor wrote:

The program will run if left as a BIN file with name  xxxx.SYSTEM, however I don't think ProDOS will automatically run it at boot time which is what I want to happen...

 

 

You are correct. ProDOS will automatically run the first file ending on .SYSTEM of type $FF.

 

Some info on how to write a ProDOS system program here: https://prodos8.com/docs/techref/writing-a-prodos-system-program/

Offline
Last seen: 23 hours 38 min ago
Joined: Nov 29 2020 - 19:48
Posts: 135
Relocable?

I'm not where I can look anything up but if I remember correctly, .SYSTEM files had to bload at $2000 and then be reloacatable.  I suspect detail are in Beneath Apple ProDOS by Worth and Lechner, but it has been a long time...

 

I suspect your .bin may not load at $2000 and just changing the file type bytes may not be enough.

Offline
Last seen: 8 months 4 weeks ago
Joined: Jul 4 2023 - 19:29
Posts: 3
Run BIN just like SYSTEM

Here's my lazy man's way to do this.

 

Make a copy of BASIC.SYSTEM, and call it MYPROG.SYSTEM. Then use a block editor (e.g. Block Warden or ChewBagger) to change the pstring 'STARTUP' (located at $2006) to the name of your BIN file.

 

Save it and just launch MYPROG.SYSTEM.

 

Yes, you're wasting disk space doing it that way, but otherwise it's quick and easy.

 

Note that 'pstring' is the filename preceded by a length byte of that filename string.

Offline
Last seen: 2 months 2 hours ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
8BitHeaven wrote:I'm not
8BitHeaven wrote:

I'm not where I can look anything up but if I remember correctly, .SYSTEM files had to bload at $2000 and then be reloacatable.  I suspect detail are in Beneath Apple ProDOS by Worth and Lechner, but it has been a long time...

 

I suspect your .bin may not load at $2000 and just changing the file type bytes may not be enough.

The BIN file is assembler code I wrote and assembled with my own assembler.  I assembled it at $2000 so that isn't it.  I have been looking at the document on how to write a system file that CVT mentioned.  It's a little involved, but I think between that and looking at a disassebly of some similar SYSTEM files I think I can figure it out.

I will have to look at Beneath Apple ProDOS too, though, thanks for that suggestion.  Those Quality Software books are quite often better than any of Apple's documents.

 

Log in or register to post comments