English Amiga Board


Go Back   English Amiga Board > Other Projects > project.CD32 Conversion

 
 
Thread Tools
Old 25 February 2016, 22:04   #1
jayminer
Registered User
 
jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 266
CD32-tools

Here's a thread created so we don't have to pester the CD32Load-thread with too many off-topic posts about various tools to help with CD32 iso creation and other things CD32-related.

The following is just copy-pasted from my post in that very CD32Load-thread:

Quote:
Originally Posted by fx
I have been working on automating the building of the CD I'm working on and found that ISOCD actually has some arguments for batch-building ISO:s, the biggest hurdle was that it requires a layout-file and the layout-file can not be generated from CLI, it requires the use of it's GUI - and must be updated if directories are added or removed to the CD.

Thankfully patrik (the other guy working on this CD) took a look at the layout-file and made a python-script that can generate a ISOCD-compatible layout-file eliminating the need to use the GUI for anything.

Here's a quick video I made of how easy it now is for me to make an updated iso:
[ Show youtube player ]

And here are links to the scripts used:
http://driar.se/cd32scripts/

I added some comments to the bash-script hopefully explaining how things work, the only really undocumented thing is the inetd-part on the amiga-side, but all I did was add a service called buildcd under the host OS (in my case Linux so I added it to /etc/services and assigned port 1234 to it) and then added a line to inetd under AmigaOS to launch my script from C:build_cd32cd.

Hope this can help someone, it really saves me time each time I make a small change and want to update my iso
jayminer is offline  
Old 25 February 2016, 22:26   #2
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
I don't have anything to add yet, just posting so I can subscribe to replies great work you and Patrik.
earok is offline  
Old 25 February 2016, 22:45   #3
patrik
Registered User
 
patrik's Avatar
 
Join Date: Jan 2005
Location: Umeå
Age: 43
Posts: 922
Quoting from the CD32Load thread

Quote:
Originally Posted by jotd View Post
Nice Windows/WinUAE communication stuff! Sound complicated on the amiga side, and the "NC" command I don't know of.
I was wondering if Patrik's script could be run from Amiga/WinUAE side, using Python 2.3 for Amiga? That would create a native solution, and maybe wouldn't even need an amiga script. Everything could be python-driven on the amiga side.
(we should create a separate thread for this)

Patrik seems to know a lot about ISO. Why wouldn't he write a ISO creator with CD32.TM support, in Python / batch mode ? He has ISOCD image as reference. Maybe it's not that difficult, and would provide a standalone/scripted solution to create ISOs.
That's something I could be interested in doing too (but I'd have to read a lot about ISO format first).
One of the biggest points of the layout script and this setup was to not have to switch to or interact with UAE to generate the iso at all.

Right now I have an older E-UAE 0.8.9 (which is really fast at creating the iso with ISOCD) running minimized for iso creation only. So I just compile my stuff (cross compiling vbcc/vasm), execute the buildiso.sh script, then when the iso is done (under 10 seconds on old Core2duo laptop), I just reboot FS-UAE which I have running at the same time for CD32-emulation, which then boots with the fresh iso .

I created a minimal archive with the stuff needed for inetd. It is based on the AmiTCP 4.0 demo, just made a few modifications so the binaries doesn't depend on AmiTCP:. Just extract to SYS: http://megaburken.net/~patrik/inetd_minimal.lha

Have also imported the iso-related scripts into a github repo: https://github.com/patrikaxelsson/cd32tools

It actually contains a more recent, faster and a bit shorter version of the generateLayout.py and it would be great if you could contribute the windows changes you made .

It was actually my first thought to write a script which created the iso directly, but figured it was better to start small and for started generate the layout . It would be the ultimate solution though!
patrik is offline  
Old 25 February 2016, 22:56   #4
jayminer
Registered User
 
jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 266
Here's a short guide on how to get inetd running and launching my script which starts ISOCD, first download http://megaburken.net/~patrik/inetd_minimal.lha and extract it to sys:, it should not overwrite anything of importance (but if you're scared, extract it somewhere else and manually copy everything to the correct place).

There is a file in the lha called S/User-Startup.inetd_stuff - the contents of this file should be added to your S:User-Startup, simply do a:
Type S:User-Startup.inetd_stuff >>S:User-Startup

The next thing we need to do is add a service to the host OS, if you're running Windows this will be located in C:\WINDOWS\System32\Drivers\etc\services or somewhere similiar (that was the path on a virtual XP-machine I checked with, might have moved in later versions of Windows) and if you're running Linux or MacOS X it's located in /etc/services . Open this file with a text-editor and add a line to the bottom of the file that looks something like this:

Code:
buildcd		1234/tcp			# Build Amiga CD
The only thing this does it assign the portnumber to a name which is later used by inetd.

Now for our final part we need to copy my script (build_cd32cd) to C: (or wherever you want it) in UAE - modify it to your needs (some paths will need changing). Observe that ISOCD has a bit of an odd syntax for an Amiga-program, so if you have your layout-file as DH0:cd32.layout you use -lDH0:cd32.layout as an option to ISOCD to specify the file.

In S:inetd.conf the following line is already added if you downloaded patriks inetd-lha but I thought I might mention it in case anyone wants to add other scripts, this is what you add:

Code:
buildcd   stream tcp dos bin - Execute C:build_cd32cd
Now, if everything has gone right, if you connect to port 1234 on your machine inetd will get a signal and launch the script!
jayminer is offline  
Old 26 February 2016, 02:55   #5
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
Thanks for the input! I could never figure that out alone so quickly! specially for the amiga part.
So it means that I could also trigger the build of cd32load with some windows-based command. Interesting.

Patrik I ll certainly contribute as I love using python for fun stuff. I also volunteered to teach python to my fellow workers which grants me one free meal every now and then.
I ve already modified your generatelayout script so it runs on windows and can be imported as a module. I ll redo my changes on your new src.

Last edited by jotd; 26 February 2016 at 12:32.
jotd is offline  
Old 26 February 2016, 15:19   #6
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
Jotd, would you be up for explaining how to use this on Windows? I dont have Linux.
Amiga1992 is offline  
Old 26 February 2016, 16:51   #7
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
I'll explain when I'm running it on my machine, which is still a dream :=)
Patrik & his friends seem to have a head start on Linux with all the stuff (just tried vasm on Windows, ouch!!!). I'll try to install it on my Windows box and I'll tell you.
Let's do things one by one.

In a surge of laziness I was wondering if there wasn't a python script to create ISO9660 images so I googled it, and no luck.
BUT, the old mkisofs command (Linux & Windows) is able to create an ISO file on command line. So I was wondering if it was difficult to insert the CDTV.TM or CD32.TM at the proper location so CD32 boots from the CD?
Wrap this in a nice python script and you have a cool tool to master CD32 compilations, without using UAE.

Edit: someone already did it and I was the one asking only 2 months ago !! memory playing tricks, but logic is intact so I come up with the same solutions everytime

http://eab.abime.net/showthread.php?p=1059864

Last edited by jotd; 26 February 2016 at 17:13.
jotd is offline  
Old 26 February 2016, 17:12   #8
jayminer
Registered User
 
jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 266
@jotd, I have been thinking about mkisofs also, I wonder if the ISO is padded in some way for the trademark file or if there is some space free in the ISO specification?
jayminer is offline  
Old 26 February 2016, 17:32   #9
jayminer
Registered User
 
jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 266
@jotd: Just saw your edit, that's awesome! Gonna try it out.
jayminer is offline  
Old 26 February 2016, 17:39   #10
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
It doesn't work: the python post-processing detects an invalid ISO image. I have replied SysX in the original thread. Maybe Patrik can check the script in the meanwhile. I think the ISO image is fine...

Edit: there's a problem in the python file, and it's pretty trivial and cannot work, last minute change, untested I guess

make_cd32_iso.py line 211:

if (ord(iso_tmp[0x808C]) != 0x13) and (ord(iso_tmp[0x8097]) != 0x15):

(add ord to convert chars to ASCII code and the check passes!!)

Edit: AAAAAND it works!! that's the coolest!!! I have an issue with AMSCD32 since the mkisofs command converts all filenames to uppercase, I'll sort this out.
But I tried a game from CD with CD32load (using Psygore CD loader) and it works.

All you need is the archive in the zone, but the creative part is much smaller. You can download a windows/Linux distrib of mkisofs, install it somewhere and I'll zone the working scripts.

Last edited by jotd; 26 February 2016 at 17:56.
jotd is offline  
Old 26 February 2016, 17:59   #11
jayminer
Registered User
 
jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 266
Yeah, I got it working aswell, the biggest hurdle for me was windows linebreaks which messed up some things but after running dos2unix on the files and adding your fix it seems to work! Gonna do some more tests and compare the results to a small ISO created with ISOCD!
jayminer is offline  
Old 26 February 2016, 18:09   #12
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
Well, ISOCD seems to be able to do a better job creating an ISO image without having to convert everything to uppercase.
I have tried to set -allow-lowercase instead of -relaxed-filenames option but in that case, the ISO file does not boot (no startup sequence)

So if someone can come up with a solution to generate the filenames without converting them to uppercase AND the CD boots I'll take it.
jotd is offline  
Old 26 February 2016, 18:24   #13
jayminer
Registered User
 
jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 266
I added the flag "-allow-lowercase" to mkisofs and it worked!



Now to get rid of that rr_moved directory (I added Rockridge extension since the directory nesting on our CD was to deep)
jayminer is offline  
Old 26 February 2016, 18:27   #14
jayminer
Registered User
 
jayminer's Avatar
 
Join Date: Jun 2015
Location: Umeå / Sweden
Posts: 266
Okay, that was easy, I just added -D to mkisofs aswell, seems to be fine now! Gonna do some testing with a CD created this way on real hardware though!

Oh, and just for clarity, this is the mkisofs-line I ran now:
mkisofs -quiet -D -allow-lowercase -V cd32comp -copyright none -publisher none -o cd32.raw -relaxed-filenames -d -input-charset ASCII -output-charset ASCII -iso-level 3 -A "" -sysid CDTV rootdir

rootdir is the name of the directory all files for the CD is stored, not sure about -sysid CDTV but it was so in the dune-example so I just left it like that, doesn't seem to matter.
jayminer is offline  
Old 26 February 2016, 21:02   #15
patrik
Registered User
 
patrik's Avatar
 
Join Date: Jan 2005
Location: Umeå
Age: 43
Posts: 922
Great progress on mkisofs!

Feels a bit non-relevant now, but put together a very very simple script earlier today for triggering the ISOCD build. The thought was that if you have python to generate the layout, but lack netcat or something similar, you can use python to connect to inetd and trigger the build: http://megaburken.net/~patrik/readSocket.py
patrik is offline  
Old 27 February 2016, 01:33   #16
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
Hey Patrik your script can still be useful to trigger some other Amiga stuff. I wasn't able to build my src with vasm for instance. Unknown directive "include", well that settles it. No way I'm porting my code to vasm since it works fine from BASM or phxass.
Vamos could be a good lead but I have trouble with linking and M$ libs in Cython (but that's really something I want to make work this year, including maybe a 68k thingy at work that would make me a semigod there!!). And what about building whdload slaves from vasm (when it works) and then launch whdload from windows!

@jayminer: your command lines produces a non-bootable CD here. WinUAE just pops an AmigaDOS prompt and startup is not executed. This is because of the -allow-lowercase option.

Without it, it would work, but the UPPERCASE names are ugly, and I have a problem with my menu starter that scans files ending with ".start" in lowercase (that's lame!)

Last edited by jotd; 27 February 2016 at 01:55.
jotd is offline  
Old 27 February 2016, 06:50   #17
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
I guess this is too technical for me, I hope some solution/tutorial for lamers like me come up later!
Amiga1992 is offline  
Old 27 February 2016, 09:34   #18
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
Don't worry, I'll eventually write a python script to wrap all this up in a simple tool.
jotd is offline  
Old 27 February 2016, 10:35   #19
patrik
Registered User
 
patrik's Avatar
 
Join Date: Jan 2005
Location: Umeå
Age: 43
Posts: 922
Quote:
Originally Posted by jotd View Post
Hey Patrik your script can still be useful to trigger some other Amiga stuff. I wasn't able to build my src with vasm for instance. Unknown directive "include", well that settles it. No way I'm porting my code to vasm since it works fine from BASM or phxass.
I am not an asm guy, so my knowledge is very limited, however I need vasm to compile small snippets asm and for that it has worked great for me.

Did a quick test here:
Code:
$ cat test.s 
	include bestroutine.s
$ cat bestroutine.s 
	rts
$ vasmm68k_mot -Fhunkexe -o testexe test.s
vasm 1.7d (c) in 2002-2015 Volker Barthelmann
vasm M68k/CPU32/ColdFire cpu backend 2.1 (c) 2002-2015 Frank Wille
vasm motorola syntax module 3.8a (c) 2002-2015 Frank Wille
vasm hunk format output module 2.7 (c) 2002-2015 Frank Wille

CODE(acrx2):	           2 bytes
There are also some more compatibility options to this _mot/motorola syntax module, like -phxass, -devpac etc which can be useful.
patrik is offline  
Old 27 February 2016, 11:19   #20
patrik
Registered User
 
patrik's Avatar
 
Join Date: Jan 2005
Location: Umeå
Age: 43
Posts: 922
Quote:
Originally Posted by jotd View Post
@jayminer: your command lines produces a non-bootable CD here. WinUAE just pops an AmigaDOS prompt and startup is not executed. This is because of the -allow-lowercase option.

Without it, it would work, but the UPPERCASE names are ugly, and I have a problem with my menu starter that scans files ending with ".start" in lowercase (that's lame!)
The problem is that the path table entries are not UPPERCASE, which the CD32 doesn't like. Had already done code to recreate the path table in pathTableInfo.py when experimenting with some sorting which didn't work, so added uppercasing function to it (and renamed it), this makes the iso work: https://github.com/patrikaxelsson/cd...thTableUtil.py
patrik is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for some basic IP tools en SDK tools Roland007 support.WinUAE 0 28 November 2012 22:34
Tools alexh support.Hardware 15 05 August 2010 23:27
Need a few tools Phantomz request.Apps 6 22 November 2008 03:15
Tools? Kada project.Amiga Game Factory 1 05 February 2008 09:58
CD32 / Daemon tools lockup? Mclane support.WinUAE 0 01 April 2003 18:20

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 16:21.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.16530 seconds with 15 queries