int 13h, can it be used within protected mode of i386?
int 13h, can it be used within protected mode of i386?
Hi
I am a student working on a multitasking OS over i386 platform.
Well what I wanna know is that can't int13h of real mode be used in protected mode...here is what i think
1. save the ISR address of int 13h from IVT.
2. Load the same vector address into IDT at some other index say 21h.
I think this way can make ISR of int13h be used within prot mode using some other int number say 21h.
Please do correct me
Thanks
I am a student working on a multitasking OS over i386 platform.
Well what I wanna know is that can't int13h of real mode be used in protected mode...here is what i think
1. save the ISR address of int 13h from IVT.
2. Load the same vector address into IDT at some other index say 21h.
I think this way can make ISR of int13h be used within prot mode using some other int number say 21h.
Please do correct me
Thanks
Re: int 13h, can it be used within protected mode of i386?
You are hereby corrected. All BIOS interrupts are written in real mode assembly. They can not be used in protected mode, ever. If you are thinking about v86 mode, forget that too for int 13h, as you'd need to code proper DMA and IRQ handling, in which case it's easier to just write your own disk handling.Pitchu wrote:Please do correct me
JAL
Hi,
You can use some of the interrupts in v86 mode, but generally using v86 for IO is a Bad Idea (tm). You are alright for things like VBE and switching VGA modes, but for anything which is likely to either fire an IRQ, or which needs DMA (as indicated above), you are better off writing protected mode drivers.
What is meant by real mode assembly, is that the BIOS routines expect to be in an environment where the default operand sizes are 16 bit and that real addressing mode applies.
A word of warning: don't rely on v86 too much if you plan to port your OS to x86-64. In long mode, you can't use v86 at all.
Cheers,
Adam
You can use some of the interrupts in v86 mode, but generally using v86 for IO is a Bad Idea (tm). You are alright for things like VBE and switching VGA modes, but for anything which is likely to either fire an IRQ, or which needs DMA (as indicated above), you are better off writing protected mode drivers.
What is meant by real mode assembly, is that the BIOS routines expect to be in an environment where the default operand sizes are 16 bit and that real addressing mode applies.
A word of warning: don't rely on v86 too much if you plan to port your OS to x86-64. In long mode, you can't use v86 at all.
Cheers,
Adam
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
the DMA chip bypasses the memory management of the processor. Once the bios starts accessing it it might start writing or reading data to where you don't want it to. It's not specific for either 8-bit or 16-bit transfers
In protected mode, IRQs always go to the interrupt table of the kernel, and not to the IVT. Which means you need some way of telling userspace that an interrupt has occurred. Doing that is something that can quickly lead to ugly hacks.
In protected mode, IRQs always go to the interrupt table of the kernel, and not to the IVT. Which means you need some way of telling userspace that an interrupt has occurred. Doing that is something that can quickly lead to ugly hacks.
Thanks everybody
Nice of u and i wanna mention that i have gone through intel manuals but u know Can it be done like this always clicks me
I learnt;
1. Only int 10h(vbe for SVGA) can be used in PM.
2. I can its ISR address in IDT after raising it to 32 bit.
3. Clearly, DMA and IRQ based INTs are lost in protected mode because of addressing problem.
I wish I am correct
Nice of u and i wanna mention that i have gone through intel manuals but u know Can it be done like this always clicks me
I learnt;
1. Only int 10h(vbe for SVGA) can be used in PM.
2. I can its ISR address in IDT after raising it to 32 bit.
3. Clearly, DMA and IRQ based INTs are lost in protected mode because of addressing problem.
I wish I am correct
Unfortunately, you don't seem to have picked up on what people have been saying. No BIOS interrupts can be used in (vanilla) protected mode.. You have to create a v8086 task to do that. Then, only BIOS interrupts which do not use the DMA chip or any interrupt requests will work.Pitchu wrote:Thanks everybody
Nice of u and i wanna mention that i have gone through intel manuals but u know Can it be done like this always clicks me
I learnt;
1. Only int 10h(vbe for SVGA) can be used in PM.
2. I can its ISR address in IDT after raising it to 32 bit.
3. Clearly, DMA and IRQ based INTs are lost in protected mode because of addressing problem.
I wish I am correct
I'm afraid he's beyond salvation. Perhaps his incredibly bad English doesn't help. I can imagine it's difficult reading the Intel manuals with only a very basic grasp of the language. On the other hand, he doesn't even seem to have tried.JamesM wrote:Unfortunately, you don't seem to have picked up on what people have been saying.
JAL
Yep U may be right about my 'English' because it isn't my native language and im writing these posts under -13 degree with a lots of things in my mind regarding MultiTasking OS im working on.I'm afraid he's beyond salvation. Perhaps his incredibly bad English doesn't help. I can imagine it's difficult reading the Intel manuals with only a very basic grasp of the language. On the other hand, he doesn't even seem to have tried.
JAL
While Im thinking about Disk Access Im interrupted by Code Relocation.
Thanks 2 everybody for posting and i really misinterpreted posts and got confused by an earlier thread
I thought it can be done without using v86 mode (using the address of ISR).Warmaster199
Guest
Posted: Sun Oct 06, 2002 4:13 am Post subject: Re:Disk Access Under Pmode
--------------------------------------------------------------------------------
Actually, you can grab a pointer to a function in the VESA BIOS to switch banks. The VESA BIOS Switch Bank function is 32-bit protected mode code, so it's alot faster to get that pointer, rather than use the Bios calls
http://www.osdev.org/phpBB2/viewtopic.p ... cess+pmode
The ISRs have a different purpose - they are pointers to handlers for processor exceptions, IRQs, and your own interrupts (not the BIOS ones).I thought it can be done without using v86 mode (using the address of ISR).
Only in v86. No BIOS interrupts are available in PM!!!1. Only int 10h(vbe for SVGA) can be used in PM.
No. You can't just set an ISR to the address of the BIOS interrupt handler - the code's memory addressing won't work. Just write your own disk driver (it'd be quicker and easier to do).2. I can its ISR address in IDT after raising it to 32 bit.
The DMA and PICs (which manage the IRQs) are not affected by this problem. You just have to configure them to use them in protected mode.3. Clearly, DMA and IRQ based INTs are lost in protected mode because of addressing problem.
EDIT: Also, the above quote about grabbing a pointer to a function is specific to that single function, not the entire BIOS call
Hope this helps,
Julian
"Sufficiently advanced stupidity is indistinguishable from malice."
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
Re: int 13h, can it be used within protected mode of i386?
The primary reason real mode routines (in the BIOS and elsewhere) can't be used is that they will assume that they can play fast and loose with the segment registers, ignoring what's in the GDT (which doesn't exist in real mode).Pitchu wrote:Hi
I am a student working on a multitasking OS over i386 platform.
Well what I wanna know is that can't int13h of real mode be used in protected mode...here is what i think
1. save the ISR address of int 13h from IVT.
2. Load the same vector address into IDT at some other index say 21h.
I think this way can make ISR of int13h be used within prot mode using some other int number say 21h.
Please do correct me
Thanks
The continuous image of a connected set is connected.
Thanks everybody
Im not goin to use BIOS interrupts in PM, not even in v86 mode.
I mean, wont IRQ0 invoke INT 08 routine i.e. index 9 in IDT.
Im not goin to use BIOS interrupts in PM, not even in v86 mode.
Why to configure PIC?The DMA and PICs (which manage the IRQs) are not affected by this problem. You just have to configure them to use them in protected mode.
EDIT: Also, the above quote about grabbing a pointer to a function is specific to that single function, not the entire BIOS call
Hope this helps,
Julian
I mean, wont IRQ0 invoke INT 08 routine i.e. index 9 in IDT.