GEMDOS console functions and termination upon ctrl c

GFA, ASM, STOS, ...

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

Count
Atarian
Atarian
Posts: 9
Joined: Sat Sep 16, 2017 9:15 am

GEMDOS console functions and termination upon ctrl c

Postby Count » Fri Nov 23, 2018 10:29 am

As you may know, the GEMDOS console functions like Cconout, Cconin etc. lead to program termination when ctrl c is pressed. Same with mintlib's standard io functions, which use Fwrite and Fread.

Is there any way to disable this behaviour (plain TOS)?

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2466
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: GEMDOS console functions and termination upon ctrl c

Postby charles » Fri Nov 23, 2018 11:41 am

rewrite over it in memory?
or avoid using it.
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!

joska
Hardware Guru
Hardware Guru
Posts: 4358
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: GEMDOS console functions and termination upon ctrl c

Postby joska » Fri Nov 23, 2018 11:57 am

Not tested by me, but I believe you can use Crawin()/Crawio() for character input/output.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

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

Re: GEMDOS console functions and termination upon ctrl c

Postby wongck » Fri Nov 23, 2018 3:43 pm

Not tested, may be Bconin/Bconout is low level enough?
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 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

joska
Hardware Guru
Hardware Guru
Posts: 4358
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: GEMDOS console functions and termination upon ctrl c

Postby joska » Fri Nov 23, 2018 8:39 pm

As a general rule you should not use BIOS functions when writing a GEMDOS program.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

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

Re: GEMDOS console functions and termination upon ctrl c

Postby wongck » Fri Nov 23, 2018 11:57 pm

Ah, learn something new everyday. Thanks for the rule.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 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

Count
Atarian
Atarian
Posts: 9
Joined: Sat Sep 16, 2017 9:15 am

Re: GEMDOS console functions and termination upon ctrl c

Postby Count » Sat Nov 24, 2018 3:54 pm

joska wrote:As a general rule you should not use BIOS functions when writing a GEMDOS program.

That was my intention to ask this question. But if there is no chance to disable that by setting a bit in a system variable or something like that, I will switch over to BIOS functions. The RAWCON device is no option since I need the VT52 sequences.

User avatar
shoggoth
Nature
Nature
Posts: 962
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: GEMDOS console functions and termination upon ctrl c

Postby shoggoth » Sat Nov 24, 2018 9:23 pm

If you’re writing C code, just catch the appropriera signal iirc.
Ain't no space like PeP-space.

Spectone
Atariator
Atariator
Posts: 26
Joined: Thu Dec 27, 2012 4:15 am
Location: Queensland

Re: GEMDOS console functions and termination upon ctrl c

Postby Spectone » Mon Dec 24, 2018 4:08 pm

When a ctrl-c is received gemdos calls Pterm() but before it terminates the process it call the etv_term vector to give the process a chance to clean up. Setexc() can set the etv_term vector.

Where does Pterm() lead to? Probably the previous Pexec(). You can call Pexec() youself and when you get that Pterm() execution will return to just after the Pexec() you called.


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 3 guests