Page 1 of 1

custom interrupts and such

Posted: Sat Jan 26, 2002 12:00 am
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!

RE:custom interrupts and such

Posted: Sun Jan 27, 2002 12:00 am
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.

RE:custom interrupts and such

Posted: Sun Jan 27, 2002 12:00 am
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).

RE:custom interrupts and such

Posted: Thu Jan 31, 2002 12:00 am
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!