I set rtc as:
mov al,0xB
out 0x70,al
mov al,00010100b ;24hours, update ended interrupt
out 0x71,al
ISR8:
pushad
mov al,0x0C
out 0x70,al
in al,0x71
mov al,EOI
out PIC8259B_Port_Command,al
out PIC8259A_Port_Command,al
popad
iret
got CMOS time invalid error, each time after I run my kernel
Re: got CMOS time invalid error, each time after I run my ke
Hi,
The BIOS probably uses a 12 hour clock and BCD encoding, rather than a 24 hour clock with binary encoding. Completely changing the time clock's format is going to confuse the BIOS, which is why you're getting an "invalid time" error during boot.
Never change the BCD/binary or 12/24 hour flags - read the flags in register 0x0B and use them to determine how to decode/encode values in other RTC registers.
Also, other OSs will assume the RTC is set to UTC or local time or standard time, so you shouldn't set your own time without asking the user if you should use UTC or local time or standard time. IMHO the RTC should *always* be set to UTC in all computers, but unfortunately Microsoft don't agree with sane people.
Cheers,
Brendan
The BIOS probably uses a 12 hour clock and BCD encoding, rather than a 24 hour clock with binary encoding. Completely changing the time clock's format is going to confuse the BIOS, which is why you're getting an "invalid time" error during boot.
Never change the BCD/binary or 12/24 hour flags - read the flags in register 0x0B and use them to determine how to decode/encode values in other RTC registers.
Also, other OSs will assume the RTC is set to UTC or local time or standard time, so you shouldn't set your own time without asking the user if you should use UTC or local time or standard time. IMHO the RTC should *always* be set to UTC in all computers, but unfortunately Microsoft don't agree with sane people.
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.
Hi,
Cheers,
Brendan
That depends - is it a USB keyboard?blackoil wrote:and I found that I couldn't changed the keystroke rate on my intel mother board, there is no any BIOS option completely. Whatever I sent to 0x60, I got the same keystroke rate. Is it normal?
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.
extremely grandma model, big 5pin head, has to use converter for ps/2 interface. Maybe my typerate routine is incorrect, or intel bios hard coded, as I can't find any option related to keyboard.
I try to use BCD format, the intel BIOS doesn't complain now. Maybe other BIOS won't complain, only intel's.
Mulder
I try to use BCD format, the intel BIOS doesn't complain now. Maybe other BIOS won't complain, only intel's.
Mulder
Hi,
Cheers,
Brendan
That should still work - if you change the typematic rate after boot it should remain changed until you reboot or reset the keyboard (where "reset the keyboard" includes using an older "mechanical switch" style KVM switch, which is like unplugging the keyboard and plugging it back in - keyboard does full reset and sends a BAT).blackoil wrote:extremely grandma model, big 5pin head, has to use converter for ps/2 interface. Maybe my typerate routine is incorrect, or intel bios hard coded, as I can't find any option related to keyboard.
I did the same thing years ago and got the same problem. I'm not sure which computer I was using back then, but the BIOS wasn't written by Intel (probably a "new" Pentium machine with an AMI BIOS).blackoil wrote:I try to use BCD format, the intel BIOS doesn't complain now. Maybe other BIOS won't complain, only intel's.
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.
I use these codes to initialize Keyboard in real mode with cli, but seems
Edited by Brendan: Added code tags
Code: Select all
IBF8042: nop,,nop,,nop,,nop,,nop
in al,PS2_Port_Status
test al,PS2_KB_Bit_IBF
jnz IBF8042
ret
OBF8042: nop,,nop,,nop,,nop,,nop
in al,PS2_Port_Status
test al,PS2_KB_Bit_OBF
jz OBF8042
ret
.enableA20: call IBF8042
mov al,0xD1
out PS2_Port_Command,al
.typerate: call IBF8042
mov al,0xF3
out PS2_Port_Data,al
call IBF8042
mov al,0x00
out PS2_Port_Data,al
call OBF8042
in al,PS2_Port_Data
;Final revision, works well under DOS
;in Bochs, you can see the KB typematic rate has been changed in log file
Edited by Brendan: Added code tags
;in Bochs, you can see the KB typematic rate has been changed in log file
Code: Select all
PS2_Port_Command equ 0x64
PS2_Port_Status equ 0x64
PS2_Port_Data equ 0x60
PS2_KB_Bit_IBF equ 00000010b
PS2_KB_Bit_OBF equ 00000001b
bits 16
org 256
cli
call IBF8042
mov al,0xF3
out PS2_Port_Data,al
call IBF8042
mov al,0x1F
out PS2_Port_Data,al
sti
int 0x20
IBF8042: nop,,nop,,nop,,nop,,nop
in al,PS2_Port_Status
test al,PS2_KB_Bit_IBF
jnz IBF8042
ret
OBF8042: nop,,nop,,nop,,nop,,nop
in al,PS2_Port_Status
test al,PS2_KB_Bit_OBF
jz OBF8042
ret