Page 1 of 1
Change Interrupt Vector Table?
Posted: Tue Oct 11, 2016 12:22 pm
by NunoLava1998
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:
But how do i edit the interrupt vector table and add that?
Re: Change Interrupt Vector Table?
Posted: Tue Oct 11, 2016 1:09 pm
by iansjack
Thanks for letting us know. A function to read a sector from a storage device is a useful component of any OS.
Re: Change Interrupt Vector Table?
Posted: Tue Oct 11, 2016 1:09 pm
by NunoLava1998
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
Re: Change Interrupt Vector Table?
Posted: Tue Oct 11, 2016 1:17 pm
by iansjack
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.
Re: Change Interrupt Vector Table?
Posted: Tue Oct 11, 2016 1:51 pm
by SpyderTL
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: Select all
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.
Re: Change Interrupt Vector Table?
Posted: Tue Oct 11, 2016 1:57 pm
by NunoLava1998
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: Select all
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
Re: Change Interrupt Vector Table?
Posted: Tue Oct 11, 2016 2:48 pm
by alexfru
Would you please remove the large image from the signature. It eats screen space and bandwidth.
Re: Change Interrupt Vector Table?
Posted: Tue Oct 11, 2016 4:02 pm
by iansjack
As in most forums, display of users' signatures can be turned off. Probably a good idea anyway.