OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 9:02 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Change Interrupt Vector Table?
PostPosted: Tue Oct 11, 2016 12:22 pm 
Offline
Member
Member

Joined: Sun Oct 09, 2016 4:38 am
Posts: 273
I am on rebuilding my OS and implementing C later, and i now want to create a custom interrupt to read sector inputted in AX, so i could use something like this to read sector 25:
Code:
mov ax, 25
int 23h

But how do i edit the interrupt vector table and add that?

_________________
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS


Last edited by NunoLava1998 on Tue Oct 11, 2016 1:10 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Change Interrupt Vector Table?
PostPosted: Tue Oct 11, 2016 1:09 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
Thanks for letting us know. A function to read a sector from a storage device is a useful component of any OS.


Top
 Profile  
 
 Post subject: Re: Change Interrupt Vector Table?
PostPosted: Tue Oct 11, 2016 1:09 pm 
Offline
Member
Member

Joined: Sun Oct 09, 2016 4:38 am
Posts: 273
iansjack wrote:
Thanks for letting us know. A function to read a sector from a storage device is a useful component of any OS.

thank you for not realizing what i was saying

_________________
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS


Top
 Profile  
 
 Post subject: Re: Change Interrupt Vector Table?
PostPosted: Tue Oct 11, 2016 1:17 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
My confusion. I see from your edit that you are asking for code. As explained by others, writing an OS consists of doing the research and then doing the work rather than asking others to do the research and work for you. Else, what's the point?

I believe from your posts so far that you are making a series of classic beginner's mistakes. Perhaps you haven't studied the processor before starting your project? I recommend the Intel Programmer's Manuals, which will answer your questions, or at least give you a starting point. You will then be in a position to ask sensible questions.


Top
 Profile  
 
 Post subject: Re: Change Interrupt Vector Table?
PostPosted: Tue Oct 11, 2016 1:51 pm 
Offline
Member
Member
User avatar

Joined: Sun Sep 19, 2010 10:05 pm
Posts: 1074
Check the wiki page. It has everything you need to update the IVT with your own custom interrupt handler.

IVT

But the short answer is going to be something like:

Code:
push cs
pop ax

mov [142], ax
mov [140], interrupt23Handler

interrupt23Handler:
// Put Read Code Here


Your IVT starts at address 0x0, and contains 256 entries of 4 bytes each. Each entry has the segment and offset of that particular event handler, so the INT 0 handler is at address 0x00, and the INT 1 handler is at address 0x04, and so on.

Let us know if you have any questions.

_________________
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott


Top
 Profile  
 
 Post subject: Re: Change Interrupt Vector Table?
PostPosted: Tue Oct 11, 2016 1:57 pm 
Offline
Member
Member

Joined: Sun Oct 09, 2016 4:38 am
Posts: 273
SpyderTL wrote:
Check the wiki page. It has everything you need to update the IVT with your own custom interrupt handler.

IVT

But the short answer is going to be something like:

Code:
push cs
pop ax

mov [142], ax
mov [140], interrupt23Handler

interrupt23Handler:
// Put Read Code Here


Your IVT starts at address 0x0, and contains 256 entries of 4 bytes each. Each entry has the segment and offset of that particular event handler, so the INT 0 handler is at address 0x00, and the INT 1 handler is at address 0x04, and so on.

Let us know if you have any questions.

thank you

_________________
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS


Top
 Profile  
 
 Post subject: Re: Change Interrupt Vector Table?
PostPosted: Tue Oct 11, 2016 2:48 pm 
Offline
Member
Member

Joined: Tue Mar 04, 2014 5:27 am
Posts: 1108
Would you please remove the large image from the signature. It eats screen space and bandwidth.


Top
 Profile  
 
 Post subject: Re: Change Interrupt Vector Table?
PostPosted: Tue Oct 11, 2016 4:02 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
As in most forums, display of users' signatures can be turned off. Probably a good idea anyway.


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

All times are UTC - 6 hours


Who is online

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