OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:20 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Interrupts.s gives various errors
PostPosted: Fri May 06, 2022 9:02 am 
Offline

Joined: Fri Apr 01, 2022 10:06 am
Posts: 23
Location: Türkiye, Uşak/Merkez
Hello. The interrupt.S file gives various errors, what is the solution, I am posting the code and screenshot:

Interrupt.s Code:
Code:
.set IRQ_BASE, 0x20

.section .text

.extern _ZN16InterruptManager15handleInterruptEhj

.global _ZN16InterruptManager22IgnoreInterruptRequestEv






.macro HandleException num
.global _ZN16InterruptManager16HandleException\num\()Ev
_ZN16InterruptManager16HandleException\num\()Ev:
    movb $\num, (interruptNumber)
    jmp int_bottom
.endm

.macro HandleInterruptRequest num
.global _ZN16InterruptManager26HandleInterruptRequest\num\()Ev
_ZN16InterruptManager26HandleInterruptRequest\num\()Ev:
             movb $\num + IRQ_BASE, (interruptNumber)
             jmp int_bottom
        .endm     



HandleInterruptRequest 0x00
HandleInterruptRequest 0x01




int_bottom:

   pusha
   pushl %ds
   pushl %es
   pushl %fs
   pushl %gs
   
   pushl %esp
   push (interruptNumber)
   call _ZN16InterruptManager15handleInterruptEhj
   # addl $5, %esp
   movl %eax, %esp
   
   popl %gs
   popl %fs
   popl %es
   popl %ds
   popa
   
   
_ZN16InterruptManager22IgnoreInterruptRequestEv:
   
   
   iret
   
   
.data
    .interruptnumber: .byte 0
   


Attachments:
Ekran görüntüsü 2022-05-05 200318.png
Ekran görüntüsü 2022-05-05 200318.png [ 34.76 KiB | Viewed 2662 times ]

_________________
M. Alp
Top
 Profile  
 
 Post subject: Re: Interrupts.s gives various errors
PostPosted: Fri May 06, 2022 9:37 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Again, the error messages are telling you exactly what the problem is. Time to learn x86 assembler programming, and the meaning of the various directives and defines.


Top
 Profile  
 
 Post subject: Re: Interrupts.s gives various errors
PostPosted: Fri May 06, 2022 3:10 pm 
Offline
Member
Member

Joined: Mon Jul 05, 2021 6:57 pm
Posts: 118
"interruptnumber" is not declared as a global (via the ".global" directive), and is inconsistently spelled (once as ".interruptnumber", once as "interruptNumber").


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 41 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