IDT in assembly.
Posted: Thu Nov 03, 2011 10:37 am
Hello, World!
As this is my first post, let me briefly introduce myself. I have been fascinated by and interested in computers ever since I was a kid. More recently I have been looking into operating systems. Most of them are ugly, but some I find particularly beautiful. Eventually I started looking into creating one of my own. I am still in research and design mode mostly. Anyway, let me explain my problem. While I was trying to setup IDT in assembly I had this code.
While compiling with NASM it gave me this error.
So I modified the code to this.
Now I get this error.
Have a nice day. : )
As this is my first post, let me briefly introduce myself. I have been fascinated by and interested in computers ever since I was a kid. More recently I have been looking into operating systems. Most of them are ugly, but some I find particularly beautiful. Eventually I started looking into creating one of my own. I am still in research and design mode mostly. Anyway, let me explain my problem. While I was trying to setup IDT in assembly I had this code.
Code: Select all
extern isr1
extern isr2
...
extern isr47
lidt [idtd]
%macro IDTENTRY 1
dw isr%1 & 0xffff
dw 0x08
db 0
db 10001110b
dw isr%1 >> 16
%endmacro
idtd:
dw 375
dd idt
idt:
IDTENTRY 1
IDTENTRY 2
...
IDTENTRY 47
I searched on the web and found this. http://wiki.osdev.org/I_Cant_Get_Interr ... 2_mean_.3Fentry.a:132: error: `&' operator may only be applied to scalar values
entry.a:132: error: shift operator may only be applied to scalar values
...
So I modified the code to this.
Code: Select all
%define SECTIONBASE 0x100000
extern isr1
extern isr2
...
extern isr47
lidt [idtd]
%macro IDTENTRY 1
dw (SECTIONBASE isr%1 - $$) & 0xffff
dw 0x08
db 0
db 10001110b
dw (SECTIONBASE isr%1 - $$) >> 16
%endmacro
idtd:
dw 375
dd idt
idt:
IDTENTRY 1
IDTENTRY 2
...
IDTENTRY 47
Does anyone know how to fix it? Sorry, if it's a dumb question, but I'm out of ideas. And perhaps the Wiki should be updated?entry.a:132: error: expecting `)'
entry.a:132: error: expecting `)'
...
Have a nice day. : )