Hello people of osdev:
I am working on a project to create (or rather, adapt) a new bootloader for the OS AROS. I'm modifying GRUB 0.97. I want to make several changes, some of which are started and working.
I consider this in the realm of an "OS"-like project because grub has so little resources on startup, it's like an OS of its own in a way. That's why I am asking for help in an OS developer's forum.
Here's what I have:
#1: Splash screen that shows AROS logo immediately after OS selection (done).
#2: Addition of a ps/2 mouse "driver" (or half-driver) that detects button positions on startup and uses that to select an OS, or select the menu (this speeds up boot since you no longer need a timeout and keypress)
#3: An aggressive search function that will find an AROS kernel anywhere on the harddrive. I plan to modify the AROS installer to create backups of the kernel. This is to help in a recovery-situation.
The problem I'm having is with #2.
According to this page:
http://www.computer-engineering.org/ps2mouse/
The proper command code to get the current status of the mouse is 0xEB. Or, possibly 0xE9. In any case both of these commands simply return an acknowledgement (0xFA) but nothing else, other than the keyboard code for "release of the return key". It should have sent me a three-byte response to my question. And other commands (such as reset, 0xff) do in fact send me various codes like 0xaa (passed self-tests) when they are done with the acknowledgement, so I know it's not the receiving code. I've looked at web pages until blind, for example:
http://66.102.7.104/search?q=cache:qtST ... =firefox-a
http://www.computer-engineering.org/ps2protocol/
http://coding.derkeiler.com/Archive/@$$ ... 00386.html
http://my.execpc.com/~geezer/osd/kbd/kbd.txt
and so on and so on, but still haven't found something that answers my questions, really.
For example, I often get 0xFE's in response (which is an error message) but have no idea what the error is. I don't know if GRUB already has an interrupt for the PS/2 enabled, if it does I want to disable it.
I want to disable the keyboard, or sort between keyboard and mouse input (better to disable it temporarily). But the disable keyboard command doesn't seem to have any effect (keyboard still sends codes)
So I'm lost in Intel land.
Can someone who knows please explain how to use 0x64 to disable the ps/2 interrupt, or how to install (and then uninstall) an interrupt without any helper-libraries or OS's (like DOS) (maybe the latter is better)?
Does anyone else have trouble requesting status from their ps/2 mouse? Maybe it's my mouse. Streaming mode works, but I'm trying to detect a button already held down, with no changes.
Anyway, sorry about the length. Going crazy, help if possible!
New bootloader for AROS
Re: New bootloader for AROS
i don't know much about it, but maybe this helps: http://bos.asmhackers.net/docs/mouse/
-
- Member
- Posts: 144
- Joined: Tue Oct 26, 2004 11:00 pm
- Location: Australia
Re: New bootloader for AROS
search the grub source code for the word "mouse" :-p
Adam
Adam
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
--- Albert Einstein
Re: New bootloader for AROS
Hmm, no "mouse" in any source file in grub 0.97...
Re: New bootloader for AROS
Grub doesn't touch the mouse, it should therefore be in the state the BIOS left it (Reset-Mode).I don't know if GRUB already has an interrupt for the PS/2 enabled, if it does I want to disable it.
To sort keyboard and mouse input you have to check bit0 (kbd) respectivly bit5 (mouse) of the controller's status byte and the to disable the kbd bit4 masking of the command byte can be masked. If this doesn't work there's probably something wrong with your code - maybe you could post the interesting parts..I want to disable the keyboard, or sort between keyboard and mouse input (better to disable it temporarily). But the disable keyboard command doesn't seem to have any effect (keyboard still sends codes),
Here's a another site about the ps/2 protocol that you might not know yet.
The mouse doesn't send any movement packets until you enabled data-repording by issuing command 0xf4, you therefore shouldn't get any interrupts in the first place.Can someone who knows please explain how to use 0x64 to disable the ps/2 interrupt..
Installing an interrupt handler is really simple but it might not won't allow you to detect keys that are already held down when your loader gets started. I however have some doubt whether that's possible at all as the mouse might not even have been enabled when you push the button. Do you really think that the 2 seconds you might save that way are worth all the trouble ?..or how to install (and then uninstall) an interrupt without any helper-libraries or OS's ?
(1) Remap the PIC (tutorial)
(2) Install a basic gdt (tut) and idt (tut)
(3) Enable the mouse irq in the controller's command byte and send 0xf4 to the mouse activate data-reporting
regards,
gaf
btw: Please use the url-tag when posting addresses..