Jump to content

Photo

Let me introduce jaguarvbcc - docker


28 replies to this topic

#1 toarnold OFFLINE  

toarnold

    Space Invader

  • 37 posts

Posted Wed Jun 28, 2017 7:35 AM

Hi folks,

 

Do you wish to start in jaguar coding?

You don't like to configure a development chain?

Here is a solution. Use Docker!

Prerequsites: You need a Win 10 Pro/Enterprise 64 bit, a docker supported 64 bit linux (e.g. Ubuntu etc.) or a Mac. See here: https://www.docker.com/

 

You can find the vbcc jaguar docker image here: https://hub.docker.c...old/jaguarvbcc/

 

A quick demo with three simple steps

  1. Clone the jag2048 (https://github.com/t...old/jag2048.git) github repository (or download it as a zip file)
  2. Jump into the directory
  3. Execute the following command line

Linux users type

docker run --rm -v "$PWD":/usr/src/compile -w /usr/src/compile -u $(id -u $USER):$(id -g $USER) toarnold/jaguarvbcc:0.9f make

Window users type

docker run --rm -v "%cd%":/usr/src/compile -w /usr/src/compile toarnold/jaguarvbcc:0.9f make

This will produce a jag2048.jag file in the current folder. Upload this with your skunkboard or start it in virtualjaguar!

 

Greetings,

toarnold



#2 scottinNH OFFLINE  

scottinNH

    Star Raider

  • 57 posts

Posted Fri Jul 7, 2017 8:43 AM

Nice post. I think Docker containers will make life easier for cross OS development, since the toolchain is apart from the host OS (among other reasons).

 

FYI - as a new docker user - I believe you can remove the Prerequisite: "Win 10 Pro/Enterprise 64 bit" because any OS that can run Docker, will do the job.

 

 

For other folks: Linux is the most common host OS for Docker, and Summer 2016 releases brought first-class support for Windows and OSX.



#3 rocky1138 OFFLINE  

rocky1138

    Space Invader

  • 45 posts
  • Location:Canada

Posted Tue Aug 22, 2017 9:49 PM

Hi folks,

 

Do you wish to start in jaguar coding?

You don't like to configure a development chain?

Here is a solution. Use Docker!

Prerequsites: You need a Win 10 Pro/Enterprise 64 bit, a docker supported 64 bit linux (e.g. Ubuntu etc.) or a Mac. See here: https://www.docker.com/

 

You can find the vbcc jaguar docker image here: https://hub.docker.c...old/jaguarvbcc/

 

A quick demo with three simple steps

  1. Clone the jag2048 (https://github.com/t...old/jag2048.git) github repository (or download it as a zip file)
  2. Jump into the directory
  3. Execute the following command line

Linux users type

docker run --rm -v "$PWD":/usr/src/compile -w /usr/src/compile -u $(id -u $USER):$(id -g $USER) toarnold/jaguarvbcc:0.9f make

Window users type

docker run --rm -v "%cd%":/usr/src/compile -w /usr/src/compile toarnold/jaguarvbcc:0.9f make

This will produce a jag2048.jag file in the current folder. Upload this with your skunkboard or start it in virtualjaguar!

 

Greetings,

toarnold

 

Thank you for this.

 

Would you consider posting the Dockerfile?



#4 toarnold OFFLINE  

toarnold

    Space Invader

  • Topic Starter
  • 37 posts

Posted Tue Aug 22, 2017 11:54 PM

Hi rock1138,

 

no problem, but there is nothing special, because I copy the whole toolchain folder from my PC  ...

FROM alpine:3.6
ARG version
RUN apk add --no-cache make libc6-compat nodejs nodejs-npm

# copy files
COPY version/ /opt/jagdev/

# Apply path changes
ENV PATH="/opt/jagdev/bin:${PATH}" VBCC="/opt/jagdev" JVBCCVERSION=$version HOME=/tmp
#default command
CMD echo $JVBCCVERSION


#5 rocky1138 OFFLINE  

rocky1138

    Space Invader

  • 45 posts
  • Location:Canada

Posted Wed Aug 23, 2017 12:30 PM

 

Hi rock1138,

 

no problem, but there is nothing special, because I copy the whole toolchain folder from my PC  ...

FROM alpine:3.6
ARG version
RUN apk add --no-cache make libc6-compat nodejs nodejs-npm

# copy files
COPY version/ /opt/jagdev/

# Apply path changes
ENV PATH="/opt/jagdev/bin:${PATH}" VBCC="/opt/jagdev" JVBCCVERSION=$version HOME=/tmp
#default command
CMD echo $JVBCCVERSION

 

OK the reason I was asking is related to my other thread about vasm-m68k and vasm-jagrisc. Are you building those to use the madmac conventions? When you build your binary, do you use jagserv format?



#6 toarnold OFFLINE  

toarnold

    Space Invader

  • Topic Starter
  • 37 posts

Posted Wed Aug 23, 2017 11:03 PM

Hi rocky1138

 

 

OK the reason I was asking is related to my other thread about vasm-m68k and vasm-jagrisc. Are you building those to use the madmac conventions? When you build your binary, do you use jagserv format?

 

You can dig into the container by 

docker run --rm -it toarnold/jaguarvbcc:0.9f sh

In the folder /opt/jagdev/bin are the tools located. The vasm is compiled to support m68k with madmac and motorola syntax. Jagrisc supports madmac only.

 

And yes, I use jagserver format, too.



#7 rocky1138 OFFLINE  

rocky1138

    Space Invader

  • 45 posts
  • Location:Canada

Posted Sun Aug 27, 2017 8:30 PM

You ever think of dockerizing vasm and vlink? Then we could work of of the same versions, knowing that yours works.



#8 JagChris OFFLINE  

JagChris

    River Patroller

  • 3,645 posts
  • Location:Oregon

Posted Mon Aug 28, 2017 1:25 AM

I will post some 32 bit convenience builds soon.

#9 toarnold OFFLINE  

toarnold

    Space Invader

  • Topic Starter
  • 37 posts

Posted Mon Aug 28, 2017 2:14 AM

You ever think of dockerizing vasm and vlink? Then we could work of of the same versions, knowing that yours works.

Hi rocky1138,

 

vasm and vlink are dockerized in the above docker image!



#10 rocky1138 OFFLINE  

rocky1138

    Space Invader

  • 45 posts
  • Location:Canada

Posted Mon Aug 28, 2017 5:35 PM

Hi rocky1138,

 

vasm and vlink are dockerized in the above docker image!

 

Derp, you're right.



#11 Luigi301 OFFLINE  

Luigi301

    Moonsweeper

  • 372 posts

Posted Sat Sep 2, 2017 8:29 PM

I'd like to do some Jaguar programming. I'm trying to use this to compile a little hello world application. It works just fine compiling a jaglib program (jaglib is really neat by the way) but chokes for me trying to link it with a GPU program. I have my 68K C source and a little do-nothing GPU snippet:

    .include "jaguar.inc"
    
BMP_WIDTH    .equ    320
BMP_HEIGHT    .equ    200

    .globl    _jag_vidmem
    
    .gpu
VIDMEM        .equr    r16

    .org    G_RAM
_blank_screen::

    nop
    nop
    nop
    nop
    nop
    
    .68000
_blank_screen_end::

This assembles in vasmjagrisc_madmac but the linker complains?

docker run --rm -v C:/jaguar:/usr/src/compile --workdir /usr/src/compile toarnold/jaguarvbcc:0.9f vc -vv +jaguar -o hello.jag obj/hello.o obj/screen.o
vc frontend for vbcc (c) in 1995-2016 by Volker Barthelmann

Loading files:

/opt/jagdev/targets/m68k-jaguar/lib/startup.o (vobj-be object)
obj/hello.o (vobj-be object)
obj/screen.o (vobj-be object)
/opt/jagdev/targets/m68k-jaguar/lib/libjag.a (vobj-be library)
/opt/jagdev/targets/m68k-jaguar/lib/libvc.a (vobj-be library)

Digesting symbol information:

Joining selected sections:
Warning 64: Section screen.o(segf03000) was not recognized by target linker script.

Edited by Luigi301, Sat Sep 2, 2017 8:30 PM.


#12 toarnold OFFLINE  

toarnold

    Space Invader

  • Topic Starter
  • 37 posts

Posted Sun Sep 3, 2017 12:41 AM

I guess you should remove the .68000 section, 'cause vasm doesn't support it. It will be handled as an unkown section, but vlink has no definition vor that section.

Greetings
-toarnold

#13 Orion_ OFFLINE  

Orion_

    Dragonstomper

  • 522 posts
  • Location:France

Posted Sun Sep 3, 2017 1:50 AM

I don't understand what is docker and why this is needed ?

I compiled VBCC/VASM/VLINK for Windows and it works perfectly.

I prefer VBCC instead of gcc because you can compile with very few and lightweight executables, also the assembly call syntax is very easy to write with functions parameters as registers.

I used VBCC + RMAC + RLN for all my jaguar games starting from Elansar.

If you want a VBCC windows precompiled executable (maybe not the latest version of vbcc, but well ..) you can find one on my website in the tool section

http://onorisoft.fre...tari/falcon.htm


Edited by Orion_, Sun Sep 3, 2017 1:51 AM.


#14 JagChris OFFLINE  

JagChris

    River Patroller

  • 3,645 posts
  • Location:Oregon

Posted Sun Sep 3, 2017 3:41 AM

Vasm_Jrisc supports .68000 in this context

http://atariage.com/...he-jrisc/page-3

Usually ORG starts a separate section with a fixed base address
defined by ORG. But in the Jaguar/Madmac case it is more like a RORG,
relocating the labels inside a still active text section.

And .68000 seems to work like ending such a RORG-block.

.68000 also switches back from absolute assembling (to the
fixed address $f03000) to the .text section. This makes the label
_test_end being placed in .text again.

This seems related. The actual example is 3 posts or so down in the linked thread. Seems to be no way to link to specific posts in Mobile. Sorry.

Edited by JagChris, Sun Sep 3, 2017 4:11 AM.


#15 toarnold OFFLINE  

toarnold

    Space Invader

  • Topic Starter
  • 37 posts

Posted Sun Sep 3, 2017 4:59 AM

I don't understand what is docker and why this is needed ?

 

@Orion_

 

This is the "modern" way of working. It has two advantages:

  1. You are not forced to mess up your pc with a bunch of development tools and the corresponding enviroment like ENV variables etc. All is ready configured in the docker.
  2.  You can so easily use different versions side-by-side, 'cause everything is separated by docker.

 

Vasm_Jrisc supports .68000 in this context

@JagChris

 

I overlooked this. But the standard linker script used by vbcc jaguar config and vlink doesn't support this section. It must be defined by your own script. So the easiest way will be to remove the .68000 section in the gpu code. I will talk to Frank, so we can correct this in the next release maybe.

 

-toarnold



#16 Orion_ OFFLINE  

Orion_

    Dragonstomper

  • 522 posts
  • Location:France

Posted Sun Sep 3, 2017 5:03 AM

 

@Orion_

 

This is the "modern" way of working. It has two advantages:

  1. You are not forced to mess up your pc with a bunch of development tools and the corresponding enviroment like ENV variables etc. All is ready configured in the docker.
  2.  You can so easily use different versions side-by-side, 'cause everything is separated by docker.

it seems like people forgot how to do it the old and simple way ...

for VBCC on Jaguar I have no dependency, just the few VBCC executable files, rmac, rln, and thats it.

 

here is my compilation script:

 

set path="E:\Programmation\Jag\bin";"E:\Programmation\Falcon\VBCC\bin"
vc +vc.ini -c -O2 game.o game.c
rmac -fb -u main.s
rln -v -n -rq -a 802000 x 4000 -o test.rom main.o game.o



#17 toarnold OFFLINE  

toarnold

    Space Invader

  • Topic Starter
  • 37 posts

Posted Sun Sep 3, 2017 5:29 AM

This isn't the right place to discuss the pros and cons of docker. Use it or not. I never fogot the "old" ways, but for me docker is an additional benefit.



#18 Luigi301 OFFLINE  

Luigi301

    Moonsweeper

  • 372 posts

Posted Sun Sep 3, 2017 11:53 AM

Once I added a .phrase directive to my program before .gpu the error went away. .68000 being there or not doesn't affect anything.



#19 JagChris OFFLINE  

JagChris

    River Patroller

  • 3,645 posts
  • Location:Oregon

Posted Mon Sep 4, 2017 11:31 AM

It appeared to be just a warning. Did the program still run?

#20 Luigi301 OFFLINE  

Luigi301

    Moonsweeper

  • 372 posts

Posted Mon Sep 4, 2017 12:27 PM

No, it crashed the Jaguar without .phrase.


Edited by Luigi301, Mon Sep 4, 2017 12:27 PM.


#21 BeefMan OFFLINE  

BeefMan

    Chopper Commander

  • 100 posts

Posted Sat Oct 14, 2017 5:42 PM

Thanks toarnold!  Has anyone been able to compile the Doom source with this?



#22 swapd0 OFFLINE  

swapd0

    Moonsweeper

  • 389 posts

Posted Tue Jan 16, 2018 5:57 AM

WTF!?! I need some help.

 

Yesterday I've installed Docker, downloaded the vbcc jaguar docker image and the jag2048 sample, and it works.

 

But today it says that vc: Command not found.

 

I've downloaded the docker image again but I've the same error.

 

Also I've tried to install vbcc in my computer (osx) from dhs.nu and vbcc web, when I compile the jag2048 I got an error: no config file!

 

This is my /etc/vc.config

-cc=vbcc -quiet %s -o= %s %s -O=%ld -I/opt/local/bin/vbcc/targets/m68k-jaguar/include
-ccv=vbcc %s -o= %s %s -O=%ld -I/opt/local/bin/vbcc/targets/m68k-jaguar/include
-as=vasm -quiet -Faout -phxass -opt-pea -opt-clr -opt-fconst %s -o %s
-asv=vasm -Faout -phxass -opt-pea -opt-clr -opt-fconst %s -o %s
-rm=rm -f %s
-rmv=rm %s
-ld=vlink -bataritos -tos-flags 7 -x -Bstatic -Cvbcc -P__stksize -nostdlib -L/opt/local/bin/vbcc/targets/m68k-jaguar/lib /opt/local/bin/vbcc/targets/m68k-jaguar/lib/startup.o %s %s -lvc -ljag -lm -o %s
-l2=vlink -bataritos -tos-flags 7 -x -Bstatic -Cvbcc -P__stksize -nostdlib -L/opt/local/bin/vbcc/targets/m68k-jaguar/lib %s %s -o %s
-ldv=vlink -bataritos -tos-flags 7 -t -x -Bstatic -Cvbcc -P__stksize -nostdlib -L/opt/local/bin/vbcc/targets/m68k-jaguar/lib /opt/local/bin/vbcc/targets/m68k-jaguar/lib/startup.o %s %s -lvc -ljag -lm -o %s
-l2v=vlink -bataritos -tos-flags 7 -t -x -Bstatic -Cvbcc -P__stksize -nostdlib -L/opt/local/bin/vbcc/targets/m68k-jaguar/lib %s %s -o %s
-ldnodb=-s
-ul=-l%s
-cf=-F%s
-ml=10000


Edited by swapd0, Tue Jan 16, 2018 6:03 AM.


#23 ggn OFFLINE  

ggn

    Stargunner

  • 1,463 posts
  • Location:Athens, Greece

Posted Tue Jan 16, 2018 6:46 AM

It's been literally years since I was exposed to the toxic environment of vbcc but I do recall that in order to build anything I placed the config file in the root of the build folder. Also at least in Windows it's called "vc.cfg" - maybe you just need to rename it?

#24 swapd0 OFFLINE  

swapd0

    Moonsweeper

  • 389 posts

Posted Tue Jan 16, 2018 7:21 AM

Nope, tried with a local copy with both names (vc.cfg and vc.config)

 

Anyway, Thanks

 

Coding in asm was easier...



#25 ggn OFFLINE  

ggn

    Stargunner

  • 1,463 posts
  • Location:Athens, Greece

Posted Tue Jan 16, 2018 7:31 AM

Another thing I remembered (and confirmed from the manual):

`+file'
Use `file' as config-file.

So I suppose try +vc.cfg/config?




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users