OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 11:32 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: How to setup the interupt vector table in asm
PostPosted: Sun Sep 16, 2001 11:00 pm 
Hey...
I have completed writing a kernel for my OS. How do
I set up the Interupt Vector/Descriptor Table(s) so
I can use my own interups, if anyone has a tut or can
just tell me how to do it. Any help is GREATLY Appreciated
thanks in advance


Top
  
 
 Post subject: RE:How to setup the interupt vector table in asm
PostPosted: Sun Sep 16, 2001 11:00 pm 
>On 2001-09-17 00:03:44, NANOSAURUS wrote:
>Hey...
>I have completed writing a kernel for my OS. How do
>I set up the Interupt Vector/Descriptor Table(s) so
>I can use my own interups, if anyone has a tut or can
>just tell me how to do it. Any help is GREATLY Appreciated
>thanks in advance

Same as in C, really. Just create an array of
structures of an IDT entry and fill 'em in.

I actually just hard code most of my idt values,
and have a couple c routines to read/write to the
idt as needed.

j.weeks


Top
  
 
 Post subject: Im in real mode......
PostPosted: Thu Sep 20, 2001 11:00 pm 
>On 2001-09-17 14:14:59, j.weeks wrote:
>>On 2001-09-17 00:03:44, NANOSAURUS wrote:
>>Hey...
>>I have completed writing a kernel for my OS. How do
>>I set up the Interupt Vector/Descriptor Table(s) so
>>I can use my own interups, if anyone has a tut or can
>>just tell me how to do it. Any help is GREATLY Appreciated
>>thanks in advance
>
>Same as in C, really. Just create an array of
>structures of an IDT entry and fill 'em in.
>
>I actually just hard code most of my idt values,
>and have a couple c routines to read/write to the
>idt as needed.
>
>j.weeks

I found out where its at in memory, I just cant seem to
set it up properly. my code to initialize my interupt follows:

mov AX, 1500h ; Segment to kernel = 1500h
xor BX, BX
mov FS, BX
cli
mov [FS:21h*4],ax
sti

im using NASM and yes I know int 21h is an MSDOS interupt
but im using it for now. It compiles fine and when i run
the program it just keeps restarting my system. If you
could answer why its doing this so i can better understand
the IVT a bit more i would greatly appreciate it.
Thanks in advance...NANOSAURUS


Top
  
 
 Post subject: Im in real mode......
PostPosted: Thu Sep 20, 2001 11:00 pm 
>On 2001-09-17 14:14:59, j.weeks wrote:
>>On 2001-09-17 00:03:44, NANOSAURUS wrote:
>>Hey...
>>I have completed writing a kernel for my OS. How do
>>I set up the Interupt Vector/Descriptor Table(s) so
>>I can use my own interups, if anyone has a tut or can
>>just tell me how to do it. Any help is GREATLY Appreciated
>>thanks in advance
>
>Same as in C, really. Just create an array of
>structures of an IDT entry and fill 'em in.
>
>I actually just hard code most of my idt values,
>and have a couple c routines to read/write to the
>idt as needed.
>
>j.weeks

I found out where its at in memory, I just cant seem to
set it up properly. my code to initialize my interupt follows:

mov AX, 1500h ; Segment to kernel = 1500h
xor BX, BX
mov FS, BX
cli
mov [FS:21h*4],ax
sti

im using NASM and yes I know int 21h is an MSDOS interupt
but im using it for now. It compiles fine and when i run
the program it just keeps restarting my system. If you
could answer why its doing this so i can better understand
the IVT a bit more i would greatly appreciate it.
Thanks in advance...NANOSAURUS


Top
  
 
 Post subject: Im in real mode......
PostPosted: Thu Sep 20, 2001 11:00 pm 
>On 2001-09-17 14:14:59, j.weeks wrote:
>>On 2001-09-17 00:03:44, NANOSAURUS wrote:
>>Hey...
>>I have completed writing a kernel for my OS. How do
>>I set up the Interupt Vector/Descriptor Table(s) so
>>I can use my own interups, if anyone has a tut or can
>>just tell me how to do it. Any help is GREATLY Appreciated
>>thanks in advance
>
>Same as in C, really. Just create an array of
>structures of an IDT entry and fill 'em in.
>
>I actually just hard code most of my idt values,
>and have a couple c routines to read/write to the
>idt as needed.
>
>j.weeks

I found out where its at in memory, I just cant seem to
set it up properly. my code to initialize my interupt follows:

mov AX, 1500h ; Segment to kernel = 1500h
xor BX, BX
mov FS, BX
cli
mov [FS:21h*4],ax
sti

im using NASM and yes I know int 21h is an MSDOS interupt
but im using it for now. It compiles fine and when i run
the program it just keeps restarting my system. If you
could answer why its doing this so i can better understand
the IVT a bit more i would greatly appreciate it.
Thanks in advance...NANOSAURUS


Top
  
 
 Post subject: RE:Im in real mode......
PostPosted: Mon Sep 24, 2001 11:00 pm 
Actually, you need more than that. That's how it
must look like:

xor bx, bx
mov fs, bx
cli
mov ax, my_21h_int
mov [fs:0x21 * 4], ax
mov ax, 0x1500
mov [fs:0x21 * 4 + 2], ax
sti


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: Majestic-12 [Bot] and 216 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