use OSDK under Linux ?

Questions, bug reports, features requests, ... about the Oric Software Development Kit. Please indicate clearly in the title the related element (OSDK for generic questions, PictConv, FilePack, XA, Euphoric, etc...) to make it easy to locate messages.

User avatar
goyo
Officer Cadet
Posts: 52
Joined: Sat Jan 12, 2019 10:16 am

use OSDK under Linux ?

Post by goyo »

Hi,

I would like to use OSDK on Linux. Is it possible ? Is there a turorial about this ?

May I compile Oricutron and XA compiler ? with which compiler cc , gcc, g++ ? :shock:
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: use OSDK under Linux ?

Post by Dbug »

It does compile on Linux, thanks to mmu_man and Jylam, maybe you could ask on the osdn.net forum, see if we can have all the information there (they are both on the project list, so they should see the message):

https://osdn.net/projects/oricsdk/forums/
User avatar
Chema
Game master
Posts: 3014
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: use OSDK under Linux ?

Post by Chema »

I think you should use wine, but some other user (who?) was porting it, not without difficulty.

EDIT: crossed posting with Dbug. His answer is better.
User avatar
goyo
Officer Cadet
Posts: 52
Joined: Sat Jan 12, 2019 10:16 am

Re: use OSDK under Linux ?

Post by goyo »

Thanks to you two :)
mmu_man
Flight Lieutenant
Posts: 322
Joined: Thu Sep 21, 2006 7:45 pm
Location: 26000 Valence, FRANCE
Contact:

Re: use OSDK under Linux ?

Post by mmu_man »

Yeah it should compile but I don't think I wrote the install rules to have it installed properly somewhere. Also most examples are using batch files so you'd have to add proper makefiles (I did write a template that even extracted the infos from the .bat though).
I'll have to look at it again.
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: use OSDK under Linux ?

Post by xahmol »

Any update on this?
I am looking to move all my retro build chains (next to the Oric, also Commodore, ZX Spectrum and TI-99/4a targets) to the fullest extent possible to Linux (Ubuntu) on a dedicated Linux PC.

Now use mostly Windows Subsystems for Linux (with Ubuntu), with for the Oric now a hybrid build chain with CC65 under WSL and OSDK under Windows, which is not ideal.
And generally now more and more like to develop using Linux over Windows, especially as keeping build chains up to date directly from the latest sources is much more convenient using Linux (the C complier for the TI is only available in a Linux version, and both CC65 and Z88Dk are much easier to compile from latest source on Linux. Also for Oricutron, compiling for Linux seems easier from the repo than setting up a Windows build environment to compile from source).
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: use OSDK under Linux ?

Post by xahmol »

See meanwhile that the repo at https://osdn.net/projects/oricsdk/scm/s ... osdk/main/ does include Makefiles.

So will try to build using them after I succeeded in setting up my Linux PC.
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: use OSDK under Linux ?

Post by xahmol »

Question (and sorry to be a Linux n00b):
If I try to build using the makefile under Linux, first thing I encounter is that it includes a rules.mk which seem not to be included. What should be the content of that file?

And would the absence of that file why I, after commenting out this include for rules.mk, get errors for two header files missing:
- debug.c: for this commenting out seems to work fine
- direct.h: apparently a Microsoft C lib if I google, but replacing with unistd.h (as suggested on most Google answers) still gives missing fuctions.

So not able to build in Linux yet, If somebody can give me some pointers, appreciated!
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: use OSDK under Linux ?

Post by iss »

xahmol wrote: Thu May 27, 2021 10:15 am So not able to build in Linux yet, If somebody can give me some pointers, appreciated!
EDIT: Well, here we go:
1. Create a working directory in your home (for instance OSDK-build) and cd to it:

Code: Select all

mkdir ~/OSDK-build
cd ~/OSDK-build
2. Download attached bash script and extract it to ~/OSDK-build. Make it executable and execute it:

Code: Select all

$ chmod +x doit-osdk.sh
$ ./doit-osdk.sh
3. As result you should nave:

Code: Select all

DONE! Your OSDK for Linux is in: ~/OSDK-build/pc/tools/osdk/main/osdk-linux/
Probably you will need the development package of freeimage for pictconv.
This is for Fedora, for your distribution install it with your package manager.

Code: Select all

$dnf install freeimage freeimage-devel
Package freeimage-3.18.0-7.fc32.x86_64 is already installed.
Package freeimage-devel-3.18.0-7.fc32.x86_64 is already installed.
That's all! Try it and post some feedback ;).
Attachments
doit-osdk.sh.zip
(619 Bytes) Downloaded 189 times
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: use OSDK under Linux ?

Post by xahmol »

Thank you so much, Iss!
Works perfectly. Now have the OSDK tools working under Ubuntu.
User avatar
iss
Wing Commander
Posts: 1641
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: use OSDK under Linux ?

Post by iss »

I'm very glad to help!
Now It's up to you what to use for your projects: bash-scripts, makefiles, cmake ... etc or even code::blocks or vscode as replacement of the MSDOS batch files :). I've made a Makefile-based project management system and we (with @rax) are using it for our projects.
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: use OSDK under Linux ?

Post by xahmol »

I am certainly going to use make, as I use that already on my TI, Commodore and Spectrum projects. Like the flexibility of make, but your project management system probably is way more advanced ;-)
Actually was already using a makefile for my Ludo game to build the binaries from source under WSL, just used a Windows batch file afterwards to build the .DSK from the generated .TAP files.
User avatar
xahmol
Flight Lieutenant
Posts: 437
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: use OSDK under Linux ?

Post by xahmol »

Update:
Now have my Oric build chain fully converted to Linux (Ubuntu):
- CC65 compiled for Linux
- OSDK compiled for Linux
- Oricutron compiled for Linux
- and even the HxC software tools compiled for Linux, including a command line version to include in my Makefile.

To investigate:
- OricExplorer should be able to compile for Linux using Mono, but as I am completely new to .Net that for me is still a somewhat daunting endeavour. Anybody hacing experience with compiling Oric Explorer for Linux?

So now use this makefile to build binaries, DSK file and convert to HFE automatically in one go:

Code: Select all

OSDK = /home/xahmol/OSDK-build/pc/tools/osdk/main/osdk-linux/bin/
YM2MYM = $(OSDK)Ym2Mym -h1 -m8192
HXCFE = /home/xahmol/retro/oric/hxcfloppyemu-code/HxCFloppyEmulator/HxCFloppyEmulator_cmdline/trunk/build/
WORKDIR = $(shell pwd)

SOURCES = src/main.c
LIBOBJECTS = include/libsedoric-ca65.s include/MYM.s include/ijkdriver-ca65.s

TESTSOURCES = src/savetest.c
TESTOBJECTS = include/libsedoric-ca65.s

DISK = BUILD/LUDO.dsk
PROGRAM = BUILD/LUDOMAIN.bin
TESTPROG = BUILD/SAVETEST.bin

CC65_TARGET = atmos
CC = cl65
CFLAGS  = -t $(CC65_TARGET) --create-dep $(<:.c=.d) -Oirs -I include
LDFLAGS = -t $(CC65_TARGET) -m $(PROGRAM).map
LDFLAGSTEST = -t $(CC65_TARGET) -m $(TESTPROG).map

########################################

.SUFFIXES:
.PHONY: all clean
all: $(PROGRAM) $(TESTPROG) $(DISK)

ifneq ($(MAKECMDGOALS),clean)
-include $(SOURCES:.c=.d) $(SOURCESUPD:.c=.d)
endif

%.o: %.c
	$(CC) -c $(CFLAGS) -o $@ $<
  
$(PROGRAM): $(SOURCES:.c=.o)
	$(CC) $(LDFLAGS) -o $@ $^ $(LIBOBJECTS)

$(TESTPROG): $(TESTSOURCES:.c=.o)
	$(CC) $(LDFLAGSTEST) -o $@ $^ $(TESTOBJECTS)

$(DISK): $(PROGRAM) $(TESTPROG)
	$(OSDK)header $(PROGRAM) BUILD/LUDOMAIN.tap 0x0501
	$(OSDK)header $(TESTPROG) BUILD/SAVETEST.tap 0x0501
	$(OSDK)header data/LUDODATA.bin BUILD/LUDODATA.tap 0xb000
	$(YM2MYM) "music/R-Type  2 - level 1.ym" BUILD/R-Type.tap		0x7e00 "LUDOMUS1"
	$(YM2MYM) "music/Wizball 1.ym" BUILD/Wizzball.tap               0x7e00 "LUDOMUS2"
	$(YM2MYM) "music/Defender of the Crown 1.ym" BUILD/Defender.tap 0x7e00 "LUDOMUS3"
	$(OSDK)tap2dsk -iCLS:LUDOMAIN -c20:3 -nLUDO BUILD/LUDOMAIN.tap BUILD/SAVETEST.tap screen/LUDOTITL.tap screen/LUDOSCRM.tap BUILD/LUDODATA.tap BUILD/R-Type.tap BUILD/Defender.tap BUILD/Wizzball.tap $(DISK)
	$(OSDK)old2mfm $(DISK)
	cd $(HXCFE); hxcfe -finput:"$(WORKDIR)/$(DISK)" -foutput:"$(WORKDIR)/BUILD/LUDO.hfe" -conv:HXC_HFE

clean:
	$(RM) $(SOURCES:.c=.o) $(SOURCES:.c=.d) $(TESTSOURCES:.c=.o) $(TESTSOURCES:.c=.d) $(PROGRAM) $(PROGRAM).map $(TESTPROG) $(TESTPROG).map
	
I am pretty sure this Makefile can be further optimised, but it works!
Schermafdruk van 2021-05-30 00-09-25.png
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: use OSDK under Linux ?

Post by Dbug »

Well done :)
User avatar
Chema
Game master
Posts: 3014
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: use OSDK under Linux ?

Post by Chema »

Indeed! :)
Post Reply