Enterprise Forever

:UK => Programming => Topic started by: gflorez on 2016.February.10. 00:00:07

Title: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.10. 00:00:07
A mouse channel always needs a video channel where to draw the pointer. But on some circumstances the video channel disappears and the  mouse driver doesn't have a way to detect the situation.

I'm implementing a detection routine that is triggered when the mouse is on idle for more than a second.

The problem I've found is that I can't use any EXOS call to check if the video channel is still open, because the routine is in the middle of an interruption and the calls return 254, (EXOS call not allowed).

I have to find a way to check directly the opened channels in the Channel Descriptor Chain, but the Explanations on the Kernel Manual are very confusing.

It says that the zone starts on AB41h, but I've not found more information about how it is organized. Peeking near the address gives apparently random numbers.

Can somebody teach me about this?
Title: Re: Where is the Channel Descriptor Chain?
Post by: ergoGnomik on 2016.February.10. 07:39:56
I'm not an expert of these computers at all, but isn't this (http://ep.homeserver.hu/Dokumentacio/Konyvek/EXOS_2.1_technikal_information/exos/kernel/Ch6.html) what you are looking for?
Title: Re: Where is the Channel Descriptor Chain?
Post by: Zozosoft on 2016.February.10. 09:41:29
It says that the zone starts on AB41h,
On which EXOS version? It is not fixed :oops:
Title: Re: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.10. 10:10:09
OK, not fixed but, is there a way to easily check(within an interrupt) if a channel exists? 

Of course it must be EXOS version independent....
Title: Re: Where is the Channel Descriptor Chain?
Post by: Zozosoft on 2016.February.10. 10:46:58
if a channel exists?  
It is not enought. Also need to know the mode, size, memory address are don't changed.
Title: Re: Where is the Channel Descriptor Chain?
Post by: ergoGnomik on 2016.February.10. 11:02:15
I think it is a bad idea to check if a given channel exists every time an interrupt is triggered. It'd be better to hook all the given channel's handler calls and change the setup of your driver according to the changes happening.
Title: Re: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.10. 11:05:20
You are right, but these are things that a programmer has to know while coding, not an error that happens easily when a user types TEXT exiting from a GRAPHICS mode associated to a Mouse channel.

I think that only checking if the channel exists is enough.
Title: Re: Where is the Channel Descriptor Chain?
Post by: Zozosoft on 2016.February.10. 11:09:46
Easy possible video page moved in memory when other channel(s) closed.
Title: Re: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.10. 11:15:02
I think it is a bad idea to check if a given channel exists every time an interrupt is triggered. It'd be better to hook all the given channel's handler calls and change the setup of your driver according to the changes happening.

The check is done only every 50 interrupts, and only if the mouse is stopped, so the routine is not time hungry...

It is good Idea to save the entry of the video channel at the initialisation, but it can disappear suddenly and EXOS moves the channel buffers by itself.
Title: Re: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.10. 11:26:40
I think, the normal use of the mouse driver is in a static screen, no changes of modes nor dimensions or colours. EGI is static. PaintBox seems to use two static video channels(three more for the canvas stripes), and alternates on both the unique possible mouse channel. The paint zone even scrolls...

Then, the modes, colours or dimensions can be changed, but are calculated inside the PaintBox.
Title: Re: Where is the Channel Descriptor Chain?
Post by: Zozosoft on 2016.February.10. 11:35:44
I think it is can be done on safe way when the mouse driver will be built in the EXOS. Then possible to combine the mouse and video driver, and mouse driver can directly use video driver data.

Currently write to the User Manual: close MOUSE channel before any other channels closed!
Title: Re: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.10. 11:42:31
I think, the most important is to know if the video channel exists. Later, deeper checking can be done, but the existence of the channel is capital.

Currently write to the User Manual: close MOUSE channel before any other channels closed!

Yes, I will follow your advice.

The Mouse driver integrated on the Video driver..... sounds good.
Title: Re: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.10. 12:36:10
Done on the English and Spanish Wiki pages. Pear will do later on the other languages.

I miss the necessary Magyar version. Where is Szipucsu?
Title: Re: Where is the Channel Descriptor Chain?
Post by: ergoGnomik on 2016.February.10. 15:29:31
Obviously you do it as it pleases you, but checking the channel availability in the interrupt handler, no matter how seldom you are doing it, has nothing lost there. At least that's how I see it.

And I have a vague feeling that integrating the mouse driver into the video driver is a big kick in the balls of EXOS. (What about you, Zozo?)

Is there any specific reason that you wrote Magyar but did not write Español a line before it?
Title: Re: Where is the Channel Descriptor Chain?
Post by: Zozosoft on 2016.February.10. 15:57:16
And I have a vague feeling that integrating the mouse driver into the video driver is a big kick in the balls of EXOS. (What about you, Zozo?)
Driver not integrated. But when both are in the EXOS ROM, the possible call directly video driver routines.
These special function calls:
@@SIZE = 2 - return mode & size of page
@@ADDR = 3 - return video RAM address
needed, which are normaly called by EXOS 11, but EXOS call not allowed in interrupt handling. If both in same ROM then possible the direct calls.

The EXOS currently also use some direct calls, for example the KEYBOARD directly call DATE/TIME handler, when PAUSE pressed, for keep the time running. (This function missing from BRD, because it is external ROM, direct call don't possible)
Title: Re: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.10. 16:34:30

Is there any specific reason that you wrote Magyar but did not write Español a line before it?

I wrote as this because it reminds me when I collected postal stamps when I was a child, long, long ago..."Magyar Posta"(the world most colorful stamps at that time.)

On the other side, my idiom is Castellano, or Castillian in English, one of the languages spoken on Spain. But as it is the common language, it is named Spanish outside Spain....
Title: Re: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.10. 16:45:01
Obviously you do it as it pleases you, but checking the channel availability in the interrupt handler, no matter how seldom you are doing it, has nothing lost there. At least that's how I see it.

I only want to do the correct, if it can be done. I don't want the driver causing errors. I want to implement a solution.

I have fixed other errors on it. May be I'm not the most experienced coder, but I put all my effort on it....
Title: Re: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.10. 18:12:01
This one second(50 interrupts) routine will also serve to check which is the active(moving) controller and assign it automatically.

But fortunately that check can be done without EXOS calls.
Title: Re: Where is the Channel Descriptor Chain?
Post by: gflorez on 2016.February.14. 10:53:15
Zozo, seems that the memory map has not changed from EXOS 2.1.

Do you mean that it can change on next versions?

Following the addresses on the memory section on your information page(BFBA/B/Ch) I've discovered how the channels are stored. Still I don't know what are saved there, I'm only studying how to extract it.