New bootloader for AROS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Rinnan
Posts: 2
Joined: Thu Dec 15, 2005 12:00 am
Location: Honolulu, Hawai`i

New bootloader for AROS

Post by Rinnan »

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! :)
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re: New bootloader for AROS

Post by bubach »

i don't know much about it, but maybe this helps: http://bos.asmhackers.net/docs/mouse/
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
Da_Maestro
Member
Member
Posts: 144
Joined: Tue Oct 26, 2004 11:00 pm
Location: Australia

Re: New bootloader for AROS

Post by Da_Maestro »

search the grub source code for the word "mouse" :-p

Adam
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
Rinnan
Posts: 2
Joined: Thu Dec 15, 2005 12:00 am
Location: Honolulu, Hawai`i

Re: New bootloader for AROS

Post by Rinnan »

Hmm, no "mouse" in any source file in grub 0.97...
User avatar
gaf
Member
Member
Posts: 349
Joined: Thu Oct 21, 2004 11:00 pm
Location: Munich, Germany

Re: New bootloader for AROS

Post by gaf »

I don't know if GRUB already has an interrupt for the PS/2 enabled, if it does I want to disable it.
Grub doesn't touch the mouse, it should therefore be in the state the BIOS left it (Reset-Mode).
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),
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..

Here's a another site about the ps/2 protocol that you might not know yet.
Can someone who knows please explain how to use 0x64 to disable the ps/2 interrupt..
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.
..or how to install (and then uninstall) an interrupt without any helper-libraries or OS's ?
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 ?

(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..
Post Reply