Page 1 of 3

QDOS gcc made easy (docker stylee)

Posted: Fri Sep 15, 2017 6:24 pm
by XorA
Create a file hello.c

Code: Select all

#include <stdio.h>

int main(int argc, char **argv)
{
    printf("Hello\n");
}
run docker like so

Code: Select all

docker pull xora/qdos-gcc
docker  run -v $PWD:/build -w /build -u $USER xora/qdos-gcc qdos-gcc -o hello hello.c
and you should have hello as a QDOS executable.

This is my first play with docker so please let me know any problems.

Re: QDOS gcc made easy (docker stylee)

Posted: Fri Sep 15, 2017 7:49 pm
by XorA
Fixed image now so -w argument is no longer needed.

Re: QDOS gcc made easy (docker stylee)

Posted: Sun Jun 10, 2018 11:09 pm
by Fabrizio
Hi!

I would like to compile my universal game CROSS CHASE for the QL.
Ideally I would like to use it within Cygwin. To get me started as fast as possible I have tried the docker version but I cannot get to compile the hello world code.

I don't have much experience with docker. I have managed to pull the docker image.

I get the following error:
$ docker run -v $PWD:/build -w /build -u $USER xora/qdos-gcc qdos-gcc --version
C:\Program Files\Docker Toolbox\docker.exe: invalid reference format: repository name must be lowercase.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

On the other hand I can run
$ docker run xora/qdos-gcc qdos-gcc --version
2.95.3

But if I try to compile anything the file is not found.
$ docker run xora/qdos-gcc qdos-gcc /c/Retro/test/hello.c
qdos-gcc: /c/Retro/test/hello.c: No such file or directory
qdos-gcc: No input files

but the file is there

$ ll /c/Retro/test/hello.c
-rw-r--r-- 1 Brizio 197121 81 Jun 10 16:33 /c/Retro/test/hello.c

What am I doing wrong?

Re: QDOS gcc made easy (docker stylee)

Posted: Mon Jun 11, 2018 8:38 pm
by XorA
You need to remap the directory with the source code into the container.

Re: QDOS gcc made easy (docker stylee)

Posted: Tue Jun 12, 2018 9:28 am
by Fabrizio
How?
Could you please give me an example on how to build a hello world program?

I have tried the suggested command but I get:
C:\Program Files\Docker Toolbox\docker.exe: invalid reference format: repository name must be lowercase.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

Fabrizio

Re: QDOS gcc made easy (docker stylee)

Posted: Tue Jun 12, 2018 2:53 pm
by XorA
Fabrizio wrote:How?
Could you please give me an example on how to build a hello world program?

I have tried the suggested command but I get:
C:\Program Files\Docker Toolbox\docker.exe: invalid reference format: repository name must be lowercase.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

Fabrizio
-v $PWD:/build is what maps the directory to the /build dir where compiler is run inside the container.

so replace $PWD with your top level directory.

But I am unfamiliar with windows docker as to why you get that error message, my guess would be that either $PWD has a space in it or $USER does not exist in cygwin.

Re: QDOS gcc made easy (docker stylee)

Posted: Tue Jul 10, 2018 10:27 pm
by Fabrizio
Hi

I am not using Cygwin. I just want to compile a simple hello world program.

What is my top level directory?
/c/ ?

Let us say I have put the hello.c file into /c/Retro/hello.c, then I get:

$ docker run xora/qdos-gcc qdos-gcc -v /c/Retro/hello.c
qdos-gcc: /c/Retro/hello.c: No such file or directory
Reading specs from /usr/local/lib/gcc-lib/qdos/2.95.3/specs
gcc version 2.95.3 20010315 (release)

I have also tried:
$ docker run -v /c/Retro/hello.c -w /build -u $USER xora/qdos-gcc qdos-gcc -o hello hello.c
Unable to find image 'qdos-gcc:latest' locally
C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: pull access denied for qdos-gcc, repository does not exist or may require 'docker login'.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

Brizio@DESKTOP-I20P8HM MINGW64 /c/Program Files/Docker Toolbox
$ docker run -v /c/Retro/hello.c -w /build xora/qdos-gcc qdos-gcc -o hello hello.c
qdos-gcc: hello.c: No such file or directory
qdos-gcc: No input files


Could you please provide a simple command that compiles hello.c placed at /c/Retro/hello.c ?

Fabrizio

Re: QDOS gcc made easy (docker stylee)

Posted: Sat Jul 21, 2018 9:45 am
by Derek_Stewart
Hi,

I installed Docker on my Linux Mint 18.3 x64 laptop, pulled the xora/qdos-gcc image down.

I tried to compile the example hello_c file, but it would only compile when I changed the -u statement to root.

The resultant object file"hello" was created with ownership to root, which I changed ownership to my user account.

The object file was not executable, but qdos-gcc returned the data space figure, so I loaded the object file into a RESPR area with SMSQmualator and SEXEC the new file with the data space figure.

The new executable file runs in SMSQmulator OK.

Is it possible to have the object file QL executable header?

Re: QDOS gcc made easy (docker stylee)

Posted: Sat Jul 21, 2018 10:14 am
by tofro
Derek_Stewart wrote:
Is it possible to have the object file QL executable header?

Not easily - There's no way to store a QL file header anywhere on a foreign file system (other than, maybe, using the Q-Emulator method, which makes the file un-usable on native boxes). Your method to re-create the header on an Emulator was probably the best one.

Tobias

Re: QDOS gcc made easy (docker stylee)

Posted: Sat Jul 21, 2018 12:51 pm
by XorA
Compile qdos zip for linux and zip the exe. Qdos zip recognises the xtcc field and adds the header.