Bona Fide OS Developer
View unanswered posts | View active topics It is currently Sun Feb 28, 2021 7:00 pm



Post new topic Reply to topic  [ 1 post ] 
 Initialization and Usage Tricks 
Author Message

Joined: Sun Sep 19, 2010 9:45 am
Posts: 24
Post Initialization and Usage Tricks
Code:
 ;Activate RTC IRQ by unmasking
 ;its corresponding bit (0 in PIC 2):
 ;;
   ;Read the bit mask:
   ;;
    in al,0xA1

   ;Unmask bit 0 (IRQ8 for RTC):
   ;;
    and al,11111110b

   ;Send the new bit mask:
   ;;
    out 0xA1,al


 ;Now Install the ISR in the IDT, IRQ8:
 ;;
  ;      AL == Interrupt Number
  ;     EBX == Entry point of our ISR
  ;;
   mov al,0x70        ;IRQ8, RTC installed at INT 0x70 in this example
   mov ebx,OPCODE__IRQ8__RTC_handler  ;Function name
   call IDT_x86_32__InstallISR






Code:
align wideword_sz
OPCODE__IRQ8__RTC_handler:

 ;Update BDA 24 hour second counter:
 ;;
  inc dword[0x46C]
  cmp dword[0x46C],(24*60*60)
  jb .noupdflag

    mov dword[0x46C],0   ;Reset 24 hour counter
    mov dword[0x470],1   ;Set 24 hour flag (needs to be set to 0 manually)


  align wideword_sz
  .noupdflag:

iretwide

_________________
Image ~
Image


Mon Jan 18, 2021 9:50 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin and tweaked by the BF Team.