scroll, keyboard, and reboot

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
Tom

scroll, keyboard, and reboot

Post by Tom »

[attachment deleted by admin]
gtsphere

Re:scroll, keyboard, and reboot

Post 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 :-)
Ozguxxx

Re:scroll, keyboard, and reboot

Post 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)
drizzt

Re:scroll, keyboard, and reboot

Post 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);
Whatever5k

Re:scroll, keyboard, and reboot

Post 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();
}
Tom

Re:scroll, keyboard, and reboot

Post 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...
Tim

Re:scroll, keyboard, and reboot

Post 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.
Tom

Re:scroll, keyboard, and reboot

Post 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...
Tim

Re:scroll, keyboard, and reboot

Post 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.
Tom

Re:scroll, keyboard, and reboot

Post by Tom »

fixed the bug, had to load more sectors.

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