Ubuntu 14.04.4 and uqlx2017

Discussion and advice about emulating the QL on other machines.
Martin_Head
Gold Card
Posts: 339
Joined: Tue Dec 17, 2013 1:17 pm

Re: Ubuntu 14.04.4 and uqlx2017

Postby Martin_Head » Mon Oct 08, 2018 10:34 am

XorA wrote:Thats the code for DrvClose()

Which are you referring to.

"move.l $1C(a3),a3" That's the address of the I/O routine in the driver linkage block.

or

"The address that is called (A3) contains $AAAAAAAC" AAAA is the I/O routine.

This is from the UQLX source code QLdrivers.c
    #if 0
    /* emulator opcodes */
    #define DEV_IO_INSTR 0xaaaa
    #define DEV_OPEN_INSTR 0xaaab
    #define DEV_CLOSE_INSTR 0xaaac
    #endif

I probably need to some more tests. I could try putting a Trap#3 instruction in, instead of calling the I/O routine directly (I only call the I/O routine directly because QPC2 did not like calling a Trap#3, while in a Trap#3, when using the IP driver).

And I could try writing some machine code test routines, to try to see what's happening.


User avatar
XorA
Super Gold Card
Posts: 550
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Ubuntu 14.04.4 and uqlx2017

Postby XorA » Mon Oct 08, 2018 10:50 am

Running the opcode AAAC causes uQlx to break out of 68k emulation and call the C function DrvClose().


User avatar
XorA
Super Gold Card
Posts: 550
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Ubuntu 14.04.4 and uqlx2017

Postby XorA » Mon Oct 08, 2018 10:53 am

Running opcode AAAA will as you say do the same but call DrvIo() C function!


User avatar
QLvsJAGUAR
Gold Card
Posts: 288
Joined: Tue Feb 15, 2011 8:42 am
Location: Lucerne, Switzerland
Contact:

Re: Ubuntu 14.04.4 and uqlx2017

Postby QLvsJAGUAR » Fri Oct 12, 2018 5:54 pm

Today I downloaded uQLx 2018 (patched version from Tim to fix the TCP/IP functionality) from Dilwyn's site.

Even called a patch, the binaries are much different from the official 2017 version. Look at the file sizes:

Code: Select all

qm_x86-64   1'289'328   19.02.2017 14:48
qm_armv6   1'072'148   19.02.2017 14:55
qm_armv7   1'064'008   19.02.2017 15:05
qm_armv8   1'319'056   19.02.2017 15:09
qm_x86-32   975'172   19.02.2017 18:34
qm_i32   984'324   06.10.2018 20:06
qm_i64   1'366'288   07.10.2018 09:58

uQLx 2017 is part of QL/E, runs pretty well except TCP/IP.

As a reference system I have a CentOS 7.4 64-bit system.

When using the 2018 64-bit binary qm_i64 instead of the 2017 file qm_x86-64, the emulation runs not as expected. It not even loads the boot program. DIR WIN1_ also produces weird things.

Question: Did anyone try and test it?


http://www.sinclairql.net/ - Go and get THE DISTRIBUTION & QL/E!
http://www.youtube.com/QLvsJAGUAR
https://plus.google.com/+QLvsJAGUAR
Sinclair, QL, ATARI, JAGUAR, NUON, APPLE & more
Videos, pictures & information
swensont
Forum Moderator
Posts: 130
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Ubuntu 14.04.4 and uqlx2017

Postby swensont » Fri Oct 12, 2018 8:18 pm

There were only two binaries that put in uqlx2018, 32 and 64-bit for Intel. I'll restest the 64-bit version and see that it works. The only changes where the ones made in the 32-bit version. I should have something by Monday.

Tim


User avatar
XorA
Super Gold Card
Posts: 550
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Ubuntu 14.04.4 and uqlx2017

Postby XorA » Fri Oct 12, 2018 10:37 pm

Even called a patch, the binaries are much different from the official 2017 version. Look at the file sizes


Eh? I am not seeing any massive difference in size there. Probably just the differences due to better/worse optimization of different gcc versions!


Martin_Head
Gold Card
Posts: 339
Joined: Tue Dec 17, 2013 1:17 pm

Re: Ubuntu 14.04.4 and uqlx2017

Postby Martin_Head » Sat Oct 13, 2018 4:15 pm

I think I have got my network driver working in uqlx2017.

uqlxNETdriver4_cde.zip
(5.75 KiB) Downloaded 4 times

I had to make some changes to the routine that reads data packets.

I have done a quick test between two copies of uqlx2017 running on the same PC. And a test between uqlx2017 on a Linux machine, and QPC2 on a Windows XP machine.

If anyone wants to try it in uqlx2018, you would need to patch the very end of the program. Change the *TCP_ and *SCK_ to TCP_ and SCK_, and alter the word lengths from 5 to 4.


User avatar
XorA
Super Gold Card
Posts: 550
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Ubuntu 14.04.4 and uqlx2017

Postby XorA » Sun Oct 14, 2018 1:04 am

Martin_Head wrote:I think I have got my network driver working in uqlx2017.

uqlxNETdriver4_cde.zip
I had to make some changes to the routine that reads data packets.

I have done a quick test between two copies of uqlx2017 running on the same PC. And a test between uqlx2017 on a Linux machine, and QPC2 on a Windows XP machine.

If anyone wants to try it in uqlx2018, you would need to patch the very end of the program. Change the *TCP_ and *SCK_ to TCP_ and SCK_, and alter the word lengths from 5 to 4.


Nice work, what was causing the problem?


swensont
Forum Moderator
Posts: 130
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Ubuntu 14.04.4 and uqlx2017

Postby swensont » Mon Oct 15, 2018 4:27 am

I've tested out the qm_i64 and I've got it running with no issues. I did have to make sure that my .uqlxrc was updated to get the rom's from the right directory. I would look there first of there is an issue.

It was compiled with gcc version 6.3.0 running on Lubuntu 17.04 (64-bit). This is the same system that I originally generated the first 64-bit binary on.

Tim


Martin_Head
Gold Card
Posts: 339
Joined: Tue Dec 17, 2013 1:17 pm

Re: Ubuntu 14.04.4 and uqlx2017

Postby Martin_Head » Mon Oct 15, 2018 10:36 am

XorA wrote:
Martin_Head wrote:I think I have got my network driver working in uqlx2017.

uqlxNETdriver4_cde.zip
I had to make some changes to the routine that reads data packets.

I have done a quick test between two copies of uqlx2017 running on the same PC. And a test between uqlx2017 on a Linux machine, and QPC2 on a Windows XP machine.

If anyone wants to try it in uqlx2018, you would need to patch the very end of the program. Change the *TCP_ and *SCK_ to TCP_ and SCK_, and alter the word lengths from 5 to 4.


Nice work, what was causing the problem?
There was two problems in the routine that reads the data packets by calling the IP device driver I/O routine directly.

In uqlx2017, the A3 register needs to be a pointer to the IP device driver linkage block when IP_RECV is called, where QPC2 does not.

And, when the IP device driver returns from IP_RECV. The value of the buffer pointer (A1) is updated, where in QPC2 it is not. (at least when you are just looking at the data in the IP buffer, rather than actually removing it).

The A3 problem was causing IP_RECV to return with the calling values unchanged, so when D0 was tested to see if it was not equal to zero (for an error), it was, so the routine failed.
And the A1 problem caused the buffer to be read incorrectly, because it did not expect the buffer pointer to have moved.



Return to “QL Emulation”

Who is online

Users browsing this forum: No registered users and 1 guest