flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Mouse Activated, IRQ 12 triggered, Keyboard no longer works.

Author
Thread Post new topic Reply to topic
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport 18 Apr 2016, 21:51
***PLEASE SEE MY LATEST POST with attachment v.30

I'm trying to verify that IRQ 12 is working by performing a cpu reset whenever the mouse generates the required int. However, nothing I have tried will trigger irq12. Enclosed is a zip file of my code for examination. My keyboard irq works just fine.. thanks


Description:
Download
Filename: OSPortG_v0.27.0.zip
Filesize: 16.92 KB
Downloaded: 863 Time(s)


_________________
It's the desire to learn that leads to success...

http://www.webicomp.com


Last edited by newport on 11 Dec 2016, 21:58; edited 4 times in total
Post 18 Apr 2016, 21:51
View user's profile Send private message Visit poster's website Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport 02 May 2016, 02:03
well here it is 2 weeks later and I still ain't figured it out... guess nobody else has a clue either.. lol
Post 02 May 2016, 02:03
View user's profile Send private message Visit poster's website Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 02 May 2016, 09:30
Could it be simply that your USB mouse doesn't generate IRQ12?
Post 02 May 2016, 09:30
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 02 May 2016, 09:47
Can you point out where the mouse code is?

Two things that could be the problem are: (1) The mouse and IRQ12 haven't been enabled on the keyboard [804x] controller (2) there are other (higher priority) IRQs firing first that have not been cleared on the IRQ [8259] controller, preventing IRQ12 being serviced.
Post 02 May 2016, 09:47
View user's profile Send private message Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC 02 May 2016, 17:04
to activate the mouse you need some specific initialization code beyond the Keyboard Controller. I looked through your code but couldn't find that code anywhere. its fairly complex as you need to wait for the Keyboard Controller to respond to about 3 commands (in a specific order). the mouse won't do anything until you send it the signal to activate.

on a lighter note; are you using a PS/2 keyboard with a USB mouse? it might have USB support disabled in the BIOS.

- Stefan

_________________
byte me.
Post 02 May 2016, 17:04
View user's profile Send private message Visit poster's website Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport 11 Dec 2016, 21:56
Ok, after taking several months off, cause trying to get the mouse working had me ready to jump off a cliff, i've come back to it. I've included the mouse code to activate in the syscom.asm file in the new attachment, but now, it automatically triggers IRQ12 upon activation and gets stuck. The keyboard will no longer work. I just don't understand what's happening.. can someone please help me to understand where I'm going wrong? I can't continue to build on my OS without the mouse. To go where I'm going with it, the mouse is essential to its development. Thanks.


Description:
Download
Filename: OSPort v.30.zip
Filesize: 17.74 KB
Downloaded: 861 Time(s)


_________________
It's the desire to learn that leads to success...

http://www.webicomp.com
Post 11 Dec 2016, 21:56
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 12 Dec 2016, 01:09
When you say "stuck", does that mean it can't release the IRQ and continually goes back to IRQ12, or that it keeps looping within the IRQ12 handler and never gets to the IRET?
Post 12 Dec 2016, 01:09
View user's profile Send private message Visit poster's website Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport 12 Dec 2016, 02:00
i believe it's not getting to the IRET. it's like it triggers irq12, displays message and freezes..
Post 12 Dec 2016, 02:00
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 12 Dec 2016, 02:13
newport wrote:
i believe it's not getting to the IRET. it's like it triggers irq12, displays message and freezes..
Can you try to turn the "belief" into a proof? Print a character to the screen at strategic points in the handler to see where things start to go bad. "A" at entry, "B" at some decision point, "C" at another decision point, etc.
Post 12 Dec 2016, 02:13
View user's profile Send private message Visit poster's website Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport 12 Dec 2016, 02:25
ok. it just prints character after character.. it wont issue the IRET. I'm certain.
Post 12 Dec 2016, 02:25
View user's profile Send private message Visit poster's website Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport 12 Dec 2016, 02:25
it won't even jump to another location outside the IRET
Post 12 Dec 2016, 02:25
View user's profile Send private message Visit poster's website Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport 12 Dec 2016, 02:30
when enabling the mouse, this code here triggers the IRQ12.
Code:
  mov al, 0xF4      ; Activate Mouse in Stream Mode
  out 0x60, al      ; write ps/2 controller output port (activate mouse)
    


..and the IRET doesn't get fired to send it back to the kernel loop where you can type on the keyboard. If I omit this part of the mouse activation, of course, IRQ12 never happens and the system(OS) works as intended.
Post 12 Dec 2016, 02:30
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 12 Dec 2016, 02:36
newport wrote:
ok. it just prints character after character.. it wont issue the IRET. I'm certain.
So you need to determine why. What condition is making it loop? Why doesn't the condition change?
Post 12 Dec 2016, 02:36
View user's profile Send private message Visit poster's website Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport 12 Dec 2016, 02:47
that I don't have a clue.. even if I omit all the code in the IRQ - so that it is just a blank call, it still gets stuck..
Post 12 Dec 2016, 02:47
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 12 Dec 2016, 03:04
newport wrote:
that I don't have a clue.. even if I omit all the code in the IRQ - so that it is just a blank call, it still gets stuck..
Become friends with the character printing. Without a debugger, printing is a good way to see what is happening. Create a function to print all the registers and call it at various point in the handler. There is so much you can learn about the code by printing the current state, or printing some specific values, or seeing which bits are set/cleared, etc.
Post 12 Dec 2016, 03:04
View user's profile Send private message Visit poster's website Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport 12 Dec 2016, 03:18
ok.. thanks. I will give it a shot.
Post 12 Dec 2016, 03:18
View user's profile Send private message Visit poster's website Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC 13 Dec 2016, 01:02
the last file you published (I'm the 1 downloader apparently) has a severe error in file 'syscom.asm'. line 27 embeds a character string in the code. I just started looking at it.

Stefan
Post 13 Dec 2016, 01:02
View user's profile Send private message Visit poster's website Reply with quote
newport



Joined: 08 Jun 2012
Posts: 86
Location: Kentucky, USA
newport 14 Dec 2016, 05:51
ok.. i deleted lines 27 and 28. I wasn't sure about those either. I'm still trying to understand what I'm coding. Anyways, something strange happened, or at least to me it's strange. If I add my keyboard routine to IRQ12, both the mouse and keyboard work as expected. However, if I omit the keyboard routine from either IRQ1 or IRQ12, it gets hung, nothing happens.
Post 14 Dec 2016, 05:51
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.