Page 1 of 1

scroll, keyboard, and reboot

Posted: Sun Oct 20, 2002 3:11 pm
by Tom
[attachment deleted by admin]

Re:scroll, keyboard, and reboot

Posted: Sun Oct 20, 2002 7:31 pm
by gtsphere
hey tom, as for the reboot at least, i have this
GLOBAL _reboot      ;global allowing access to reboot function



;function: reboot
;purpose: reboots our comp
_reboot:

mov ah, 0
int 0x16 ;Bios keyboard service
jmp 0xFFFF:0x0000 ;reboot machine
ret ;Return to caller, heh pretty much this wastes a byte
this will reboot your computer, i just call it from a C file
extern void reboot;

hope this helps you out :-)

Re:scroll, keyboard, and reboot

Posted: Mon Oct 21, 2002 1:18 am
by Ozguxxx
...
mov ah, 0
int 0x16 ;Bios keyboard service
jmp 0xFFFF:0x0000 ;reboot machine
ret ;Return to caller, heh pretty much this wastes a byte
Is BIOS INT 16 be callable? (pmode???) I think, there is an easier way of rebooting computer by setting output port of 8042 keyboard controller. (just some ins and outs)

Re:scroll, keyboard, and reboot

Posted: Mon Oct 21, 2002 5:28 am
by drizzt
Is BIOS INT 16 be callable? (pmode???) I think, there is an easier way of rebooting computer by setting output port of 8042 keyboard controller. (just some ins and outs)

...just pulse the CPU reset line:

out_byte(0x64, 0xFE);

Re:scroll, keyboard, and reboot

Posted: Mon Oct 21, 2002 6:37 am
by Whatever5k
Tom, I'm getting quite angry now...I showed you the code for the shifting about three times now, and you always start a new thread! What the hell is wrong???

Ok, the last time I say it: When you check if the key is released, you have to AND it with 0x7F. Secondly, why the hell do you do

Code: Select all

if (scancode & KEYPRESS) /* key up */
{
   if (scancode != KRLEFT_SHIFT || .....)
        shift = FALSE;
   ...
}
This makes absolutely no sense. First of all, it doesn't work because you didn't AND with 0x7F - but if you had done this, it would mean that each time you release a key, you have unshifted keys...
So take s.th. like this:

Code: Select all

UINT GetRawKey(...)
{
  ...
  ...
  if (scancode & KEYPRESS)
  {
     scancode &= 0x7F; /* THIS HERE IS IMPORTANT! */
     if (scancode == KRLEFT_SHIFT || scancode == KRRIGHT_SHIFT)
         scan = FALSE;
     continue;
   }
  ...
}
reboot code:

Code: Select all

void reboot(void)
{
        u_char temp;

        cli();
        
        /* flush the keyboard controller */
        do
        {
                temp = inb(0x64);
                if (temp & 1)
                        inb(0x60);
        }while(temp & 2);

        /* send the CPU reset line */
        outb(0x64, 0xFE);
        
        hlt();
}

Re:scroll, keyboard, and reboot

Posted: Mon Oct 21, 2002 10:57 am
by Tom
abless wrote: Tom, I'm getting quite angry now...I showed you the code for the shifting about three times now, and you always start a new thread! ....
Well, This is only the 2nd thread, and I made a new one because the other one was too big and I needed help with other things too, like the reboot and stuff...

Any way, I tried that before and it didn't work..i'll try the & 0x... thing again...

Re:scroll, keyboard, and reboot

Posted: Mon Oct 21, 2002 11:05 am
by Tim
Don't start new threads if you think the current one is too big. If a thread is too big, either df or I will sort it out.

Re:scroll, keyboard, and reboot

Posted: Mon Oct 21, 2002 5:42 pm
by Tom
Well, I got my keyboard handler working! ;D :D

Now, all I had to do was change if (scancode!=... to If(scancode==) !

Now, all I need is a scroll funtion.

Oh, I also got a bug. I need more room for my kernel. It's loaded at 5000h, I know that's ok, but I need more room another way...How? I think Tim Rob. knows...or someone else...

Re:scroll, keyboard, and reboot

Posted: Tue Oct 22, 2002 4:37 am
by Tim
Tom wrote:I need more room for my kernel. It's loaded at 5000h, I know that's ok, but I need more room another way...How? I think Tim Rob. knows...or someone else...
Are you running out of memory space with your kernel loaded at 5000h? How big is it? You should only run out of space there if your kernel is bigger than about 630KB.

Re:scroll, keyboard, and reboot

Posted: Wed Oct 23, 2002 4:17 pm
by Tom
fixed the bug, had to load more sectors.

still no scroll function. If no one has it, that's ok.