Extending the operating system/Basic in compilied programs

Anything QL Software or Programming Related.
User avatar
Giorgio Garabello
Trump Card
Posts: 161
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, ITaly
Contact:

Re: Extending the operating system/Basic in compilied programs

Postby Giorgio Garabello » Fri Sep 22, 2017 2:04 pm

But the private table already contains the new names, so before completing, I have found that the net_start command has already been executed, so the private table already contains all the names it needs and does not need to be expanded.
Or do you mean to say that it tries to expand even if the program does not need to be expanded?

thanks in advance
Giorgio


Martin_Head
Trump Card
Posts: 234
Joined: Tue Dec 17, 2013 1:17 pm

Re: Extending the operating system/Basic in compilied programs

Postby Martin_Head » Sat Sep 23, 2017 11:08 am

Giorgio Garabello wrote:But the private table already contains the new names, so before completing, I have found that the net_start command has already been executed, so the private table already contains all the names it needs and does not need to be expanded.
Or do you mean to say that it tries to expand even if the program does not need to be expanded?

thanks in advance
Giorgio
I'm pretty sure that what happens when you add new SuperBASIC keywords, is that the new ones are always added to end of the list in the name table. If a name already exists in the table, the new one does not get slotted in in the old ones place.

If I understand correctly that what you are trying to do is 'pre create' a name table in you compiled program. You are looking at another big problem. The 'pre made' name table will contain the start addresses of the code of the keywords when you created the compiled program. Which may not be the same when the executable file is run .

Martin


User avatar
tofro
QL Wafer Drive
Posts: 1156
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Extending the operating system/Basic in compilied programs

Postby tofro » Sat Sep 23, 2017 11:24 am

Martin_Head wrote:I'm pretty sure that what happens when you add new SuperBASIC keywords, is that the new ones are always added to end of the list in the name table. If a name already exists in the table, the new one does not get slotted in in the old ones place.

Correct. BP.INIT doesn't walk the name table replacing addresses for names already existing - It will blindly add anything you give it in front of the list. That allows over-writing definitions with new definitions of a different type (for example, loading an M/C procedure with a name that is equal to a variable you have already used). So it will try to expand the name table in any case.

Tobias


User avatar
Giorgio Garabello
Trump Card
Posts: 161
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, ITaly
Contact:

Re: Extending the operating system/Basic in compilied programs

Postby Giorgio Garabello » Sat Sep 23, 2017 5:39 pm

tofro wrote:
Martin_Head wrote:I'm pretty sure that what happens when you add new SuperBASIC keywords, is that the new ones are always added to end of the list in the name table. If a name already exists in the table, the new one does not get slotted in in the old ones place.

Correct. BP.INIT doesn't walk the name table replacing addresses for names already existing - It will blindly add anything you give it in front of the list. That allows over-writing definitions with new definitions of a different type (for example, loading an M/C procedure with a name that is equal to a variable you have already used). So it will try to expand the name table in any case.

Tobias


Damn it is a pity :-(


Martin_Head
Trump Card
Posts: 234
Joined: Tue Dec 17, 2013 1:17 pm

Re: Extending the operating system/Basic in compilied programs

Postby Martin_Head » Mon Sep 25, 2017 10:24 am

There is a feature I have thought about about adding to my IP Network driver a few times which might get around your problem. It's a network restart command, that would allow you to change the network station number/IP address.

I'm guessing that you are trying to write some sort of compiled 'front end' to start the Network driver. This restart command should allow you to do something like

Code: Select all

In SuperBASIC

LRESPR the network driver
NET_START 99
EXEC your compiled program


In your compiled program

NET_RESTART 2


The NET_START 99 will start the driver and add all the new commands, the 99 is just an arbitrary number to get the driver started
The NET_RESTART 2 would then reset the driver to be Net station 2

I have not implemented this in the past is that I'm not sure I can actually do it, and do it safely for the system. Essentially it should be just closing a couple of TCP channels, then re-opening them and patching the drivers linkage block. However I would have to be careful about what else is open at the time. I would have to make sure that there are no open network channels, and I would have to remove the fileserver (FSERVE), if it's running.

Does this sound like it would get around your problem.


User avatar
tofro
QL Wafer Drive
Posts: 1156
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Extending the operating system/Basic in compilied programs

Postby tofro » Mon Sep 25, 2017 10:40 am

I think the simplest work-around would be to fetch the S*Basic #0 and drop a "NET_START & CHR$(10)" in there (Using Turbo Tookit's COMMAND_LINE and TYPE_IN commands, for example).

Obviously, you need to make sure S*Basic is not busy at that time.

Tobias


User avatar
Giorgio Garabello
Trump Card
Posts: 161
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, ITaly
Contact:

Re: Extending the operating system/Basic in compilied programs

Postby Giorgio Garabello » Mon Sep 25, 2017 10:45 am

I'm writing a workbench to handle every aspect of the network, adding new controls and features, both from the server side and from the client side.
Your solution would solve any problems!

Giorgio


Martin_Head
Trump Card
Posts: 234
Joined: Tue Dec 17, 2013 1:17 pm

Re: Extending the operating system/Basic in compilied programs

Postby Martin_Head » Mon Sep 25, 2017 10:47 am

tofro wrote:Obviously, you need to make sure S*Basic is not busy at that time.
And make sure you start your compiled program with EXEC and not EXEC_W


User avatar
Giorgio Garabello
Trump Card
Posts: 161
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, ITaly
Contact:

Re: Extending the operating system/Basic in compilied programs

Postby Giorgio Garabello » Mon Sep 25, 2017 11:01 am

tofro wrote:I think the simplest work-around would be to fetch the S*Basic #0 and drop a "NET_START & CHR$(10)" in there (Using Turbo Tookit's COMMAND_LINE and TYPE_IN commands, for example).

Obviously, you need to make sure S*Basic is not busy at that time.

Tobias

I have thought of it, but it does not seem to me to be a very reliable solution because of the possible problems you have just mentioned.

Giorgio



Return to “Software & Programming”

Who is online

Users browsing this forum: No registered users and 2 guests