custom interrupts and such

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
khaos_86

custom interrupts and such

Post by khaos_86 »

Hello everyone.

I have a nearly finished boot sector going. Right
now it is real mode only. I would like to change
it to protected mode soon. However, I would like
some clarification. I have real mode and pmode
down okay I suppose, but what is "unreal" mode,
and virtual 86 mode? Who uses them, and why?

About the interrupts. I haven't found a lot of info
on custom interrupts. I would like to have interrupts
much like DOS, one for the disk, one for programs, a
main system call, etc. How can I write my own interrupt
handler for interrupts 20 through 25 or so?

Any help is appreciated. Thanks people!
Guest

RE:custom interrupts and such

Post by Guest »

IMO protected mode=unreal mode.
There are 3 modes:
1. V86
2. Real Mode
3. Protected Mode

In protected mode you can access the mem above 1 Meg.
But, that also my problem, in protected mode you can't
call INTs the way you did in the bootsector.
Hillbillie

RE:custom interrupts and such

Post by Hillbillie »

>but what is "unreal" mode<

It's identical to real mode, except that you can 32-bit addresses (and
they won't cause exception 0x0D).
J. Weeks

RE:custom interrupts and such

Post by J. Weeks »

>but what is "unreal" mode,

In a nutshell:
You enter pmode, change the lengths of the
descriptors to 4GB (or whatever) and jmp
back to real mode... the segment lengths stay the
same, so you've got access to all your memory...
no protection, and no native 32-bit code though.

I wouldn't reccomend it.

>and virtual 86 mode?

Used in pmode to "emulate" x86 programs with
protection schemes implemented. Usually used to
emulator binaries from other operating systems.

It's very much like a debugger, actually.

>About the interrupts. I haven't found a lot of info
>on custom interrupts. I would like to have interrupts
>much like DOS, one for the disk, one for programs, a
>main system call, etc. How can I write my own interrupt
>handler for interrupts 20 through 25 or so?

You mean 0x20? I wouldn't reccoment 20... might
still conflict with hardware interrupts (?)

I'd also reccomend remapping (using CR3, and the
paging system) the operating system functions
into the users address space so they can, more or
less, call OS functions directly, not through
interrupts... might be faster... don't know how
well protection can be implemented, though.

>
>Any help is appreciated. Thanks people!
Post Reply