OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Mar 18, 2024 9:19 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Scroll lock light
PostPosted: Fri Jun 18, 2004 3:25 pm 
Please can anybody help me :'(

Created a simple boot image. Works fine. The next step is to enter protected mode. Just to make sure I was in protected mode I thought I would create a simple routine in turning on the scroll lock key light when I entered protected mode. Tested it before making the switch nothing happens.....
Now as a guide I have been using the book "The Undocumented PC"
So I made sure the keyboard buffer was empty before sending any command. Sent the relivant information but still no luck
Here is the code used.

;;This next thing is just a test....
Loop66:
in al,0x64
jmp $+2
test al,2
jz short Ok
jmp short Loop66
Ok:
mov al,0xed
out 0x60,al
;jmp $+2 ;Clear prefetch que!!!
mov al,0x01
out 0x60,al
;;End test.

Now I have heard somewhere that you have to make a delay after sending any commands to the I/O ports is this true :)

Thanks in advance ;)


Top
  
 
 Post subject: Re:Scroll lock light
PostPosted: Fri Jun 18, 2004 10:01 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

You need to make sure the buffer is empty every time you put data into it. For example:

Code:
    ;;This next thing is just a test....
Loop661:
    in al,0x64
    test al,2
    jz short Ok1
    jmp short Loop661
Ok1:
    mov al,0xed
    out 0x60,al

Loop662:
    in al,0x64
    test al,2
    jz short Ok2
    jmp short Loop662
Ok2:
    mov al,0x01
    out 0x60,al



My 64k OS wrote:
Now I have heard somewhere that you have to make a delay after sending any commands to the I/O ports is this true :)


It used to be true for some computers. Accessing IO ports is slow, and the CPU/motherboard is supposed to wait for it to happen. Old motherboards for 80286 or 80386 (can't remember exactly which) failed to wait, so programmers had to put little delays after accessing any IO ports. If your OS doesn't support 80386 (or earlier) computers it shouldn't be necessary.

Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re:Scroll lock light
PostPosted: Fri Jun 18, 2004 10:59 pm 
Offline
Member
Member

Joined: Sat Nov 25, 2006 12:50 am
Posts: 454
..


Last edited by Perica on Tue Dec 05, 2006 9:31 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re:Scroll lock light
PostPosted: Fri Jun 18, 2004 11:58 pm 
I think that some OSes will pause scrolling the screen so you can look at the info.

Pete


Top
  
 
 Post subject: Re:Scroll lock light
PostPosted: Sat Jun 19, 2004 4:12 am 
Perica wrote:
Just out of curiosity - what is scroll lock used for?

Quote:
I think that some OSes will pause scrolling the screen so you can look at the info.

Like Linux does...


Top
  
 
 Post subject: Re:Scroll lock light
PostPosted: Sat Jun 19, 2004 4:24 am 
Thanks everybody :)


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], SemrushBot [Bot] and 11 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group