Calling AES function from inside GDOS/VDI possible?

C and PASCAL (or any other high-level languages) in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11926
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Calling AES function from inside GDOS/VDI possible?

Postby wongck » Sun Jan 17, 2016 11:43 pm

So this one probably for the TOS internals guru/jedi master.

I am trying to call AES file selector from inside of VDI/GDOS, running single TOS (TOS 4), using C (gcc).
Basically the setup is like this:
1. Application calls GDOS printer function
2. GDOS calls printer driver
3. printer driver calls AES file selector

On my 2 test beds -
1. Atari Works = no issues, AES file selector was able to return with pathname, file generated and GDOS exits (clean or not, I do not know) but no crashes.
2. QED = crashes, AES file selector was able to return with pathname, file generated and GDOS exits but crashes QED with a string of bombs. ( cannot count them as it clears out fast).

I am hoping that it is possible to call AES functions from within GDOS functions.
I know it's a long shot and probably not advisable ( else why meta file GEMFILE goes to a predefined filename).
Any ideas ?
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
Mikefulton
Captain Atari
Captain Atari
Posts: 169
Joined: Sun Nov 29, 2015 10:27 am

Re: Calling AES function from inside GDOS/VDI possible?

Postby Mikefulton » Mon Jan 18, 2016 4:12 am

No. It won't work, at least not reliably. I'm surprised it did anything with AtariWorks.

Traditionally, to do the sort of thing you're talking about, one has a separate desk accessory that does the UI stuff. However, that happens *before* the driver is loaded, to alter a configuration in the driver. In the scenario you describe, a desk accessory wouldn't work because it would normally be inside evnt_multi when the print operation is being done, and since the application printing isn't calling any event library functions at the moment, there's no way to kick the accessory into action. (This might work differently under MultiTOS.)

There are several issues. First, there's no associated application registered with AES. Second, while device drivers are standard program files, they don't contain the same startup code that a regular program would have. They normally don't configure a stack. They don't shrink the TPA.

My guess regarding your crash is stack overflow, BTW. If all you're doing is using the file selector, then *maybe* you can get it working by configuring a decent-sized stack to use while making the fsel_input call. Also, if you're going to set up a stack, consider switching to user mode as well, then switching back afterwards. I don't recall details, but I have a vague memory that there is some potential issue involved with calling AES from supervisor mode.

I'm presuming you're wanting to select a target PDF filename. Your best bet is probably to generate filenames that include a timestamp, like "20160117az.pdf" where the last two letters represent the hour and minute in some fashion.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11926
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Calling AES function from inside GDOS/VDI possible?

Postby wongck » Mon Jan 18, 2016 11:46 am

Ok, seems like a lot of work just to make a file selection working. I would just default it to some filename and risk overwriting it.
That filename using date-time stamp will create funny looking name.

And yes, it's for the target PDF filename. :wink:
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 1 guest