Ubuntu 14.04.4 and uqlx2017

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

Re: Ubuntu 14.04.4 and uqlx2017

Post by Martin_Head »

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
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Ubuntu 14.04.4 and uqlx2017

Post by XorA »

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


User avatar
XorA
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Ubuntu 14.04.4 and uqlx2017

Post by XorA »

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


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

Re: Ubuntu 14.04.4 and uqlx2017

Post by QLvsJAGUAR »

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?


QL forever!
https://www.sinclairql.net/ - Go and get THE DISTRIBUTION & QL/E!
https://www.youtube.com/QLvsJAGUAR/community - Blog
https://www.youtube.com/QLvsJAGUAR - Dedicated QL videos
Sinclair, QL, ATARI, JAGUAR, NUON, APPLE, NeXT, MiST & much more...
Videos, pictures & information
swensont
Forum Moderator
Posts: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Ubuntu 14.04.4 and uqlx2017

Post by swensont »

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
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Ubuntu 14.04.4 and uqlx2017

Post by XorA »

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
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Ubuntu 14.04.4 and uqlx2017

Post by Martin_Head »

I think I have got my network driver working in uqlx2017.
uqlxNETdriver4_cde.zip
(5.75 KiB) Downloaded 170 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
Site Admin
Posts: 1359
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Ubuntu 14.04.4 and uqlx2017

Post by XorA »

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: 252
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: Ubuntu 14.04.4 and uqlx2017

Post by swensont »

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
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Ubuntu 14.04.4 and uqlx2017

Post by Martin_Head »

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.


Post Reply